Class: Wx::Window
- Inherits:
-
EvtHandler
- Object
- Object
- EvtHandler
- Wx::Window
- Defined in:
- lib/wx/doc/gen/window.rb,
lib/wx/doc/window.rb
Overview
Window is the base class for all windows and represents any visible object on screen.
All controls, top level windows and so on are windows. Sizers and device contexts are not, however, as they don’t appear on screen themselves. Please note that all children of the window will be deleted automatically by the destructor before the window itself is deleted which means that you don’t have to worry about deleting them manually. Please see the window deletion overview for more information. Also note that in this, and many others, wxWidgets classes some GetXXX()
methods may be overloaded (as, for example, #get_size or #get_client_size). In this case, the overloads are non-virtual because having multiple virtual functions with the same name results in a virtual function name hiding at the derived class level (in English, this means that the derived class has to override all overloaded variants if it overrides any of them). To allow overriding them in the derived class, wxWidgets uses a unique protected virtual DoGetXXX()
method and all GetXXX()
ones are forwarded to it, so overriding the former changes the behaviour of the latter.
Styles
This class supports the following styles:
-
Border::BORDER_DEFAULT: The window class will decide the kind of border to show, if any.
-
Border::BORDER_SIMPLE: Displays a thin border around the window. SIMPLE_BORDER is the old name for this style.
-
Border::BORDER_SUNKEN: Displays a sunken border. SUNKEN_BORDER is the old name for this style.
-
Border::BORDER_RAISED: Displays a raised border. RAISED_BORDER is the old name for this style.
-
Border::BORDER_STATIC: Displays a border suitable for a static control. STATIC_BORDER is the old name for this style. Windows only.
-
Border::BORDER_THEME: Displays a native border suitable for a control, on the current platform. On Windows, this will be a themed border; on most other platforms a sunken border will be used. For more information for themed borders on Windows, please see Themed borders on Windows.
-
Border::BORDER_NONE: Displays no border, overriding the default border style for the window. NO_BORDER is the old name for this style.
-
Border::BORDER_DOUBLE: This style is obsolete and should not be used.
-
TRANSPARENT_WINDOW: The window is transparent, that is, it will not receive paint events. Windows only.
-
TAB_TRAVERSAL: This style is used by wxWidgets for the windows supporting TAB navigation among their children, such as Dialog and Panel. It should almost never be used in the application code.
-
WANTS_CHARS: Use this to indicate that the window wants to get all char/key events for all keys - even for keys like TAB or ENTER which are usually used for dialog navigation and which wouldn't be generated without this style. If you need to use this style in order to get the arrows or etc., but would still like to have normal keyboard navigation take place, you should call Navigate in response to the key events for Tab and Shift-Tab.
-
NO_FULL_REPAINT_ON_RESIZE: On Windows, this style used to disable repainting the window completely when its size is changed. Since this behaviour is now the default, the style is now obsolete and no longer has an effect.
-
VSCROLL: Use this style to enable a vertical scrollbar. Notice that this style cannot be used with native controls which don't support scrollbars nor with top-level windows in most ports.
-
HSCROLL: Use this style to enable a horizontal scrollbar. The same limitations as for VSCROLL apply to this style.
-
ALWAYS_SHOW_SB: If a window has scrollbars, disable them instead of hiding them when they are not needed (i.e. when the size of the window is big enough to not require the scrollbars to navigate it). This style is currently implemented for WXMSW, WXGTK and Universal and does nothing on the other platforms.
-
CLIP_CHILDREN: Use this style to eliminate flicker caused by the background being repainted, then children being painted over them. Windows only.
-
FULL_REPAINT_ON_RESIZE: Use this style to force a complete redraw of the window whenever it is resized instead of redrawing just the part of the window affected by resizing. Note that this was the behaviour by default before 2.5.1 release and that if you experience redraw problems with code which previously used to work you may want to try this. Currently this style applies on GTK+ 2 and Windows only, and full repainting is always done on other platforms.
Extra Styles
This class supports the following extra styles:
-
WS_EX_BLOCK_EVENTS: CommandEvents and the objects of the derived classes are forwarded to the parent window and so on recursively by default. Using this flag for the given window allows blocking this propagation at this window, i.e. prevent the events from being propagated further upwards. Dialogs have this flag on by default for the reasons explained in the Events and Event Handling.
-
WS_EX_TRANSIENT: Don't use this window as an implicit parent for the other windows: this must be used with transient windows as otherwise there is the risk of creating a dialog/frame with this window as a parent, which would lead to a crash if the parent were destroyed before the child.
-
WS_EX_CONTEXTHELP: Under Windows, puts a query button on the caption. When pressed, Windows will go into a context-sensitive help mode and wxWidgets will send a EVT_HELP event if the user clicked on an application window. This style cannot be used (because of the underlying native behaviour) together with MAXIMIZE_BOX or MINIMIZE_BOX, so these two styles are automatically turned off if this one is used.
-
WS_EX_PROCESS_IDLE: This window should always process idle events, even if the mode set by IdleEvent.set_mode is IdleMode::IDLE_PROCESS_SPECIFIED.
-
WS_EX_PROCESS_UI_UPDATES: This window should always process UI update events, even if the mode set by UpdateUIEvent.set_mode is UpdateUIMode::UPDATE_UI_PROCESS_SPECIFIED.
Events emitted by this class
Event handler methods for events emitted by this class:
-
EvtHandler#EVT_ACTIVATE(meth = nil, &block): Process a EVT_ACTIVATE event. See ActivateEvent.
-
EvtHandler#evt_child_focus(meth = nil, &block): Process a EVT_CHILD_FOCUS event. See ChildFocusEvent.
-
EvtHandler#evt_context_menu(meth = nil, &block): A right click (or other context menu command depending on platform) has been detected. See ContextMenuEvent.
-
EvtHandler#evt_help(id, meth = nil, &block): Process a EVT_HELP event. See HelpEvent.
-
EvtHandler#evt_help_range(id1, id2, meth = nil, &block): Process a EVT_HELP event for a range of ids. See HelpEvent.
-
EvtHandler#evt_drop_files(meth = nil, &block): Process a EVT_DROP_FILES event. See DropFilesEvent.
-
EvtHandler#evt_erase_background(meth = nil, &block): Process a EVT_ERASE_BACKGROUND event. See EraseEvent.
-
EvtHandler#evt_set_focus(meth = nil, &block): Process a EVT_SET_FOCUS event. See FocusEvent.
-
EvtHandler#evt_kill_focus(meth = nil, &block): Process a EVT_KILL_FOCUS event. See FocusEvent.
-
EvtHandler#evt_idle(meth = nil, &block): Process a EVT_IDLE event. See IdleEvent.
-
EvtHandlerevt_joy_*(meth = nil, &block): Processes joystick events. See JoystickEvent.
-
EvtHandler#evt_key_down(meth = nil, &block): Process a EVT_KEY_DOWN event (any key has been pressed). See KeyEvent.
-
EvtHandler#evt_key_up(meth = nil, &block): Process a EVT_KEY_UP event (any key has been released). See KeyEvent.
-
EvtHandler#evt_char(meth = nil, &block): Process a EVT_CHAR event. See KeyEvent.
-
EvtHandler#evt_char_hook(meth = nil, &block): Process a EVT_CHAR_HOOK event. See KeyEvent.
-
EvtHandler#evt_mouse_capture_lost(meth = nil, &block): Process a EVT_MOUSE_CAPTURE_LOST event. See MouseCaptureLostEvent.
-
EvtHandler#evt_mouse_capture_changed(meth = nil, &block): Process a EVT_MOUSE_CAPTURE_CHANGED event. See MouseCaptureChangedEvent.
-
EvtHandlerevt_mouse_*(meth = nil, &block): See MouseEvent.
-
EvtHandler#evt_paint(meth = nil, &block): Process a EVT_PAINT event. See PaintEvent.
-
EvtHandlerevt_power_*(meth = nil, &block): The system power state changed. See PowerEvent.
-
EvtHandlerevt_scrollwin_*(meth = nil, &block): Process scroll events. See ScrollWinEvent.
-
EvtHandler#evt_set_cursor(meth = nil, &block): Process a EVT_SET_CURSOR event. See SetCursorEvent.
-
EvtHandler#evt_size(meth = nil, &block): Process a EVT_SIZE event. See SizeEvent.
-
EvtHandler#evt_sys_colour_changed(meth = nil, &block): Process a EVT_SYS_COLOUR_CHANGED event. See SysColourChangedEvent.
Category: Miscellaneous Windows
Direct Known Subclasses
BannerWindow, Control, HTML::HtmlHelpWindow, MDIClientWindow, MenuBar, NonOwnedWindow, PG::PGMultiButton, Panel, SashWindow, ScrolledCanvas, SplitterWindow
Class Method Summary collapse
-
.find_focus ⇒ Wx::Window
Finds the window or control which currently has the keyboard focus.
-
.find_window_by_id(id, parent = 0) ⇒ Wx::Window
Find the first window with the given id.
-
.find_window_by_label(label, parent = 0) ⇒ Wx::Window
Find a window by its label.
-
.find_window_by_name(name, parent = 0) ⇒ Wx::Window
Find a window by its name (as given in a window constructor or #create function call).
- .from_dip(*args) ⇒ Object
- .from_phys(*args) ⇒ Object
-
.get_capture ⇒ Wx::Window
Returns the currently captured window.
-
.get_class_default_attributes(variant = Wx::WindowVariant::WINDOW_VARIANT_NORMAL) ⇒ Wx::VisualAttributes
Returns the default font and colours which are used by the control.
-
.new_control_id(count = 1) ⇒ Integer
Create a new ID or range of IDs that are not currently in use.
- .to_dip(*args) ⇒ Object
- .to_phys(*args) ⇒ Object
-
.unreserve_control_id(id, count = 1) ⇒ void
Unreserve an ID or range of IDs that was reserved by Window.new_control_id.
Instance Method Summary collapse
-
#accepts_focus ⇒ Boolean
This method may be overridden in the derived classes to return false to indicate that this control doesn’t accept input at all (i.e. behaves like e.g. StaticText) and so doesn’t need focus.
-
#accepts_focus_from_keyboard ⇒ Boolean
This method may be overridden in the derived classes to return false to indicate that while this control can, in principle, have focus if the user clicks it with the mouse, it shouldn’t be included in the TAB traversal chain when using the keyboard.
-
#accepts_focus_recursively ⇒ Boolean
Overridden to indicate whether this window or one of its children accepts focus.
-
#add_child(child) ⇒ void
Adds a child window.
-
#adjust_for_layout_direction(x, width, widthTotal) ⇒ Integer
Mirror coordinates for RTL layout if this window uses it and if the mirroring is not done automatically like Win32.
-
#always_show_scrollbars(hflag = true, vflag = true) ⇒ void
Call this function to force one or both scrollbars to be always shown, even if the window is big enough to show its entire contents without scrolling.
-
#begin_repositioning_children ⇒ Boolean
Prepare for changing positions of multiple child windows.
-
#cache_best_size(size) ⇒ void
Sets the cached best size value.
-
#can_accept_focus ⇒ Boolean
(also: #can_accept_focus?)
Can this window have focus right now?.
-
#can_accept_focus_from_keyboard ⇒ Boolean
(also: #can_accept_focus_from_keyboard?)
Can this window be assigned focus from keyboard right now?.
-
#can_scroll(orient) ⇒ Boolean
(also: #can_scroll?)
Returns true if this window can have a scroll bar in this orientation.
-
#can_set_transparent ⇒ Boolean
(also: #can_set_transparent?)
Returns true if the system supports transparent windows and calling #set_transparent may succeed.
-
#capture_mouse ⇒ void
Directs all mouse input to this window.
-
#center(dir = Wx::Orientation::BOTH) ⇒ void
A synonym for #centre.
-
#center_on_parent(dir = Wx::Orientation::BOTH) ⇒ void
A synonym for #centre_on_parent.
-
#centre(direction = Wx::Orientation::BOTH) ⇒ void
Centres the window.
-
#centre_on_parent(direction = Wx::Orientation::BOTH) ⇒ void
Centres the window on its parent.
-
#clear_background ⇒ void
Clears the window by filling it with the current background colour.
-
#client_to_screen(pt) ⇒ Wx::Point
Converts to screen coordinates from coordinates relative to this window.
-
#client_to_window_size(size) ⇒ Wx::Size
Converts client area size size to corresponding window size.
-
#close(force = false) ⇒ Boolean
This function simply generates a CloseEvent whose handler usually tries to close the window.
- #convert_dialog_to_pixels(*args) ⇒ Object
- #convert_pixels_to_dialog(*args) ⇒ Object
-
#create(parent, id, pos = Wx::DEFAULT_POSITION, size = Wx::DEFAULT_SIZE, style = 0, name = Wx::PANEL_NAME_STR) ⇒ Boolean
Construct the actual window object after creating the C++ object.
-
#destroy ⇒ Boolean
Destroys the window safely.
-
#destroy_children ⇒ Boolean
Destroys all children of a window.
-
#disable ⇒ Boolean
Disables the window.
-
#disable_focus_from_keyboard ⇒ void
Disable giving focus to this window using the keyboard navigation keys.
-
#do_update_window_ui(event) ⇒ void
Does the window-specific updating after processing the update event.
-
#drag_accept_files(accept) ⇒ void
Enables or disables eligibility for drop file events (OnDropFiles).
-
#each_child {|child| ... } ⇒ Object, Enumerator
Yield each child window to the given block.
-
#enable(enable = true) ⇒ Boolean
Enable or disable the window for user input.
-
#enable_touch_events(eventsMask) ⇒ Boolean
Request generation of touch events for this window.
-
#enable_visible_focus(enable) ⇒ void
Enables or disables visible indication of keyboard focus.
-
#end_repositioning_children ⇒ void
Fix child window positions after setting all of them at once.
-
#find_window_by_id(id) ⇒ Wx::Window
Find the first child window with the given id recursively in the window hierarchy of this window.
-
#find_window_by_label(label) ⇒ Wx::Window
Find the first child window with the given label recursively in the window hierarchy of this window.
-
#find_window_by_name(name) ⇒ Wx::Window
Find the first child window with the given name (as given in a window constructor or #create function call) recursively in the window hierarchy of this window.
-
#fit ⇒ void
Sizes the window to fit its best size.
-
#fit_inside ⇒ void
Similar to #fit, but sizes the interior (virtual) size of a window.
-
#freeze ⇒ void
Freezes the window or, in other words, prevents any updates from taking place on screen, the window is not redrawn at all.
- #from_dip(*args) ⇒ Object
- #from_phys(*args) ⇒ Object
-
#get_accelerator_table ⇒ Wx::AcceleratorTable
(also: #accelerator_table)
Gets the accelerator table for this window.
-
#get_auto_layout ⇒ Boolean
(also: #auto_layout)
Returns true if #layout is called automatically when the window is resized.
-
#get_background_colour ⇒ Wx::Colour
(also: #background_colour)
Returns the background colour of the window.
-
#get_background_style ⇒ Wx::BackgroundStyle
(also: #background_style)
Returns the background style of the window.
-
#get_best_height(width) ⇒ Integer
(also: #best_height)
Returns the best height needed by this window if it had the given width.
-
#get_best_size ⇒ Wx::Size
(also: #best_size)
This functions returns the best acceptable minimal size for the window.
-
#get_best_virtual_size ⇒ Wx::Size
(also: #best_virtual_size)
Return the largest of ClientSize and BestSize (as determined by a sizer, interior children, or other means).
-
#get_best_width(height) ⇒ Integer
(also: #best_width)
Returns the best width needed by this window if it had the given height.
- #get_border(*args) ⇒ Object (also: #border)
-
#get_caret ⇒ Wx::Caret
(also: #caret)
Returns the caret() associated with the window.
-
#get_char_height ⇒ Integer
(also: #char_height)
Returns the character height for this window.
-
#get_char_width ⇒ Integer
(also: #char_width)
Returns the average character width for this window.
-
#get_children ⇒ Wx::WindowList
(also: #children)
Returns a const reference to the list of the window’s children.
-
#get_client_area_origin ⇒ Wx::Point
(also: #client_area_origin)
Get the origin of the client area of the window relative to the window top left corner (the client area may be shifted because of the borders, scrollbars, other decorations…).
-
#get_client_rect ⇒ Wx::Rect
(also: #client_rect)
Get the client rectangle in window (i.e. client) coordinates.
-
#get_client_size ⇒ Wx::Size
(also: #client_size)
This is an overloaded member function, provided for convenience.
-
#get_containing_sizer ⇒ Wx::Sizer
(also: #containing_sizer)
Returns the sizer of which this window is a member, if any, otherwise NULL.
-
#get_content_scale_factor ⇒ Float
(also: #content_scale_factor)
Returns the factor mapping logical pixels of this window to physical pixels.
-
#get_cursor ⇒ Wx::Cursor
(also: #cursor)
Return the cursor associated with this window.
-
#get_default_attributes ⇒ Wx::VisualAttributes
(also: #default_attributes)
Currently this is the same as calling get_class_default_attributes(wx_window.
-
#get_dpi ⇒ Wx::Size
(also: #dpi)
Return the DPI of the display used by this window.
-
#get_dpi_scale_factor ⇒ Float
(also: #dpi_scale_factor)
Returns the ratio of the DPI used by this window to the standard DPI.
-
#get_drop_target ⇒ Wx::DropTarget
(also: #drop_target)
Returns the associated drop target, which may be NULL.
-
#get_effective_min_size ⇒ Wx::Size
(also: #effective_min_size)
Merges the window’s best size into the min size and returns the result.
-
#get_event_handler ⇒ Wx::EvtHandler
(also: #event_handler)
Returns the event handler for this window.
-
#get_extra_style ⇒ Integer
(also: #extra_style)
Returns the extra style bits for the window.
-
#get_font ⇒ Wx::Font
(also: #font)
Returns the font for this window.
-
#get_foreground_colour ⇒ Wx::Colour
(also: #foreground_colour)
Returns the foreground colour of the window.
-
#get_grand_parent ⇒ Wx::Window
(also: #grand_parent)
Returns the grandparent of a window, or NULL if there isn’t one.
-
#get_help_text ⇒ String
(also: #help_text)
Gets the help text to be used as context-sensitive help for this window.
-
#get_help_text_at_point(point, origin) ⇒ String
(also: #help_text_at_point)
Gets the help text to be used as context-sensitive help for this window.
-
#get_id ⇒ Integer
(also: #id)
Returns the identifier of the window.
-
#get_label ⇒ String
(also: #label)
Generic way of getting a label from any window, for identification purposes.
-
#get_layout_direction ⇒ Wx::LayoutDirection
(also: #layout_direction)
Returns the layout direction for this window, Note that LayoutDirection::Layout_Default is returned if layout direction is not supported.
-
#get_max_client_size ⇒ Wx::Size
(also: #max_client_size)
Returns the maximum size of window’s client area.
-
#get_max_height ⇒ Integer
(also: #max_height)
Returns the vertical component of window maximal size.
-
#get_max_size ⇒ Wx::Size
(also: #max_size)
Returns the maximum size of the window.
-
#get_max_width ⇒ Integer
(also: #max_width)
Returns the horizontal component of window maximal size.
-
#get_min_client_size ⇒ Wx::Size
(also: #min_client_size)
Returns the minimum size of window’s client area, an indication to the sizer layout mechanism that this is the minimum required size of its client area.
-
#get_min_height ⇒ Integer
(also: #min_height)
Returns the vertical component of window minimal size.
-
#get_min_size ⇒ Wx::Size
(also: #min_size)
Returns the minimum size of the window, an indication to the sizer layout mechanism that this is the minimum required size.
-
#get_min_width ⇒ Integer
(also: #min_width)
Returns the horizontal component of window minimal size.
-
#get_name ⇒ String
(also: #name)
Returns the window’s name.
-
#get_next_sibling ⇒ Wx::Window
(also: #next_sibling)
Returns the next window after this one among the parent’s children or NULL if this window is the last child.
-
#get_parent ⇒ Wx::Window
(also: #parent)
Returns the parent of the window, or NULL if there is no parent.
- #get_popup_menu_selection_from_user(*args) ⇒ Object (also: #popup_menu_selection_from_user)
-
#get_position ⇒ Wx::Point
(also: #position)
This gets the position of the window in pixels, relative to the parent window for the child windows or relative to the display origin for the top level windows.
-
#get_prev_sibling ⇒ Wx::Window
(also: #prev_sibling)
Returns the previous window before this one among the parent’s children or NULL if this window is the first child.
-
#get_rect ⇒ Wx::Rect
(also: #rect)
Returns the position and size of the window as a Rect object.
-
#get_screen_position ⇒ Wx::Point
(also: #screen_position)
Returns the window position in screen coordinates, whether the window is a child window or a top level one.
-
#get_screen_rect ⇒ Wx::Rect
(also: #screen_rect)
Returns the position and size of the window on the screen as a Rect object.
-
#get_scroll_pos(orientation) ⇒ Integer
(also: #scroll_pos)
Returns the built-in scrollbar position.
-
#get_scroll_range(orientation) ⇒ Integer
(also: #scroll_range)
Returns the built-in scrollbar range.
-
#get_scroll_thumb(orientation) ⇒ Integer
(also: #scroll_thumb)
Returns the built-in scrollbar thumb size.
-
#get_size ⇒ Wx::Size
(also: #size)
See the GetSize(int,int) overload for more info.
-
#get_sizer ⇒ Wx::Sizer
(also: #sizer)
Returns the sizer associated with the window by a previous call to #set_sizer, or NULL.
-
#get_text_extent(string) ⇒ Wx::Size
(also: #text_extent)
Gets the dimensions of the string as it would be drawn on the window with the currently selected font.
-
#get_theme_enabled ⇒ Boolean
(also: #theme_enabled)
Returns true if the window uses the system theme for drawing its background.
-
#get_tool_tip ⇒ Wx::ToolTip
(also: #tool_tip)
Get the associated tooltip or NULL if none.
-
#get_tool_tip_text ⇒ String
(also: #tool_tip_text)
Get the text of the associated tooltip or empty string if none.
-
#get_update_client_rect ⇒ Wx::Rect
(also: #update_client_rect)
Get the update rectangle bounding box in client coords.
-
#get_update_region ⇒ Wx::Region
(also: #update_region)
Returns the region specifying which parts of the window have been damaged.
-
#get_validator ⇒ Wx::Validator
(also: #validator)
Validator functions.
-
#get_virtual_size ⇒ Wx::Size
(also: #virtual_size)
This gets the virtual size of the window in pixels.
-
#get_window_border_size ⇒ Wx::Size
(also: #window_border_size)
Returns the size of the left/right and top/bottom borders of this window in x and y components of the result respectively.
-
#get_window_style ⇒ Integer
(also: #window_style)
See #get_window_style_flag for more info.
-
#get_window_style_flag ⇒ Integer
(also: #window_style_flag)
Gets the window style that was passed to the constructor or #create method.
-
#get_window_variant ⇒ Wx::WindowVariant
(also: #window_variant)
Returns the value previously passed to #set_window_variant.
-
#handle_as_navigation_key(event) ⇒ Boolean
This function will generate the appropriate call to #navigate if the key event is one normally used for keyboard navigation and return true in this case.
-
#handle_window_event(event) ⇒ Boolean
Shorthand for:.
-
#has_capture ⇒ Boolean
(also: #has_capture?)
Returns true if this window has the current mouse capture.
-
#has_extra_style(exFlag) ⇒ Boolean
(also: #has_extra_style?)
Returns true if the window has the given exFlag bit set in its extra styles.
-
#has_flag(flag) ⇒ Boolean
(also: #has_flag?)
Returns true if the window has the given flag bit set.
-
#has_focus ⇒ Boolean
(also: #has_focus?)
Returns true if the window (or in case of composite controls, its main child window) has focus.
-
#has_multiple_pages ⇒ Boolean
(also: #has_multiple_pages?)
This method should be overridden to return true if this window has multiple pages.
-
#has_scrollbar(orient) ⇒ Boolean
(also: #has_scrollbar?)
Returns true if this window currently has a scroll bar for this orientation.
-
#has_transparent_background ⇒ Boolean
(also: #has_transparent_background?)
Returns true if this window background is transparent (as, for example, for StaticText) and should show the parent window background.
-
#hide ⇒ Boolean
Equivalent to calling #show(false).
-
#hide_with_effect(effect, timeout = 0) ⇒ Boolean
This function hides a window, like #hide, but using a special visual effect if possible.
- #hit_test(*args) ⇒ Object
-
#inform_first_direction(direction, size, availableOtherDir) ⇒ Boolean
Sizer and friends use this to give a chance to a component to recalc its min size once one of the final size components is known.
-
#inherit_attributes ⇒ void
This function is (or should be, in case of custom controls) called during window creation to intelligently set up the window visual attributes, that is the font and the foreground and background colours.
-
#inherits_background_colour ⇒ Boolean
Return true if this window inherits the background colour from its parent.
-
#inherits_foreground_colour ⇒ Boolean
Return true if this window inherits the foreground colour from its parent.
-
#init_dialog ⇒ void
Sends an EVT_INIT_DIALOG event, whose handler usually transfers data to the dialog via validators.
-
#initialize(*args) ⇒ Window
constructor
A new instance of Window.
-
#invalidate_best_size ⇒ void
Resets the cached best size value so it will be recalculated the next time it is needed.
-
#is_being_deleted ⇒ Boolean
(also: #being_deleted?)
Returns true if this window is in process of being destroyed.
-
#is_descendant(win) ⇒ Boolean
(also: #descendant?)
Check if the specified window is a descendant of this one.
-
#is_double_buffered ⇒ Boolean
(also: #double_buffered?)
Returns true if the window contents is double-buffered by the system, i.e.
-
#is_enabled ⇒ Boolean
(also: #enabled?)
Returns true if the window is enabled, i.e.
- #is_exposed(*args) ⇒ Object (also: #exposed?)
-
#is_focusable ⇒ Boolean
(also: #focusable?)
Can this window itself have focus?.
-
#is_frozen ⇒ Boolean
(also: #frozen?)
Returns true if the window is currently frozen by a call to #freeze.
-
#is_retained ⇒ Boolean
(also: #retained?)
Returns true if the window is retained, false otherwise.
-
#is_scrollbar_always_shown(orient) ⇒ Boolean
(also: #scrollbar_always_shown?)
Return whether a scrollbar is always shown.
-
#is_shown ⇒ Boolean
(also: #shown?)
Returns true if the window is shown, false if it has been hidden.
-
#is_shown_on_screen ⇒ Boolean
(also: #shown_on_screen?)
Returns true if the window is physically visible on the screen, i.e.
-
#is_this_enabled ⇒ Boolean
(also: #this_enabled?)
Returns true if this window is intrinsically enabled, false otherwise, i.e.
-
#is_top_level ⇒ Boolean
(also: #top_level?)
Returns true if the given window is a top-level one.
-
#is_transparent_background_supported(reason = nil) ⇒ Boolean
(also: #transparent_background_supported?)
Checks whether using transparent background might work.
-
#layout ⇒ Boolean
Lays out the children of this window using the associated sizer.
-
#line_down ⇒ Boolean
Same as ScrollLines (1).
-
#line_up ⇒ Boolean
Same as ScrollLines (-1).
-
#locked(&block) ⇒ Object
Locks the window from updates while executing the given block.
-
#lower_window ⇒ void
(also: #send_to_back)
Lowers the window to the bottom of the window hierarchy (Z-order).
- #move(*args) ⇒ Object
-
#move_after_in_tab_order(win) ⇒ void
Moves this window in the tab navigation order after the specified win.
-
#move_before_in_tab_order(win) ⇒ void
Same as #move_after_in_tab_order except that it inserts this window just before win instead of putting it right after it.
-
#navigate(flags = NavigationKeyEvent::IsForward) ⇒ Boolean
Performs a keyboard navigation action starting from this window.
-
#navigate_in(flags = NavigationKeyEvent::IsForward) ⇒ Boolean
Performs a keyboard navigation action inside this window.
-
#on_internal_idle ⇒ void
This virtual function is normally only used internally, but sometimes an application may need it to implement functionality that should not be disabled by an application defining an OnIdle handler in a derived class.
-
#page_down ⇒ Boolean
Same as ScrollPages (1).
-
#page_up ⇒ Boolean
Same as ScrollPages (-1).
-
#paint {|dc| ... } ⇒ ::Object
Creates an appropriate (temporary) DC to paint on and passes that to the given block.
-
#paint_buffered {|dc| ... } ⇒ ::Object
Similar to #paint but this time creates a buffered paint DC (which will be either a ‘regular’ Wx::PaintDC if the platform natively supports double buffering or a Wx::BufferedPaintDC otherwise) when called from an evt_paint handler and a Wx::ClientDC otherwise.
- #popup_menu(*args) ⇒ Object
-
#post_size_event ⇒ void
Posts a size event to the window.
-
#post_size_event_to_parent ⇒ void
Posts a size event to the parent of this window.
-
#process_window_event(event) ⇒ Boolean
Convenient wrapper for EvtHandler#process_event.
-
#process_window_event_locally(event) ⇒ Boolean
Wrapper for EvtHandler#process_event_locally.
-
#push_event_handler(handler) ⇒ void
Pushes this event handler onto the event stack for the window.
-
#raise_window ⇒ void
(also: #bring_to_front)
Raises the window to the top of the window hierarchy (Z-order).
-
#refresh(eraseBackground = true, rect = nil) ⇒ void
Causes this window, and all of its children recursively, to be repainted.
-
#refresh_rect(rect, eraseBackground = true) ⇒ void
Redraws the contents of the given rectangle: only the area inside it will be repainted.
-
#register_hot_key(hotkeyId, modifiers, virtualKeyCode) ⇒ Boolean
Registers a system wide hotkey.
-
#release_mouse ⇒ void
Releases mouse input captured with #capture_mouse.
-
#remove_child(child) ⇒ void
Removes a child window.
-
#remove_event_handler(handler) ⇒ Boolean
Find the given handler in the windows event handler stack and removes (but does not delete) it from the stack.
-
#reparent(newParent) ⇒ Boolean
Reparents the window, i.e.
-
#screen_to_client(pt) ⇒ Wx::Point
Converts from screen to client window coordinates.
-
#scroll_lines(lines) ⇒ Boolean
Scrolls the window by the given number of lines down (if lines is positive) or up.
-
#scroll_pages(pages) ⇒ Boolean
Scrolls the window by the given number of pages down (if pages is positive) or up.
-
#scroll_window(dx, dy, rect = nil) ⇒ void
Physically scrolls the pixels in the window and move child windows accordingly.
-
#send_size_event(flags = 0) ⇒ void
This function sends a dummy size event to the window allowing it to re-layout its children positions.
-
#send_size_event_to_parent(flags = 0) ⇒ void
Safe wrapper for #get_parent->#send_size_event.
-
#set_accelerator_table(accel) ⇒ void
(also: #accelerator_table=)
Sets the accelerator table for this window.
-
#set_auto_layout(autoLayout) ⇒ void
(also: #auto_layout=)
Determines whether the #layout function will be called automatically when the window is resized.
-
#set_background_colour(colour) ⇒ Boolean
(also: #background_colour=)
Sets the background colour of the window.
-
#set_background_style(style) ⇒ Boolean
(also: #background_style=)
Sets the background style of the window.
-
#set_can_focus(canFocus) ⇒ void
(also: #can_focus=)
This method is only implemented by ports which have support for native TAB traversal (such as GTK+ 2.0).
-
#set_caret(caret) ⇒ void
(also: #caret=)
Sets the caret() associated with the window.
- #set_client_size(*args) ⇒ Object (also: #client_size=)
-
#set_containing_sizer(sizer) ⇒ void
(also: #containing_sizer=)
Used by Sizer internally to notify the window about being managed by the given sizer.
-
#set_cursor(cursor) ⇒ Boolean
(also: #cursor=)
Sets the window’s cursor.
-
#set_double_buffered(on) ⇒ void
(also: #double_buffered=)
Turn on or off double buffering of the window if the system supports it.
-
#set_drop_target(target) ⇒ void
(also: #drop_target=)
Associates a drop target with this window.
-
#set_event_handler(handler) ⇒ void
(also: #event_handler=)
Sets the event handler for this window.
-
#set_extra_style(exStyle) ⇒ void
(also: #extra_style=)
Sets the extra style bits for the window.
-
#set_focus ⇒ void
This sets the window to receive keyboard input.
-
#set_focus_from_kbd ⇒ void
This function is called by wxWidgets keyboard navigation code when the user gives the focus to this window from keyboard (e.g. using TAB key).
-
#set_font(font) ⇒ Boolean
(also: #font=)
Sets the font for this window.
-
#set_foreground_colour(colour) ⇒ Boolean
(also: #foreground_colour=)
Sets the foreground colour of the window.
-
#set_help_text(helpText) ⇒ void
(also: #help_text=)
Sets the help text to be used as context-sensitive help for this window.
-
#set_id(winid) ⇒ void
(also: #id=)
Sets the identifier of the window.
-
#set_initial_size(size = Wx::DEFAULT_SIZE) ⇒ void
(also: #initial_size=)
A smart SetSize that will fill in default size components with the window’s best size values.
-
#set_label(label) ⇒ void
(also: #label=)
Sets the window’s label.
-
#set_layout_direction(dir) ⇒ void
(also: #layout_direction=)
Sets the layout direction for this window.
-
#set_max_client_size(size) ⇒ void
(also: #max_client_size=)
Sets the maximum client size of the window, to indicate to the sizer layout mechanism that this is the maximum possible size of its client area.
-
#set_max_size(size) ⇒ void
(also: #max_size=)
Sets the maximum size of the window, to indicate to the sizer layout mechanism that this is the maximum possible size.
-
#set_min_client_size(size) ⇒ void
(also: #min_client_size=)
Sets the minimum client size of the window, to indicate to the sizer layout mechanism that this is the minimum required size of window’s client area.
-
#set_min_size(size) ⇒ void
(also: #min_size=)
Sets the minimum size of the window, to indicate to the sizer layout mechanism that this is the minimum required size.
-
#set_name(name) ⇒ void
(also: #name=)
Sets the window’s name.
-
#set_next_handler(handler) ⇒ void
(also: #next_handler=)
Windows cannot be used to form event handler chains; this function thus will assert when called.
-
#set_own_background_colour(colour) ⇒ void
(also: #own_background_colour=)
Sets the background colour of the window but prevents it from being inherited by the children of this window.
-
#set_own_font(font) ⇒ void
(also: #own_font=)
Sets the font of the window but prevents it from being inherited by the children of this window.
-
#set_own_foreground_colour(colour) ⇒ void
(also: #own_foreground_colour=)
Sets the foreground colour of the window but prevents it from being inherited by the children of this window.
-
#set_position(pt) ⇒ void
(also: #position=)
Moves the window to the specified position.
-
#set_previous_handler(handler) ⇒ void
(also: #previous_handler=)
Windows cannot be used to form event handler chains; this function thus will assert when called.
-
#set_scroll_pos(orientation, pos, refresh = true) ⇒ void
Sets the position of one of the built-in scrollbars.
-
#set_scrollbar(orientation, position, thumbSize, range, refresh = true) ⇒ void
Sets the scrollbar properties of a built-in scrollbar.
- #set_size(*args) ⇒ Object (also: #size=)
- #set_size_hints(*args) ⇒ Object (also: #size_hints=)
-
#set_sizer(sizer) ⇒ void
(also: #sizer=)
Sets the window to have the given layout sizer.
-
#set_sizer_and_fit(sizer) ⇒ void
(also: #sizer_and_fit=)
Associate the sizer with the window and set the window size and minimal size accordingly.
-
#set_theme_enabled(enable) ⇒ void
(also: #theme_enabled=)
This function tells a window if it should use the system’s “theme” code to draw the windows’ background instead of its own background drawing code.
- #set_tool_tip(*args) ⇒ Object (also: #tool_tip=)
-
#set_transparent(alpha) ⇒ Boolean
(also: #transparent=)
Set the transparency of the window.
-
#set_validator(validator) ⇒ void
(also: #validator=)
Deletes the current validator (if any) and sets the window validator, having called Validator#clone to create a new validator of this type.
- #set_virtual_size(*args) ⇒ Object (also: #virtual_size=)
-
#set_window_style(style) ⇒ void
(also: #window_style=)
See #set_window_style_flag for more info.
-
#set_window_style_flag(style) ⇒ void
(also: #window_style_flag=)
Sets the style of the window.
-
#set_window_variant(variant) ⇒ void
(also: #window_variant=)
Chooses a different variant of the window display to use.
-
#should_inherit_colours ⇒ Boolean
Return true from here to allow the colours of this window to be changed by #inherit_attributes.
-
#show(show = true) ⇒ Boolean
Shows or hides the window.
-
#show_with_effect(effect, timeout = 0) ⇒ Boolean
This function shows a window, like #show, but using a special visual effect if possible.
-
#switch_sizer(new_sizer) ⇒ Wx::Sizer
Switches the current sizer with the given sizer and detaches and returns the ‘old’ sizer.
-
#thaw ⇒ void
Re-enables window updating after a previous call to #freeze.
- #to_dip(*args) ⇒ Object
- #to_phys(*args) ⇒ Object
-
#toggle_window_style(flag) ⇒ Boolean
Turns the given flag on if it’s currently turned off and vice versa.
-
#transfer_data_from_window ⇒ Boolean
Transfers values from child controls to data areas specified by their validators.
-
#transfer_data_to_window ⇒ Boolean
Transfers values to child controls from data areas specified by their validators.
-
#unregister_hot_key(hotkeyId) ⇒ Boolean
Unregisters a system wide hotkey.
-
#unset_tool_tip ⇒ void
Unset any existing tooltip.
-
#update ⇒ void
Calling this method immediately repaints the invalidated area of the window and all of its children recursively (this normally only happens when the flow of control returns to the event loop).
-
#update_window_ui(flags = Wx::UpdateUI::UPDATE_UI_NONE) ⇒ void
This function sends one or more UpdateUIEvent to the window.
-
#use_background_colour ⇒ Boolean
Return true if a background colour has been set for this window.
-
#use_bg_col ⇒ Boolean
Return true if a background colour has been set for this window.
-
#use_foreground_colour ⇒ Boolean
Return true if a foreground colour has been set for this window.
-
#validate ⇒ Boolean
Validates the current values of the child controls using their validators.
-
#warp_pointer(x, y) ⇒ void
Moves the pointer to the given position on the window.
-
#window_to_client_size(size) ⇒ Wx::Size
Converts window size size to corresponding client area size In other words, the returned value is what would #get_client_size return if this window had given window size.
Methods inherited from EvtHandler
add_filter, #add_pending_event, #call_after, clear_filters, #connect, #delete_pending_events, #disconnect, #evt_activate, #evt_activate_app, #evt_aui_pane_activated, #evt_aui_pane_button, #evt_aui_pane_close, #evt_aui_pane_maximize, #evt_aui_pane_restore, #evt_aui_render, #evt_auinotebook_allow_dnd, #evt_auinotebook_begin_drag, #evt_auinotebook_bg_dclick, #evt_auinotebook_button, #evt_auinotebook_drag_done, #evt_auinotebook_drag_motion, #evt_auinotebook_end_drag, #evt_auinotebook_page_changed, #evt_auinotebook_page_changing, #evt_auinotebook_page_close, #evt_auinotebook_page_closed, #evt_auinotebook_tab_middle_down, #evt_auinotebook_tab_middle_up, #evt_auinotebook_tab_right_down, #evt_auinotebook_tab_right_up, #evt_auitoolbar_begin_drag, #evt_auitoolbar_middle_click, #evt_auitoolbar_overflow_click, #evt_auitoolbar_right_click, #evt_auitoolbar_tool_dropdown, #evt_button, #evt_calculate_layout, #evt_calendar, #evt_calendar_page_changed, #evt_calendar_sel_changed, #evt_calendar_week_clicked, #evt_calendar_weekday_clicked, #evt_char, #evt_char_hook, #evt_checkbox, #evt_checklistbox, #evt_child_focus, #evt_choice, #evt_choicebook_page_changed, #evt_choicebook_page_changing, #evt_close, #evt_collapsiblepane_changed, #evt_colourpicker_changed, #evt_colourpicker_current_changed, #evt_colourpicker_dialog_cancelled, #evt_combobox, #evt_combobox_closeup, #evt_combobox_dropdown, #evt_command, #evt_command_enter, #evt_command_kill_focus, #evt_command_left_click, #evt_command_left_dclick, #evt_command_range, #evt_command_right_click, #evt_command_scroll, #evt_command_scroll_bottom, #evt_command_scroll_changed, #evt_command_scroll_linedown, #evt_command_scroll_lineup, #evt_command_scroll_pagedown, #evt_command_scroll_pageup, #evt_command_scroll_thumbrelease, #evt_command_scroll_thumbtrack, #evt_command_scroll_top, #evt_command_set_focus, #evt_context_menu, #evt_date_changed, #evt_dialup_connected, #evt_dialup_disconnected, #evt_dirctrl_fileactivated, #evt_dirctrl_selectionchanged, #evt_dirpicker_changed, #evt_display_changed, #evt_dpi_changed, #evt_drop_files, #evt_end_session, #evt_enter_window, #evt_erase_background, #evt_filectrl_fileactivated, #evt_filectrl_filterchanged, #evt_filectrl_folderchanged, #evt_filectrl_selectionchanged, #evt_filepicker_changed, #evt_find, #evt_find_close, #evt_find_next, #evt_find_replace, #evt_find_replace_all, #evt_fontpicker_changed, #evt_fullscreen, #evt_gesture_pan, #evt_gesture_rotate, #evt_gesture_zoom, #evt_grid_cell_changed, #evt_grid_cell_changing, #evt_grid_cell_left_click, #evt_grid_cell_left_dclick, #evt_grid_cell_right_click, #evt_grid_cell_right_dclick, #evt_grid_cmd_col_size, #evt_grid_cmd_editor_created, #evt_grid_cmd_range_selected, #evt_grid_cmd_range_selecting, #evt_grid_cmd_row_size, #evt_grid_col_auto_size, #evt_grid_col_move, #evt_grid_col_size, #evt_grid_col_sort, #evt_grid_editor_created, #evt_grid_editor_hidden, #evt_grid_editor_shown, #evt_grid_label_left_click, #evt_grid_label_left_dclick, #evt_grid_label_right_click, #evt_grid_label_right_dclick, #evt_grid_range_selected, #evt_grid_range_selecting, #evt_grid_row_auto_size, #evt_grid_row_move, #evt_grid_row_size, #evt_grid_select_cell, #evt_grid_tabbing, #evt_header_begin_reorder, #evt_header_begin_resize, #evt_header_click, #evt_header_dclick, #evt_header_dragging_cancelled, #evt_header_end_reorder, #evt_header_end_resize, #evt_header_middle_click, #evt_header_middle_dclick, #evt_header_resizing, #evt_header_right_click, #evt_header_right_dclick, #evt_header_separator_dclick, #evt_help, #evt_help_range, #evt_hibernate, #evt_hotkey, #evt_html_cell_clicked, #evt_html_cell_hover, #evt_html_link_clicked, #evt_hyperlink, #evt_iconize, #evt_idle, #evt_init_dialog, #evt_joy_button_down, #evt_joy_button_up, #evt_joy_move, #evt_joy_zmove, #evt_joystick_events, #evt_key_down, #evt_key_up, #evt_kill_focus, #evt_leave_window, #evt_left_dclick, #evt_left_down, #evt_left_up, #evt_list_begin_drag, #evt_list_begin_label_edit, #evt_list_begin_rdrag, #evt_list_cache_hint, #evt_list_col_begin_drag, #evt_list_col_click, #evt_list_col_dragging, #evt_list_col_end_drag, #evt_list_col_right_click, #evt_list_delete_all_items, #evt_list_delete_item, #evt_list_end_label_edit, #evt_list_insert_item, #evt_list_item_activated, #evt_list_item_checked, #evt_list_item_deselected, #evt_list_item_focused, #evt_list_item_middle_click, #evt_list_item_right_click, #evt_list_item_selected, #evt_list_item_unchecked, #evt_list_key_down, #evt_listbook_page_changed, #evt_listbook_page_changing, #evt_listbox, #evt_listbox_dclick, #evt_long_press, #evt_magnify, #evt_maximize, #evt_media_finished, #evt_media_loaded, #evt_media_pause, #evt_media_play, #evt_media_statechanged, #evt_media_stop, #evt_menu, #evt_menu_close, #evt_menu_highlight, #evt_menu_highlight_all, #evt_menu_open, #evt_menu_range, #evt_middle_dclick, #evt_middle_down, #evt_middle_up, #evt_motion, #evt_mouse_aux1_dclick, #evt_mouse_aux1_down, #evt_mouse_aux1_up, #evt_mouse_aux2_dclick, #evt_mouse_aux2_down, #evt_mouse_aux2_up, #evt_mouse_capture_changed, #evt_mouse_capture_lost, #evt_mouse_events, #evt_mousewheel, #evt_move, #evt_move_end, #evt_move_start, #evt_moving, #evt_navigation_key, #evt_notebook_page_changed, #evt_notebook_page_changing, #evt_paint, #evt_pg_changed, #evt_pg_changing, #evt_pg_col_begin_drag, #evt_pg_col_dragging, #evt_pg_col_end_drag, #evt_pg_double_click, #evt_pg_highlighted, #evt_pg_item_collapsed, #evt_pg_item_expanded, #evt_pg_label_edit_begin, #evt_pg_label_edit_ending, #evt_pg_page_changed, #evt_pg_right_click, #evt_pg_selected, #evt_press_and_tap, #evt_query_end_session, #evt_query_layout_info, #evt_radiobox, #evt_radiobutton, #evt_ribbonbar_help_click, #evt_ribbonbar_page_changed, #evt_ribbonbar_page_changing, #evt_ribbonbar_tab_left_dclick, #evt_ribbonbar_tab_middle_down, #evt_ribbonbar_tab_middle_up, #evt_ribbonbar_tab_right_down, #evt_ribbonbar_tab_right_up, #evt_ribbonbar_toggled, #evt_ribbonbuttonbar_clicked, #evt_ribbonbuttonbar_dropdown_clicked, #evt_ribbongallery_clicked, #evt_ribbongallery_hover_changed, #evt_ribbongallery_selected, #evt_ribbonpanel_extbutton_activated, #evt_ribbontoolbar_clicked, #evt_ribbontoolbar_dropdown_clicked, #evt_richtext_buffer_reset, #evt_richtext_character, #evt_richtext_consuming_character, #evt_richtext_content_deleted, #evt_richtext_content_inserted, #evt_richtext_delete, #evt_richtext_focus_object_changed, #evt_richtext_left_click, #evt_richtext_left_dclick, #evt_richtext_middle_click, #evt_richtext_properties_changed, #evt_richtext_return, #evt_richtext_right_click, #evt_richtext_selection_changed, #evt_richtext_style_changed, #evt_richtext_stylesheet_changed, #evt_richtext_stylesheet_replaced, #evt_richtext_stylesheet_replacing, #evt_right_dclick, #evt_right_down, #evt_right_up, #evt_sash_dragged, #evt_sash_dragged_range, #evt_scroll, #evt_scroll_bottom, #evt_scroll_changed, #evt_scroll_command, #evt_scroll_linedown, #evt_scroll_lineup, #evt_scroll_pagedown, #evt_scroll_pageup, #evt_scroll_thumbrelease, #evt_scroll_thumbtrack, #evt_scroll_top, #evt_scrollbar, #evt_scrollwin, #evt_scrollwin_bottom, #evt_scrollwin_linedown, #evt_scrollwin_lineup, #evt_scrollwin_pagedown, #evt_scrollwin_pageup, #evt_scrollwin_thumbrelease, #evt_scrollwin_thumbtrack, #evt_scrollwin_top, #evt_search, #evt_search_cancel, #evt_set_cursor, #evt_set_focus, #evt_show, #evt_size, #evt_slider, #evt_spin, #evt_spin_down, #evt_spin_up, #evt_spinctrl, #evt_spinctrldouble, #evt_splitter_dclick, #evt_splitter_sash_pos_changed, #evt_splitter_sash_pos_changing, #evt_splitter_sash_pos_resize, #evt_splitter_unsplit, #evt_stc_autocomp_cancelled, #evt_stc_autocomp_char_deleted, #evt_stc_autocomp_completed, #evt_stc_autocomp_selection, #evt_stc_autocomp_selection_change, #evt_stc_calltip_click, #evt_stc_change, #evt_stc_charadded, #evt_stc_clipboard_copy, #evt_stc_clipboard_paste, #evt_stc_do_drop, #evt_stc_doubleclick, #evt_stc_drag_over, #evt_stc_dwellend, #evt_stc_dwellstart, #evt_stc_hotspot_click, #evt_stc_hotspot_dclick, #evt_stc_hotspot_release_click, #evt_stc_indicator_click, #evt_stc_indicator_release, #evt_stc_macrorecord, #evt_stc_margin_right_click, #evt_stc_marginclick, #evt_stc_modified, #evt_stc_needshown, #evt_stc_painted, #evt_stc_romodifyattempt, #evt_stc_savepointleft, #evt_stc_savepointreached, #evt_stc_start_drag, #evt_stc_styleneeded, #evt_stc_updateui, #evt_stc_userlistselection, #evt_stc_zoom, #evt_sys_colour_changed, #evt_taskbar_click, #evt_taskbar_left_dclick, #evt_taskbar_left_down, #evt_taskbar_left_up, #evt_taskbar_move, #evt_taskbar_right_dclick, #evt_taskbar_right_down, #evt_taskbar_right_up, #evt_text, #evt_text_copy, #evt_text_cut, #evt_text_enter, #evt_text_maxlen, #evt_text_paste, #evt_text_url, #evt_time_changed, #evt_timer, #evt_togglebutton, #evt_tool, #evt_tool_dropdown, #evt_tool_enter, #evt_tool_range, #evt_tool_rclicked, #evt_tool_rclicked_range, #evt_toolbook_page_changed, #evt_toolbook_page_changing, #evt_tree_begin_drag, #evt_tree_begin_label_edit, #evt_tree_begin_rdrag, #evt_tree_delete_item, #evt_tree_end_drag, #evt_tree_end_label_edit, #evt_tree_get_info, #evt_tree_item_activated, #evt_tree_item_collapsed, #evt_tree_item_collapsing, #evt_tree_item_expanded, #evt_tree_item_expanding, #evt_tree_item_gettooltip, #evt_tree_item_menu, #evt_tree_item_middle_click, #evt_tree_item_right_click, #evt_tree_key_down, #evt_tree_sel_changed, #evt_tree_sel_changing, #evt_tree_set_info, #evt_tree_state_image_click, #evt_treebook_node_collapsed, #evt_treebook_node_expanded, #evt_treebook_page_changed, #evt_treebook_page_changing, #evt_two_finger_tap, #evt_update_ui, #evt_update_ui_range, #evt_window_create, #evt_window_destroy, #evt_wizard_before_page_changed, #evt_wizard_cancel, #evt_wizard_finished, #evt_wizard_help, #evt_wizard_page_changed, #evt_wizard_page_changing, #evt_wizard_page_shown, #get_client_object, #get_evt_handler_enabled, #get_next_handler, #get_previous_handler, #is_unlinked, #process_event, #process_event_locally, #process_pending_events, #queue_event, register_class, remove_filter, #safely_process_event, #set_client_object, #set_evt_handler_enabled, #try_after, #try_before, #unlink
Methods inherited from Object
#clone, #dup, #is_same_as, #un_share
Constructor Details
#initialize ⇒ Wx::Window #initialize(parent, id, pos = Wx::DEFAULT_POSITION, size = Wx::DEFAULT_SIZE, style = 0, name = Wx::PANEL_NAME_STR) ⇒ Wx::Window
Returns a new instance of Window.
2756 |
# File 'lib/wx/doc/gen/window.rb', line 2756 def initialize(*args) end |
Class Method Details
.find_focus ⇒ Wx::Window
Finds the window or control which currently has the keyboard focus.
Note that this is a static function, so it can be called without needing a Wx::Window pointer.
2673 |
# File 'lib/wx/doc/gen/window.rb', line 2673 def self.find_focus; end |
.find_window_by_id(id, parent = 0) ⇒ Wx::Window
Find the first window with the given id.
If parent is NULL, the search will start from all top-level frames and dialog boxes; if non-NULL, the search will be limited to the given window hierarchy. The search is recursive in both cases.
Window with the given id or NULL if not found.
2684 |
# File 'lib/wx/doc/gen/window.rb', line 2684 def self.find_window_by_id(id, parent=0) end |
.find_window_by_label(label, parent = 0) ⇒ Wx::Window
Find a window by its label.
Depending on the type of window, the label may be a window title or panel item label. If parent is NULL, the search will start from all top-level frames and dialog boxes; if non-NULL, the search will be limited to the given window hierarchy. The search is recursive in both cases and, unlike with find_window, recurses into top level child windows too.
Window with the given label or NULL if not found.
2696 |
# File 'lib/wx/doc/gen/window.rb', line 2696 def self.find_window_by_label(label, parent=0) end |
.find_window_by_name(name, parent = 0) ⇒ Wx::Window
Find a window by its name (as given in a window constructor or #create function call).
If parent is NULL, the search will start from all top-level frames and dialog boxes; if non-NULL, the search will be limited to the given window hierarchy. The search is recursive in both cases and, unlike find_window, recurses into top level child windows too. If no window with such name is found, find_window_by_label is called, i.e. the name is interpreted as (internal) name first but if this fails, it’s internal as (user-visible) label. As this behaviour may be confusing, it is usually better to use either the find_window overload taking the name or find_window_by_label directly. Window with the given name or NULL if not found.
2707 |
# File 'lib/wx/doc/gen/window.rb', line 2707 def self.find_window_by_name(name, parent=0) end |
.self.from_dip(sz, w) ⇒ Wx::Size .self.from_dip(pt, w) ⇒ Wx::Point .self.from_dip(d, w) ⇒ Integer
676 |
# File 'lib/wx/doc/gen/window.rb', line 676 def self.from_dip(*args) end |
.self.from_phys(sz, w) ⇒ Wx::Size .self.from_phys(pt, w) ⇒ Wx::Point .self.from_phys(d, w) ⇒ Integer
761 |
# File 'lib/wx/doc/gen/window.rb', line 761 def self.from_phys(*args) end |
.get_capture ⇒ Wx::Window
Returns the currently captured window.
2718 |
# File 'lib/wx/doc/gen/window.rb', line 2718 def self.get_capture; end |
.get_class_default_attributes(variant = Wx::WindowVariant::WINDOW_VARIANT_NORMAL) ⇒ Wx::VisualAttributes
Returns the default font and colours which are used by the control.
This is useful if you want to use the same font or colour in your own control as in a standard control which is a much better idea than hard coding specific colours or fonts which might look completely out of place on the users system, especially if it uses themes. The variant parameter is only relevant under Mac currently and is ignore under other platforms. Under Mac, it will change the size of the returned font. See #set_window_variant for more about this. This static method is “overridden” in many derived classes and so calling, for example, Button#get_class_default_attributes will typically return the values appropriate for a button which will be normally different from those returned by, say, ListCtrl#get_class_default_attributes. The VisualAttributes structure has at least the fields font, colFg and colBg. All of them may be invalid if it was not possible to determine the default control appearance or, especially for the background colour, if the field doesn’t make sense as is the case for colBg for the controls with themed background.
2661 |
# File 'lib/wx/doc/gen/window.rb', line 2661 def self.get_class_default_attributes(variant=Wx::WindowVariant::WINDOW_VARIANT_NORMAL) end |
.new_control_id(count = 1) ⇒ Integer
Create a new ID or range of IDs that are not currently in use.
The IDs will be reserved until assigned to a Wx::Window ID or unreserved with unreserve_control_id. See Window IDs for more information.
Returns the ID or the first ID of the range (i.e. the most negative), or StandardID::ID_NONE if the specified number of identifiers couldn’t be allocated.
2731 |
# File 'lib/wx/doc/gen/window.rb', line 2731 def self.new_control_id(count=1) end |
.self.to_dip(sz, w) ⇒ Wx::Size .self.to_dip(pt, w) ⇒ Wx::Point .self.to_dip(d, w) ⇒ Integer
721 |
# File 'lib/wx/doc/gen/window.rb', line 721 def self.to_dip(*args) end |
.self.to_phys(sz, w) ⇒ Wx::Size .self.to_phys(pt, w) ⇒ Wx::Point .self.to_phys(d, w) ⇒ Integer
797 |
# File 'lib/wx/doc/gen/window.rb', line 797 def self.to_phys(*args) end |
.unreserve_control_id(id, count = 1) ⇒ void
This method returns an undefined value.
Unreserve an ID or range of IDs that was reserved by new_control_id.
See Window IDs for more information.
2742 |
# File 'lib/wx/doc/gen/window.rb', line 2742 def self.unreserve_control_id(id, count=1) end |
Instance Method Details
#accepts_focus ⇒ Boolean
This method may be overridden in the derived classes to return false to indicate that this control doesn’t accept input at all (i.e. behaves like e.g. StaticText) and so doesn’t need focus.
273 |
# File 'lib/wx/doc/gen/window.rb', line 273 def accepts_focus; end |
#accepts_focus_from_keyboard ⇒ Boolean
This method may be overridden in the derived classes to return false to indicate that while this control can, in principle, have focus if the user clicks it with the mouse, it shouldn’t be included in the TAB traversal chain when using the keyboard.
277 |
# File 'lib/wx/doc/gen/window.rb', line 277 def accepts_focus_from_keyboard; end |
#accepts_focus_recursively ⇒ Boolean
Overridden to indicate whether this window or one of its children accepts focus.
Usually it’s the same as #accepts_focus but is overridden for container windows.
283 |
# File 'lib/wx/doc/gen/window.rb', line 283 def accepts_focus_recursively; end |
#add_child(child) ⇒ void
This method returns an undefined value.
Adds a child window.
This is called automatically by window creation functions so should not be required by the application programmer. Notice that this function is mostly internal to wxWidgets and shouldn’t be called by the user code.
356 |
# File 'lib/wx/doc/gen/window.rb', line 356 def add_child(child) end |
#adjust_for_layout_direction(x, width, widthTotal) ⇒ Integer
Mirror coordinates for RTL layout if this window uses it and if the mirroring is not done automatically like Win32.
2192 |
# File 'lib/wx/doc/gen/window.rb', line 2192 def adjust_for_layout_direction(x, width, widthTotal) end |
#always_show_scrollbars(hflag = true, vflag = true) ⇒ void
This method returns an undefined value.
Call this function to force one or both scrollbars to be always shown, even if the window is big enough to show its entire contents without scrolling.
This function is currently not implemented.
431 |
# File 'lib/wx/doc/gen/window.rb', line 431 def (hflag=true, vflag=true) end |
#begin_repositioning_children ⇒ Boolean
Prepare for changing positions of multiple child windows.
This method should be called before changing positions of multiple child windows to reduce flicker and, in MSW case, even avoid display corruption in some cases. It is used internally by wxWidgets and called automatically when the window size changes but it can also be useful to call it from outside of the library if a repositioning involving multiple children is done without changing the window size. If this method returns true, then #end_repositioning_children must be called after setting all children positions. Use ChildrenRepositioningGuard class to ensure that this requirement is satisfied.
586 |
# File 'lib/wx/doc/gen/window.rb', line 586 def begin_repositioning_children; end |
#cache_best_size(size) ⇒ void
This method returns an undefined value.
Sets the cached best size value.
600 |
# File 'lib/wx/doc/gen/window.rb', line 600 def cache_best_size(size) end |
#can_accept_focus ⇒ Boolean Also known as: can_accept_focus?
Can this window have focus right now?
If this method returns true, it means that calling #set_focus will put focus either to this window or one of its children, if you need to know whether this window accepts focus itself, use #is_focusable
300 |
# File 'lib/wx/doc/gen/window.rb', line 300 def can_accept_focus; end |
#can_accept_focus_from_keyboard ⇒ Boolean Also known as: can_accept_focus_from_keyboard?
Can this window be assigned focus from keyboard right now?
305 |
# File 'lib/wx/doc/gen/window.rb', line 305 def can_accept_focus_from_keyboard; end |
#can_scroll(orient) ⇒ Boolean Also known as: can_scroll?
Returns true if this window can have a scroll bar in this orientation.
463 |
# File 'lib/wx/doc/gen/window.rb', line 463 def can_scroll(orient) end |
#can_set_transparent ⇒ Boolean Also known as: can_set_transparent?
Returns true if the system supports transparent windows and calling #set_transparent may succeed.
If this function returns false, transparent windows are definitely not supported by the current system.
1681 |
# File 'lib/wx/doc/gen/window.rb', line 1681 def can_set_transparent; end |
#capture_mouse ⇒ void
This method returns an undefined value.
Directs all mouse input to this window.
Call #release_mouse to release the capture. Note that wxWidgets maintains the stack of windows having captured the mouse and when the mouse is released the capture returns to the window which had had captured it previously and it is only really released if there were no previous window. In particular, this means that you must release the mouse as many times as you capture it, unless the window receives the MouseCaptureLostEvent event. Any application which captures the mouse in the beginning of some operation must handle MouseCaptureLostEvent and cancel this operation when it receives the event. The event handler must not recapture mouse.
2407 |
# File 'lib/wx/doc/gen/window.rb', line 2407 def capture_mouse; end |
#center(dir = Wx::Orientation::BOTH) ⇒ void
This method returns an undefined value.
A synonym for #centre.
1178 |
# File 'lib/wx/doc/gen/window.rb', line 1178 def center(dir=Wx::Orientation::BOTH) end |
#center_on_parent(dir = Wx::Orientation::BOTH) ⇒ void
This method returns an undefined value.
A synonym for #centre_on_parent.
1183 |
# File 'lib/wx/doc/gen/window.rb', line 1183 def center_on_parent(dir=Wx::Orientation::BOTH) end |
#centre(direction = Wx::Orientation::BOTH) ⇒ void
This method returns an undefined value.
Centres the window.
If the window is a top level one (i.e. doesn't have a parent), it will be centred relative to the screen anyhow.
1195 |
# File 'lib/wx/doc/gen/window.rb', line 1195 def centre(direction=Wx::Orientation::BOTH) end |
#centre_on_parent(direction = Wx::Orientation::BOTH) ⇒ void
This method returns an undefined value.
Centres the window on its parent.
This is a more readable synonym for #centre.
This methods provides for a way to centre top level windows over their parents instead of the entire screen. If there is no parent or if the window is not a top level window, then behaviour is the same as #centre.
1209 |
# File 'lib/wx/doc/gen/window.rb', line 1209 def centre_on_parent(direction=Wx::Orientation::BOTH) end |
#clear_background ⇒ void
This method returns an undefined value.
Clears the window by filling it with the current background colour.
Does not cause an erase background event to be generated. Notice that this uses ClientDC to draw on the window and the results of doing it while also drawing on PaintDC for this window are undefined. Hence this method shouldn’t be used from EVT_PAINT handlers, just use DC#clear on the PaintDC you already use there instead.
1349 |
# File 'lib/wx/doc/gen/window.rb', line 1349 def clear_background; end |
#client_to_screen(pt) ⇒ Wx::Point
Converts to screen coordinates from coordinates relative to this window.
1299 |
# File 'lib/wx/doc/gen/window.rb', line 1299 def client_to_screen(pt) end |
#client_to_window_size(size) ⇒ Wx::Size
Converts client area size size to corresponding window size.
In other words, the returned value is what would #get_size return if this window had client area of given size. Components with DEFAULT_COORD value are left unchanged. Note that the conversion is not always exact, it assumes that non-client area doesn’t change and so doesn’t take into account things like menu bar (un)wrapping or (dis)appearance of the scrollbars.
608 |
# File 'lib/wx/doc/gen/window.rb', line 608 def client_to_window_size(size) end |
#close(force = false) ⇒ Boolean
This function simply generates a CloseEvent whose handler usually tries to close the window.
It doesn’t close the window itself, however.
true if the event was handled and not vetoed, false otherwise.
Close calls the close handler for the window, providing an opportunity for the window to choose whether to destroy the window. Usually it is only used with the top level windows (Frame and Dialog classes) as the others are not supposed to have any special OnClose() logic. The close handler should check whether the window is being deleted forcibly, using CloseEvent#can_veto, in which case it should destroy the window using #destroy. Note that calling Close does not guarantee that the window will be destroyed; but it provides a way to simulate a manual close of a window, which may or may not be implemented by destroying the window. The default implementation of Dialog::OnCloseWindow does not necessarily delete the dialog, since it will simply simulate a StandardID::ID_CANCEL event which is handled by the appropriate button event handler and may do anything at all. To guarantee that the window will be destroyed, call #destroy instead
2291 |
# File 'lib/wx/doc/gen/window.rb', line 2291 def close(force=false) end |
#convert_dialog_to_pixels(pt) ⇒ Wx::Point #convert_dialog_to_pixels(sz) ⇒ Wx::Size
1318 |
# File 'lib/wx/doc/gen/window.rb', line 1318 def convert_dialog_to_pixels(*args) end |
#convert_pixels_to_dialog(pt) ⇒ Wx::Point #convert_pixels_to_dialog(sz) ⇒ Wx::Size
1337 |
# File 'lib/wx/doc/gen/window.rb', line 1337 def convert_pixels_to_dialog(*args) end |
#create(parent, id, pos = Wx::DEFAULT_POSITION, size = Wx::DEFAULT_SIZE, style = 0, name = Wx::PANEL_NAME_STR) ⇒ Boolean
Construct the actual window object after creating the C++ object.
The non-default constructor of Wx::Window class does two things: it initializes the C++ object and it also creates the window object in the underlying graphical toolkit. The #create method can be used to perform the second part later, while the default constructor can be used to perform the first part only. Please note that the underlying window must be created exactly once, i.e. if you use the default constructor, which doesn’t do this, you must call #create before using the window and if you use the non-default constructor, you can not call #create, as the underlying window is already created. Note that it is possible and, in fact, useful, to call some methods on the object between creating the C++ object itself and calling #create on it, e.g. a common pattern to avoid showing the contents of a window before it is fully initialized is:
panel = Wx::Panel.new # Note: default constructor used.
panel.hide # Can be called before actually creating it.
panel.create(parent, Wx::ID_ANY, ...) # Won't be shown yet.
... create all the panel children ...
panel.show # Now everything will be shown at once.
Also note that it is possible to create an object of a derived type and then call #create on it:
# Suppose we have this function (which would typically be in a
# different file from the rest of the code).
def my_create_window_object_function
MyCustomClassDerivingFromWindow.new
end
# Then we can create a window of MyCustomClassDerivingFromWindow
# class without really knowing about this type, as we would have
# to do if we wanted to use the non-default constructor, like this:
# First create the C++ object using the factory function.
window = my_create_window_object_function
# And now create the underlying window.
#
# This should call the base Wx::Window#create.
# In C++ (wxWidgets) this method is not virtual and cannot be overloaded
# so the derived class can't customize this part.
# In wxRuby however this method can be overloaded as long as the following
# is kept in mind:
# 1. the overloaded version will **NOT** be called when using a non-default
# constructor (Create will than be called from C++ which will always be
# the base Wx::Window version);
# 2. when calling the overloaded version from Ruby understand that the window
# will not actually be created until after the `super` version has been called.
# In general it's best not to overload this method but to define a different method
# if a custom initializer is needed.
window.create(parent, Wx::ID_ANY, ...)
This is notably used by XML Based Resource System (XRC). The parameters of this method have exactly the same meaning as the non-default constructor parameters, please refer to them for their description. true if window creation succeeded or false if it failed
2812 |
# File 'lib/wx/doc/gen/window.rb', line 2812 def create(parent, id, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=0, name=Wx::PANEL_NAME_STR) end |
#destroy ⇒ Boolean
Destroys the window safely.
Use this function instead of the delete operator, since different window classes can be destroyed differently. Frames and dialogs are not destroyed immediately when this function is called they are added to a list of windows to be deleted on idle time, when all the window’s events have been processed. This prevents problems with events being sent to non-existent windows. true if the window has either been successfully deleted, or it has been added to the list of windows pending real deletion.
2298 |
# File 'lib/wx/doc/gen/window.rb', line 2298 def destroy; end |
#destroy_children ⇒ Boolean
Destroys all children of a window.
Called automatically by the destructor.
362 |
# File 'lib/wx/doc/gen/window.rb', line 362 def destroy_children; end |
#disable ⇒ Boolean
Disables the window.
Same as #enable Enable(false). Returns true if the window has been disabled, false if it had been already disabled before the call to this function.
1962 |
# File 'lib/wx/doc/gen/window.rb', line 1962 def disable; end |
#disable_focus_from_keyboard ⇒ void
This method returns an undefined value.
Disable giving focus to this window using the keyboard navigation keys.
Pressing TAB key will skip this window if this function was called on it, but it will still be possible to focus it by clicking on it with a pointing device.
289 |
# File 'lib/wx/doc/gen/window.rb', line 289 def disable_focus_from_keyboard; end |
#do_update_window_ui(event) ⇒ void
This method returns an undefined value.
Does the window-specific updating after processing the update event.
This function is called by #update_window_ui in order to check return values in the UpdateUIEvent and act appropriately. For example, to allow frame and dialog title updating, wxWidgets implements this function as follows:
# do the window-specific processing after processing the update event
def Wx::TopLevelWindow.do_update_window_ui(event)
if event.get_set_enabled
enable(event.get_enabled)
end
if event.get_set_text
if event.get_text != get_title
set_title(event.get_text)
end
end
end
2530 |
# File 'lib/wx/doc/gen/window.rb', line 2530 def do_update_window_ui(event) end |
#drag_accept_files(accept) ⇒ void
This method returns an undefined value.
Enables or disables eligibility for drop file events (OnDropFiles).
Windows only until version 2.8.9, available on all platforms since 2.8.10. Cannot be used together with #set_drop_target on non-Windows platforms.
2337 |
# File 'lib/wx/doc/gen/window.rb', line 2337 def drag_accept_files(accept) end |
#each_child {|child| ... } ⇒ Object, Enumerator
Yield each child window to the given block. Returns an Enumerator if no block given.
61 |
# File 'lib/wx/doc/window.rb', line 61 def each_child; end |
#enable(enable = true) ⇒ Boolean
Enable or disable the window for user input.
Note that when a parent window is disabled, all of its children are disabled as well and they are re-enabled again when the parent is. A window can be created initially disabled by calling this method on it before calling #create to create the actual underlying window, e.g.
w = MyWindow.new # Note: default ctor is used here.
w.enable(false)
w.create(parent, ... all the usual non-default ctor arguments ...)
Returns true if the window has been enabled or disabled, false if nothing was done, i.e. if the window had already been in the specified state.
1980 |
# File 'lib/wx/doc/gen/window.rb', line 1980 def enable(enable=true) end |
#enable_touch_events(eventsMask) ⇒ Boolean
Request generation of touch events for this window.
Each call to this function supersedes the previous ones, i.e. if you want to receive events for both zoom and rotate gestures, you need to call
enable_touch_events(Wx::TOUCH_ZOOM_GESTURE | Wx::TOUCH_ROTATE_GESTURE)
instead of calling it twice in a row as the second call would disable the first gesture.
true if the specified events were enabled or false if the current platform doesn’t support touch events.
2484 |
# File 'lib/wx/doc/gen/window.rb', line 2484 def enable_touch_events(eventsMask) end |
#enable_visible_focus(enable) ⇒ void
This method returns an undefined value.
Enables or disables visible indication of keyboard focus.
By default, controls behave in platform-appropriate way and show focus in the same way native applications do. In some very rare circumstances it may be desirable to change the default (notably multiline text controls don’t normally have a focus indicator on Mac), which this method allows. It should only be used if you have a good understanding of the native platform’s guidelines and user expectations. This method is only implemented on Mac.
333 |
# File 'lib/wx/doc/gen/window.rb', line 333 def enable_visible_focus(enable) end |
#end_repositioning_children ⇒ void
This method returns an undefined value.
Fix child window positions after setting all of them at once.
This method must be called if and only if the previous call to #begin_repositioning_children returned true.
592 |
# File 'lib/wx/doc/gen/window.rb', line 592 def end_repositioning_children; end |
#find_window_by_id(id) ⇒ Wx::Window
Find the first child window with the given id recursively in the window hierarchy of this window.
Window with the given id or nil if not found.
73 |
# File 'lib/wx/doc/window.rb', line 73 def find_window_by_id(id) end |
#find_window_by_label(label) ⇒ Wx::Window
Find the first child window with the given label recursively in the window hierarchy of this window.
Window with the given label or nil if not found.
81 |
# File 'lib/wx/doc/window.rb', line 81 def find_window_by_label(label) end |
#find_window_by_name(name) ⇒ Wx::Window
Find the first child window with the given name (as given in a window constructor or #create function call) recursively in the window hierarchy of this window.
Window with the given name or nil if not found.
88 |
# File 'lib/wx/doc/window.rb', line 88 def find_window_by_name(name) end |
#fit ⇒ void
This method returns an undefined value.
Sizes the window to fit its best size.
Using this function is equivalent to setting window size to the return value of #get_best_size. Note that, unlike #set_sizer_and_fit, this function only changes the current window size and doesn’t change its minimal size.
625 |
# File 'lib/wx/doc/gen/window.rb', line 625 def fit; end |
#fit_inside ⇒ void
This method returns an undefined value.
Similar to #fit, but sizes the interior (virtual) size of a window.
Mainly useful with scrolled windows to reset scrollbars after sizing changes that do not trigger a size event, and/or scrolled windows without an interior sizer. This function similarly won’t do anything if there are no subwindows.
631 |
# File 'lib/wx/doc/gen/window.rb', line 631 def fit_inside; end |
#freeze ⇒ void
This method returns an undefined value.
Freezes the window or, in other words, prevents any updates from taking place on screen, the window is not redrawn at all.
#thaw must be called to re-enable window redrawing. Calls to these two functions may be nested but to ensure that the window is properly repainted again, you must thaw it exactly as many times as you froze it. If the window has any children, they are recursively frozen too. This method is useful for visual appearance optimization (for example, it is a good idea to use it before doing many large text insertions in a row into a TextCtrl under WXGTK) but is not implemented on all platforms nor for all controls so it is mostly just a hint to wxWidgets and not a mandatory directive.
1360 |
# File 'lib/wx/doc/gen/window.rb', line 1360 def freeze; end |
#from_dip(sz) ⇒ Wx::Size #from_dip(pt) ⇒ Wx::Point #from_dip(d) ⇒ Integer
656 |
# File 'lib/wx/doc/gen/window.rb', line 656 def from_dip(*args) end |
#from_phys(sz) ⇒ Wx::Size #from_phys(pt) ⇒ Wx::Point #from_phys(d) ⇒ Integer
741 |
# File 'lib/wx/doc/gen/window.rb', line 741 def from_phys(*args) end |
#get_accelerator_table ⇒ Wx::AcceleratorTable Also known as: accelerator_table
Gets the accelerator table for this window.
See AcceleratorTable.
2264 |
# File 'lib/wx/doc/gen/window.rb', line 2264 def get_accelerator_table; end |
#get_auto_layout ⇒ Boolean Also known as: auto_layout
Returns true if #layout is called automatically when the window is resized.
This function is mostly useful for wxWidgets itself and is rarely needed in the application code.
2396 |
# File 'lib/wx/doc/gen/window.rb', line 2396 def get_auto_layout; end |
#get_background_colour ⇒ Wx::Colour Also known as: background_colour
Returns the background colour of the window.
1388 |
# File 'lib/wx/doc/gen/window.rb', line 1388 def get_background_colour; end |
#get_background_style ⇒ Wx::BackgroundStyle Also known as: background_style
Returns the background style of the window.
1399 |
# File 'lib/wx/doc/gen/window.rb', line 1399 def get_background_style; end |
#get_best_height(width) ⇒ Integer Also known as: best_height
Returns the best height needed by this window if it had the given width.
816 |
# File 'lib/wx/doc/gen/window.rb', line 816 def get_best_height(width) end |
#get_best_size ⇒ Wx::Size Also known as: best_size
This functions returns the best acceptable minimal size for the window.
For example, for a static control, it will be the minimal size such that the control label is not truncated. For windows containing subwindows (typically Panel), the size returned by this function will be the same as the size the window would have had after calling #fit. Override virtual do_get_best_size or, better, because it’s usually more convenient, do_get_best_client_size when writing your own custom window class to change the value returned by this public non-virtual method. Notice that the best size respects the minimal and maximal size explicitly set for the window, if any. So even if some window believes that it needs 200 pixels horizontally, calling #set_max_size with a width of 100 would ensure that #get_best_size returns the width of at most 100 pixels.
807 |
# File 'lib/wx/doc/gen/window.rb', line 807 def get_best_size; end |
#get_best_virtual_size ⇒ Wx::Size Also known as: best_virtual_size
Return the largest of ClientSize and BestSize (as determined by a sizer, interior children, or other means)
927 |
# File 'lib/wx/doc/gen/window.rb', line 927 def get_best_virtual_size; end |
#get_best_width(height) ⇒ Integer Also known as: best_width
Returns the best width needed by this window if it had the given height.
825 |
# File 'lib/wx/doc/gen/window.rb', line 825 def get_best_width(height) end |
#get_border(flags) ⇒ Wx::Border #get_border ⇒ Wx::Border Also known as: border
2507 |
# File 'lib/wx/doc/gen/window.rb', line 2507 def get_border(*args) end |
#get_caret ⇒ Wx::Caret Also known as: caret
Returns the caret() associated with the window.
2411 |
# File 'lib/wx/doc/gen/window.rb', line 2411 def get_caret; end |
#get_char_height ⇒ Integer Also known as: char_height
Returns the character height for this window.
1404 |
# File 'lib/wx/doc/gen/window.rb', line 1404 def get_char_height; end |
#get_char_width ⇒ Integer Also known as: char_width
Returns the average character width for this window.
1409 |
# File 'lib/wx/doc/gen/window.rb', line 1409 def get_char_width; end |
#get_children ⇒ Wx::WindowList Also known as: children
Returns a const reference to the list of the window’s children.
Wx::WindowList is a type-safe List-like class whose elements are of type wxWindow*
.
368 |
# File 'lib/wx/doc/gen/window.rb', line 368 def get_children; end |
#get_client_area_origin ⇒ Wx::Point Also known as: client_area_origin
Get the origin of the client area of the window relative to the window top left corner (the client area may be shifted because of the borders, scrollbars, other decorations…)
1245 |
# File 'lib/wx/doc/gen/window.rb', line 1245 def get_client_area_origin; end |
#get_client_rect ⇒ Wx::Rect Also known as: client_rect
Get the client rectangle in window (i.e. client) coordinates.
1250 |
# File 'lib/wx/doc/gen/window.rb', line 1250 def get_client_rect; end |
#get_client_size ⇒ Wx::Size Also known as: client_size
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
830 |
# File 'lib/wx/doc/gen/window.rb', line 830 def get_client_size; end |
#get_containing_sizer ⇒ Wx::Sizer Also known as: containing_sizer
Returns the sizer of which this window is a member, if any, otherwise NULL.
2341 |
# File 'lib/wx/doc/gen/window.rb', line 2341 def get_containing_sizer; end |
#get_content_scale_factor ⇒ Float Also known as: content_scale_factor
Returns the factor mapping logical pixels of this window to physical pixels.
This function can be used to portably determine the number of physical pixels in a window of the given size, by multiplying the window size by the value returned from it. I.e. it returns the factor converting window coordinates to “content view” coordinates, where the view can be just a simple window displaying a Bitmap or GLCanvas or any other kind of window rendering arbitrary “content” on screen. For the platforms not doing any pixel mapping, i.e. where logical and physical pixels are one and the same, this function always returns 1.0 and so using it is, in principle, unnecessary and could be avoided by using preprocessor check for HAS_DPI_INDEPENDENT_PIXELS not being defined, however using this function unconditionally under all platforms is usually simpler and so preferable.
Current behaviour of this function is compatible with wxWidgets 3.0, but different from its behaviour in versions 3.1.0 to 3.1.3, where it returned the same value as #get_dpi_scale_factor. Please use the other function if you need to use a scaling factor greater than 1.0 even for the platforms without HAS_DPI_INDEPENDENT_PIXELS, such as WXMSW.
941 |
# File 'lib/wx/doc/gen/window.rb', line 941 def get_content_scale_factor; end |
#get_cursor ⇒ Wx::Cursor Also known as: cursor
Return the cursor associated with this window.
2419 |
# File 'lib/wx/doc/gen/window.rb', line 2419 def get_cursor; end |
#get_default_attributes ⇒ Wx::VisualAttributes Also known as: default_attributes
Currently this is the same as calling get_class_default_attributes(wx_window.
One advantage of using this function compared to the static version is that the call is automatically dispatched to the correct class (as usual with virtual functions) and you don’t have to specify the class name explicitly. The other one is that in the future this function could return different results, for example it might return a different font for an “Ok” button than for a generic button if the users GUI is configured to show such buttons in bold font. Of course, the down side is that it is impossible to call this function without actually having an object to apply it to whereas the static version can be used without having to create an object first.
1417 |
# File 'lib/wx/doc/gen/window.rb', line 1417 def get_default_attributes; end |
#get_dpi ⇒ Wx::Size Also known as: dpi
Return the DPI of the display used by this window.
The returned value can be different for different windows on systems with support for per-monitor DPI values, such as Microsoft Windows 10. If the DPI is not available, returns size(0,0)
object.
1427 |
# File 'lib/wx/doc/gen/window.rb', line 1427 def get_dpi; end |
#get_dpi_scale_factor ⇒ Float Also known as: dpi_scale_factor
Returns the ratio of the DPI used by this window to the standard DPI.
The returned value is 1 for standard DPI screens or 2 for “200% scaling” and, unlike for #get_content_scale_factor, is the same under all platforms. This factor should be used to increase the size of icons and similar windows whose best size is not based on text metrics when using DPI scaling. E.g. the program may load a 32px bitmap if the content scale factor is 1.0 or 64px version of the same bitmap if it is 2.0 or bigger. Notice that this method should not be used for window sizes expressed in pixels, as they are already scaled by this factor by the underlying toolkit under some platforms. Use from_dip for anything window-related instead.
952 |
# File 'lib/wx/doc/gen/window.rb', line 952 def get_dpi_scale_factor; end |
#get_drop_target ⇒ Wx::DropTarget Also known as: drop_target
Returns the associated drop target, which may be NULL.
2314 |
# File 'lib/wx/doc/gen/window.rb', line 2314 def get_drop_target; end |
#get_effective_min_size ⇒ Wx::Size Also known as: effective_min_size
Merges the window’s best size into the min size and returns the result.
This is the value used by sizers to determine the appropriate amount of space to allocate for the widget. This is the method called by a Sizer when it queries the size of a window or control.
841 |
# File 'lib/wx/doc/gen/window.rb', line 841 def get_effective_min_size; end |
#get_event_handler ⇒ Wx::EvtHandler Also known as: event_handler
Returns the event handler for this window.
By default, the window is its own event handler.
1702 |
# File 'lib/wx/doc/gen/window.rb', line 1702 def get_event_handler; end |
#get_extra_style ⇒ Integer Also known as: extra_style
Returns the extra style bits for the window.
1796 |
# File 'lib/wx/doc/gen/window.rb', line 1796 def get_extra_style; end |
#get_font ⇒ Wx::Font Also known as: font
Returns the font for this window.
1435 |
# File 'lib/wx/doc/gen/window.rb', line 1435 def get_font; end |
#get_foreground_colour ⇒ Wx::Colour Also known as: foreground_colour
Returns the foreground colour of the window.
The meaning of foreground colour varies according to the window class; it may be the text colour or other colour, or it may not be used at all.
1449 |
# File 'lib/wx/doc/gen/window.rb', line 1449 def get_foreground_colour; end |
#get_grand_parent ⇒ Wx::Window Also known as: grand_parent
Returns the grandparent of a window, or NULL if there isn’t one.
380 |
# File 'lib/wx/doc/gen/window.rb', line 380 def get_grand_parent; end |
#get_help_text ⇒ String Also known as: help_text
Gets the help text to be used as context-sensitive help for this window.
Note that the text is actually stored by the current HelpProvider implementation, and not in the window object itself.
2016 |
# File 'lib/wx/doc/gen/window.rb', line 2016 def get_help_text; end |
#get_help_text_at_point(point, origin) ⇒ String Also known as: help_text_at_point
Gets the help text to be used as context-sensitive help for this window.
This method should be overridden if the help message depends on the position inside the window, otherwise #get_help_text can be used.
2035 |
# File 'lib/wx/doc/gen/window.rb', line 2035 def get_help_text_at_point(point, origin) end |
#get_id ⇒ Integer Also known as: id
Returns the identifier of the window.
Each window has an integer identifier. If the application has not provided one (or the default StandardID::ID_ANY) a unique identifier with a negative value will be generated.
2168 |
# File 'lib/wx/doc/gen/window.rb', line 2168 def get_id; end |
#get_label ⇒ String Also known as: label
Generic way of getting a label from any window, for identification purposes.
The interpretation of this function differs from class to class. For frames and dialogs, the value returned is the title. For buttons or static text controls, it is the button text. This function can be useful for meta-programs (such as testing tools or special-needs access programs) which need to identify windows by name.
2179 |
# File 'lib/wx/doc/gen/window.rb', line 2179 def get_label; end |
#get_layout_direction ⇒ Wx::LayoutDirection Also known as: layout_direction
Returns the layout direction for this window, Note that LayoutDirection::Layout_Default is returned if layout direction is not supported.
2184 |
# File 'lib/wx/doc/gen/window.rb', line 2184 def get_layout_direction; end |
#get_max_client_size ⇒ Wx::Size Also known as: max_client_size
Returns the maximum size of window’s client area.
This is an indication to the sizer layout mechanism that this is the maximum possible size as well as the upper bound on window’s size settable using #set_client_size.
850 |
# File 'lib/wx/doc/gen/window.rb', line 850 def get_max_client_size; end |
#get_max_height ⇒ Integer Also known as: max_height
Returns the vertical component of window maximal size.
The returned value is DEFAULT_COORD if the maximal width was not set.
909 |
# File 'lib/wx/doc/gen/window.rb', line 909 def get_max_height; end |
#get_max_size ⇒ Wx::Size Also known as: max_size
Returns the maximum size of the window.
This is an indication to the sizer layout mechanism that this is the maximum possible size as well as the upper bound on window’s size settable using #set_size.
859 |
# File 'lib/wx/doc/gen/window.rb', line 859 def get_max_size; end |
#get_max_width ⇒ Integer Also known as: max_width
Returns the horizontal component of window maximal size.
The returned value is DEFAULT_COORD if the maximal width was not set.
901 |
# File 'lib/wx/doc/gen/window.rb', line 901 def get_max_width; end |
#get_min_client_size ⇒ Wx::Size Also known as: min_client_size
Returns the minimum size of window’s client area, an indication to the sizer layout mechanism that this is the minimum required size of its client area.
It normally just returns the value set by #set_min_client_size, but it can be overridden to do the calculation on demand.
868 |
# File 'lib/wx/doc/gen/window.rb', line 868 def get_min_client_size; end |
#get_min_height ⇒ Integer Also known as: min_height
Returns the vertical component of window minimal size.
The returned value is DEFAULT_COORD if the minimal height was not set.
893 |
# File 'lib/wx/doc/gen/window.rb', line 893 def get_min_height; end |
#get_min_size ⇒ Wx::Size Also known as: min_size
Returns the minimum size of the window, an indication to the sizer layout mechanism that this is the minimum required size.
This method normally just returns the value set by #set_min_size, but it can be overridden to do the calculation on demand.
877 |
# File 'lib/wx/doc/gen/window.rb', line 877 def get_min_size; end |
#get_min_width ⇒ Integer Also known as: min_width
Returns the horizontal component of window minimal size.
The returned value is DEFAULT_COORD if the minimal width was not set.
885 |
# File 'lib/wx/doc/gen/window.rb', line 885 def get_min_width; end |
#get_name ⇒ String Also known as: name
Returns the window’s name.
This name is not guaranteed to be unique; it is up to the programmer to supply an appropriate name in the window constructor or via #set_name.
2203 |
# File 'lib/wx/doc/gen/window.rb', line 2203 def get_name; end |
#get_next_sibling ⇒ Wx::Window Also known as: next_sibling
Returns the next window after this one among the parent’s children or NULL if this window is the last child.
388 |
# File 'lib/wx/doc/gen/window.rb', line 388 def get_next_sibling; end |
#get_parent ⇒ Wx::Window Also known as: parent
Returns the parent of the window, or NULL if there is no parent.
393 |
# File 'lib/wx/doc/gen/window.rb', line 393 def get_parent; end |
#get_popup_menu_selection_from_user(menu, pos = Wx::DEFAULT_POSITION) ⇒ Integer #get_popup_menu_selection_from_user(menu, x, y) ⇒ Integer Also known as:
2087 |
# File 'lib/wx/doc/gen/window.rb', line 2087 def (*args) end |
#get_position ⇒ Wx::Point Also known as: position
This gets the position of the window in pixels, relative to the parent window for the child windows or relative to the display origin for the top level windows.
1216 |
# File 'lib/wx/doc/gen/window.rb', line 1216 def get_position; end |
#get_prev_sibling ⇒ Wx::Window Also known as: prev_sibling
Returns the previous window before this one among the parent’s children or NULL if this window is the first child.
401 |
# File 'lib/wx/doc/gen/window.rb', line 401 def get_prev_sibling; end |
#get_rect ⇒ Wx::Rect Also known as: rect
Returns the position and size of the window as a Rect object.
1224 |
# File 'lib/wx/doc/gen/window.rb', line 1224 def get_rect; end |
#get_screen_position ⇒ Wx::Point Also known as: screen_position
Returns the window position in screen coordinates, whether the window is a child window or a top level one.
1232 |
# File 'lib/wx/doc/gen/window.rb', line 1232 def get_screen_position; end |
#get_screen_rect ⇒ Wx::Rect Also known as: screen_rect
Returns the position and size of the window on the screen as a Rect object.
1240 |
# File 'lib/wx/doc/gen/window.rb', line 1240 def get_screen_rect; end |
#get_scroll_pos(orientation) ⇒ Integer Also known as: scroll_pos
Returns the built-in scrollbar position.
439 |
# File 'lib/wx/doc/gen/window.rb', line 439 def get_scroll_pos(orientation) end |
#get_scroll_range(orientation) ⇒ Integer Also known as: scroll_range
Returns the built-in scrollbar range.
448 |
# File 'lib/wx/doc/gen/window.rb', line 448 def get_scroll_range(orientation) end |
#get_scroll_thumb(orientation) ⇒ Integer Also known as: scroll_thumb
Returns the built-in scrollbar thumb size.
457 |
# File 'lib/wx/doc/gen/window.rb', line 457 def get_scroll_thumb(orientation) end |
#get_size ⇒ Wx::Size Also known as: size
See the GetSize(int,int) overload for more info.
914 |
# File 'lib/wx/doc/gen/window.rb', line 914 def get_size; end |
#get_sizer ⇒ Wx::Sizer Also known as: sizer
Returns the sizer associated with the window by a previous call to #set_sizer, or NULL.
2346 |
# File 'lib/wx/doc/gen/window.rb', line 2346 def get_sizer; end |
#get_text_extent(string) ⇒ Wx::Size Also known as: text_extent
Gets the dimensions of the string as it would be drawn on the window with the currently selected font.
1455 |
# File 'lib/wx/doc/gen/window.rb', line 1455 def get_text_extent(string) end |
#get_theme_enabled ⇒ Boolean Also known as: theme_enabled
Returns true if the window uses the system theme for drawing its background.
1674 |
# File 'lib/wx/doc/gen/window.rb', line 1674 def get_theme_enabled; end |
#get_tool_tip ⇒ Wx::ToolTip Also known as: tool_tip
Get the associated tooltip or NULL if none.
2040 |
# File 'lib/wx/doc/gen/window.rb', line 2040 def get_tool_tip; end |
#get_tool_tip_text ⇒ String Also known as: tool_tip_text
Get the text of the associated tooltip or empty string if none.
2045 |
# File 'lib/wx/doc/gen/window.rb', line 2045 def get_tool_tip_text; end |
#get_update_client_rect ⇒ Wx::Rect Also known as: update_client_rect
Get the update rectangle bounding box in client coords.
1469 |
# File 'lib/wx/doc/gen/window.rb', line 1469 def get_update_client_rect; end |
#get_update_region ⇒ Wx::Region Also known as: update_region
Returns the region specifying which parts of the window have been damaged.
Should only be called within a PaintEvent handler.
1464 |
# File 'lib/wx/doc/gen/window.rb', line 1464 def get_update_region; end |
#get_validator ⇒ Wx::Validator Also known as: validator
Validator functions.
Returns a pointer to the current validator for the window, or NULL if there is none.
2119 |
# File 'lib/wx/doc/gen/window.rb', line 2119 def get_validator; end |
#get_virtual_size ⇒ Wx::Size Also known as: virtual_size
This gets the virtual size of the window in pixels.
By default it returns the client size of the window, but after a call to #set_virtual_size it will return the size set with that method.
922 |
# File 'lib/wx/doc/gen/window.rb', line 922 def get_virtual_size; end |
#get_window_border_size ⇒ Wx::Size Also known as: window_border_size
Returns the size of the left/right and top/bottom borders of this window in x and y components of the result respectively.
957 |
# File 'lib/wx/doc/gen/window.rb', line 957 def get_window_border_size; end |
#get_window_style ⇒ Integer Also known as: window_style
See #get_window_style_flag for more info.
1808 |
# File 'lib/wx/doc/gen/window.rb', line 1808 def get_window_style; end |
#get_window_style_flag ⇒ Integer Also known as: window_style_flag
Gets the window style that was passed to the constructor or #create method.
#get_window_style is another name for the same function.
1803 |
# File 'lib/wx/doc/gen/window.rb', line 1803 def get_window_style_flag; end |
#get_window_variant ⇒ Wx::WindowVariant Also known as: window_variant
Returns the value previously passed to #set_window_variant.
2208 |
# File 'lib/wx/doc/gen/window.rb', line 2208 def get_window_variant; end |
#handle_as_navigation_key(event) ⇒ Boolean
This function will generate the appropriate call to #navigate if the key event is one normally used for keyboard navigation and return true in this case.
Returns true if the key pressed was for navigation and was handled, false otherwise.
1711 |
# File 'lib/wx/doc/gen/window.rb', line 1711 def (event) end |
#handle_window_event(event) ⇒ Boolean
Shorthand for:
get_event_handler.safely_process_event(event)
1721 |
# File 'lib/wx/doc/gen/window.rb', line 1721 def handle_window_event(event) end |
#has_capture ⇒ Boolean Also known as: has_capture?
Returns true if this window has the current mouse capture.
2430 |
# File 'lib/wx/doc/gen/window.rb', line 2430 def has_capture; end |
#has_extra_style(exFlag) ⇒ Boolean Also known as: has_extra_style?
Returns true if the window has the given exFlag bit set in its extra styles.
1817 |
# File 'lib/wx/doc/gen/window.rb', line 1817 def has_extra_style(exFlag) end |
#has_flag(flag) ⇒ Boolean Also known as: has_flag?
Returns true if the window has the given flag bit set.
1823 |
# File 'lib/wx/doc/gen/window.rb', line 1823 def has_flag(flag) end |
#has_focus ⇒ Boolean Also known as: has_focus?
Returns true if the window (or in case of composite controls, its main child window) has focus.
313 |
# File 'lib/wx/doc/gen/window.rb', line 313 def has_focus; end |
#has_multiple_pages ⇒ Boolean Also known as: has_multiple_pages?
This method should be overridden to return true if this window has multiple pages.
All standard class with multiple pages such as Notebook, Listbook and Treebook already override it to return true and user-defined classes with similar behaviour should also do so, to allow the library to handle such windows appropriately.
2536 |
# File 'lib/wx/doc/gen/window.rb', line 2536 def has_multiple_pages; end |
#has_scrollbar(orient) ⇒ Boolean Also known as: has_scrollbar?
Returns true if this window currently has a scroll bar for this orientation.
This method may return false even when #can_scroll for the same orientation returns true, but if #can_scroll returns false, i.e. scrolling in this direction is not enabled at all, #has_scrollbar always returns false as well.
471 |
# File 'lib/wx/doc/gen/window.rb', line 471 def (orient) end |
#has_transparent_background ⇒ Boolean Also known as: has_transparent_background?
Returns true if this window background is transparent (as, for example, for StaticText) and should show the parent window background.
This method is mostly used internally by the library itself and you normally shouldn’t have to call it. You may, however, have to override it in your Wx::Window-derived class to ensure that background is painted correctly.
1476 |
# File 'lib/wx/doc/gen/window.rb', line 1476 def has_transparent_background; end |
#hide ⇒ Boolean
Equivalent to calling #show(false).
1898 |
# File 'lib/wx/doc/gen/window.rb', line 1898 def hide; end |
#hide_with_effect(effect, timeout = 0) ⇒ Boolean
This function hides a window, like #hide, but using a special visual effect if possible.
The parameters of this function are the same as for #show_with_effect, please see their description there.
1906 |
# File 'lib/wx/doc/gen/window.rb', line 1906 def hide_with_effect(effect, timeout=0) end |
#hit_test(x, y) ⇒ Wx::HitTest #hit_test(pt) ⇒ Wx::HitTest
2498 |
# File 'lib/wx/doc/gen/window.rb', line 2498 def hit_test(*args) end |
#inform_first_direction(direction, size, availableOtherDir) ⇒ Boolean
Sizer and friends use this to give a chance to a component to recalc its min size once one of the final size components is known.
Override this function when that is useful (such as for StaticText which can stretch over several lines). Parameter availableOtherDir tells the item how much more space there is available in the opposite direction (-1 if unknown).
967 |
# File 'lib/wx/doc/gen/window.rb', line 967 def inform_first_direction(direction, size, availableOtherDir) end |
#inherit_attributes ⇒ void
This method returns an undefined value.
This function is (or should be, in case of custom controls) called during window creation to intelligently set up the window visual attributes, that is the font and the foreground and background colours.
By “intelligently” the following is meant: by default, all windows use their own get_class_default_attributes default attributes. However if some of the parents attributes are explicitly (that is, using #set_font and not #set_own_font) changed and if the corresponding attribute hadn’t been explicitly set for this window itself, then this window takes the same value as used by the parent. In addition, if the window overrides #should_inherit_colours to return false, the colours will not be changed no matter what and only the font might. This rather complicated logic is necessary in order to accommodate the different usage scenarios. The most common one is when all default attributes are used and in this case, nothing should be inherited as in modern GUIs different controls use different fonts (and colours) than their siblings so they can’t inherit the same value from the parent. However it was also deemed desirable to allow to simply change the attributes of all children at once by just changing the font or colour of their common parent, hence in this case we do inherit the parents attributes.
2544 |
# File 'lib/wx/doc/gen/window.rb', line 2544 def inherit_attributes; end |
#inherits_background_colour ⇒ Boolean
Return true if this window inherits the background colour from its parent.
1608 |
# File 'lib/wx/doc/gen/window.rb', line 1608 def inherits_background_colour; end |
#inherits_foreground_colour ⇒ Boolean
Return true if this window inherits the foreground colour from its parent.
1650 |
# File 'lib/wx/doc/gen/window.rb', line 1650 def inherits_foreground_colour; end |
#init_dialog ⇒ void
This method returns an undefined value.
Sends an EVT_INIT_DIALOG event, whose handler usually transfers data to the dialog via validators.
2548 |
# File 'lib/wx/doc/gen/window.rb', line 2548 def init_dialog; end |
#invalidate_best_size ⇒ void
This method returns an undefined value.
Resets the cached best size value so it will be recalculated the next time it is needed.
974 |
# File 'lib/wx/doc/gen/window.rb', line 974 def invalidate_best_size; end |
#is_being_deleted ⇒ Boolean Also known as: being_deleted?
Returns true if this window is in process of being destroyed.
Top level windows are not deleted immediately but are rather scheduled for later destruction to give them time to process any pending messages; see #destroy description. This function returns true if this window, or one of its parent windows, is scheduled for destruction and can be useful to avoid manipulating it as it’s usually useless to do something with a window which is at the point of disappearing anyhow.
2305 |
# File 'lib/wx/doc/gen/window.rb', line 2305 def is_being_deleted; end |
#is_descendant(win) ⇒ Boolean Also known as: descendant?
Check if the specified window is a descendant of this one.
Returns true if the window is a descendant (i.e. a child or grand-child or grand-grand-child or …) of this one. Notice that a window can never be a descendant of another one if they are in different top level windows, i.e. a child of a Dialog is not considered to be a descendant of dialogs parent Frame.
410 |
# File 'lib/wx/doc/gen/window.rb', line 410 def is_descendant(win) end |
#is_double_buffered ⇒ Boolean Also known as: double_buffered?
Returns true if the window contents is double-buffered by the system, i.e. if any drawing done on the window is really done on a temporary backing surface and transferred to the screen all at once later.
2555 |
# File 'lib/wx/doc/gen/window.rb', line 2555 def is_double_buffered; end |
#is_enabled ⇒ Boolean Also known as: enabled?
Returns true if the window is enabled, i.e. if it accepts user input, false otherwise.
Notice that this method can return false even if this window itself hadn’t been explicitly disabled when one of its parent windows is disabled. To get the intrinsic status of this window, use #is_this_enabled
1913 |
# File 'lib/wx/doc/gen/window.rb', line 1913 def is_enabled; end |
#is_exposed(x, y) ⇒ Boolean #is_exposed(pt) ⇒ Boolean #is_exposed(x, y, w, h) ⇒ Boolean #is_exposed(rect) ⇒ Boolean Also known as: exposed?
1938 |
# File 'lib/wx/doc/gen/window.rb', line 1938 def is_exposed(*args) end |
#is_focusable ⇒ Boolean Also known as: focusable?
Can this window itself have focus?
293 |
# File 'lib/wx/doc/gen/window.rb', line 293 def is_focusable; end |
#is_frozen ⇒ Boolean Also known as: frozen?
Returns true if the window is currently frozen by a call to #freeze.
1378 |
# File 'lib/wx/doc/gen/window.rb', line 1378 def is_frozen; end |
#is_retained ⇒ Boolean Also known as: retained?
Returns true if the window is retained, false otherwise.
Retained windows are only available on X platforms.
2572 |
# File 'lib/wx/doc/gen/window.rb', line 2572 def is_retained; end |
#is_scrollbar_always_shown(orient) ⇒ Boolean Also known as: scrollbar_always_shown?
Return whether a scrollbar is always shown.
480 |
# File 'lib/wx/doc/gen/window.rb', line 480 def (orient) end |
#is_shown ⇒ Boolean Also known as: shown?
Returns true if the window is shown, false if it has been hidden.
1946 |
# File 'lib/wx/doc/gen/window.rb', line 1946 def is_shown; end |
#is_shown_on_screen ⇒ Boolean Also known as: shown_on_screen?
Returns true if the window is physically visible on the screen, i.e. it is shown and all its parents up to the toplevel window are shown as well.
1954 |
# File 'lib/wx/doc/gen/window.rb', line 1954 def is_shown_on_screen; end |
#is_this_enabled ⇒ Boolean Also known as: this_enabled?
Returns true if this window is intrinsically enabled, false otherwise, i.e. if #enable Enable(false) had been called.
This method is mostly used for wxWidgets itself, user code should normally use #is_enabled instead.
2579 |
# File 'lib/wx/doc/gen/window.rb', line 2579 def is_this_enabled; end |
#is_top_level ⇒ Boolean Also known as: top_level?
Returns true if the given window is a top-level one.
Currently all frames and dialogs are considered to be top-level windows (even if they have a parent window).
2586 |
# File 'lib/wx/doc/gen/window.rb', line 2586 def is_top_level; end |
#is_transparent_background_supported(reason = nil) ⇒ Boolean Also known as: transparent_background_supported?
Checks whether using transparent background might work.
If this function returns false, calling #set_background_style with BackgroundStyle::BG_STYLE_TRANSPARENT is not going to work. If it returns true, setting transparent style should normally succeed. Notice that this function would typically be called on the parent of a window you want to set transparent background style for as the window for which this method is called must be fully created.
true if background transparency is supported.
1561 |
# File 'lib/wx/doc/gen/window.rb', line 1561 def is_transparent_background_supported(reason=nil) end |
#layout ⇒ Boolean
Lays out the children of this window using the associated sizer.
If a sizer hadn’t been associated with this window (see #set_sizer), this function doesn’t do anything, unless this is a top level window (see TopLevelWindow#layout). Note that this method is called automatically when the window size changes if it has the associated sizer (or if #set_auto_layout with true argument had been explicitly called), ensuring that it is always laid out correctly.
Always returns true, the return value is not useful.
2380 |
# File 'lib/wx/doc/gen/window.rb', line 2380 def layout; end |
#line_down ⇒ Boolean
Same as ScrollLines (1).
530 |
# File 'lib/wx/doc/gen/window.rb', line 530 def line_down; end |
#line_up ⇒ Boolean
Same as ScrollLines (-1).
526 |
# File 'lib/wx/doc/gen/window.rb', line 526 def line_up; end |
#locked(&block) ⇒ Object
Locks the window from updates while executing the given block.
65 |
# File 'lib/wx/doc/window.rb', line 65 def locked(&block); end |
#lower_window ⇒ void Also known as: send_to_back
This method returns an undefined value.
Lowers the window to the bottom of the window hierarchy (Z-order). This method has been renamed in wxRuby to be consistent with the renamed #raise_window method.
This function only works for TopLevelWindow-derived classes.
22 |
# File 'lib/wx/doc/window.rb', line 22 def lower_window; end |
#move(x, y, flags = Wx::SIZE_USE_EXISTING) ⇒ void #move(pt, flags = Wx::SIZE_USE_EXISTING) ⇒ void
1286 |
# File 'lib/wx/doc/gen/window.rb', line 1286 def move(*args) end |
#move_after_in_tab_order(win) ⇒ void
This method returns an undefined value.
Moves this window in the tab navigation order after the specified win.
This means that when the user presses TAB key on that other window, the focus switches to this window. Default tab order is the same as creation order, this function and #move_before_in_tab_order allow to change it after creating all the windows.
1867 |
# File 'lib/wx/doc/gen/window.rb', line 1867 def move_after_in_tab_order(win) end |
#move_before_in_tab_order(win) ⇒ void
This method returns an undefined value.
Same as #move_after_in_tab_order except that it inserts this window just before win instead of putting it right after it.
1872 |
# File 'lib/wx/doc/gen/window.rb', line 1872 def move_before_in_tab_order(win) end |
#navigate(flags = NavigationKeyEvent::IsForward) ⇒ Boolean
Performs a keyboard navigation action starting from this window.
This method is equivalent to calling #navigate_in method on the parent window.
Returns true if the focus was moved to another window or false if nothing changed.
You may wish to call this from a text control custom keypress handler to do the default navigation behaviour for the tab key, since the standard default behaviour for a multiline text control with the TE_PROCESS_TAB style is to insert a tab and not navigate to the next control. See also NavigationKeyEvent and HandleAsNavigationKey.
1887 |
# File 'lib/wx/doc/gen/window.rb', line 1887 def navigate(flags=NavigationKeyEvent::IsForward) end |
#navigate_in(flags = NavigationKeyEvent::IsForward) ⇒ Boolean
Performs a keyboard navigation action inside this window.
See #navigate for more information.
1894 |
# File 'lib/wx/doc/gen/window.rb', line 1894 def navigate_in(flags=NavigationKeyEvent::IsForward) end |
#on_internal_idle ⇒ void
This method returns an undefined value.
This virtual function is normally only used internally, but sometimes an application may need it to implement functionality that should not be disabled by an application defining an OnIdle handler in a derived class.
This function may be used to do delayed painting, for example, and most implementations call #update_window_ui in order to send update events to the window in idle time.
2593 |
# File 'lib/wx/doc/gen/window.rb', line 2593 def on_internal_idle; end |
#page_down ⇒ Boolean
Same as ScrollPages (1).
538 |
# File 'lib/wx/doc/gen/window.rb', line 538 def page_down; end |
#page_up ⇒ Boolean
Same as ScrollPages (-1).
534 |
# File 'lib/wx/doc/gen/window.rb', line 534 def page_up; end |
#paint {|dc| ... } ⇒ ::Object
Creates an appropriate (temporary) DC to paint on and passes that to the given block. Deletes the DC when the block returns. Creates a Wx::PaintDC when called from an evt_paint handler and a Wx::ClientDC otherwise.
48 |
# File 'lib/wx/doc/window.rb', line 48 def paint; end |
#paint_buffered {|dc| ... } ⇒ ::Object
Similar to #paint but this time creates a buffered paint DC (which will be either a ‘regular’ Wx::PaintDC if the platform natively supports double buffering or a Wx::BufferedPaintDC otherwise) when called from an evt_paint handler and a Wx::ClientDC otherwise.
55 |
# File 'lib/wx/doc/window.rb', line 55 def paint_buffered; end |
#popup_menu(menu, pos = Wx::DEFAULT_POSITION) ⇒ Boolean #popup_menu(menu, x, y) ⇒ Boolean
2113 |
# File 'lib/wx/doc/gen/window.rb', line 2113 def (*args) end |
#post_size_event ⇒ void
This method returns an undefined value.
Posts a size event to the window.
This is the same as #send_size_event with SEND_EVENT_POST argument.
980 |
# File 'lib/wx/doc/gen/window.rb', line 980 def post_size_event; end |
#post_size_event_to_parent ⇒ void
This method returns an undefined value.
Posts a size event to the parent of this window.
This is the same as #send_size_event_to_parent with SEND_EVENT_POST argument.
986 |
# File 'lib/wx/doc/gen/window.rb', line 986 def post_size_event_to_parent; end |
#process_window_event(event) ⇒ Boolean
Convenient wrapper for EvtHandler#process_event.
This is the same as writing
get_event_handler.process_event(event)
but more convenient. Notice that EvtHandler#process_event itself can’t be called for Wx::Window objects as it ignores the event handlers associated with the window; use this function instead.
1732 |
# File 'lib/wx/doc/gen/window.rb', line 1732 def process_window_event(event) end |
#process_window_event_locally(event) ⇒ Boolean
Wrapper for EvtHandler#process_event_locally.
This method is similar to #process_window_event but can be used to search for the event handler only in this window and any event handlers pushed on top of it. Unlike #process_window_event it won’t propagate the event upwards. But it will use the validator and event handlers associated with this window, if any.
1739 |
# File 'lib/wx/doc/gen/window.rb', line 1739 def process_window_event_locally(event) end |
#push_event_handler(handler) ⇒ void
This method returns an undefined value.
Pushes this event handler onto the event stack for the window.
An event handler is an object that is capable of processing the events sent to a window. By default, the window is its own event handler, but an application may wish to substitute another, for example to allow central implementation of event-handling for a variety of different window classes. #push_event_handler allows an application to set up a stack of event handlers, where an event not handled by one event handler is handed to the next one in the chain. E.g. if you have two event handlers A and B and a Wx::Window instance W and you call:
W.push_event_handler(A)
W.push_event_handler(B)
you will end up with the following situation:
Note that you can use #pop_event_handler to remove the event handler.
1756 |
# File 'lib/wx/doc/gen/window.rb', line 1756 def push_event_handler(handler) end |
#raise_window ⇒ void Also known as: bring_to_front
This method returns an undefined value.
Raises the window to the top of the window hierarchy (Z-order). This method has been renamed in wxRuby to avoid clashing with the standard Kernel#raise method.
Notice that this function only requests the window manager to raise this window to the top of Z-order. Depending on its configuration, the window manager may raise the window, not do it at all or indicate that a window requested to be raised in some other way, e.g. by flashing its icon if it is minimized.
This function only works for TopLevelWindow-derived classes.
39 |
# File 'lib/wx/doc/window.rb', line 39 def raise_window; end |
#refresh(eraseBackground = true, rect = nil) ⇒ void
This method returns an undefined value.
Causes this window, and all of its children recursively, to be repainted.
Note that repainting doesn’t happen immediately but only during the next event loop iteration, if you need to update the window immediately you should use #update instead.
1486 |
# File 'lib/wx/doc/gen/window.rb', line 1486 def refresh(eraseBackground=true, rect=nil) end |
#refresh_rect(rect, eraseBackground = true) ⇒ void
1494 |
# File 'lib/wx/doc/gen/window.rb', line 1494 def refresh_rect(rect, eraseBackground=true) end |
#register_hot_key(hotkeyId, modifiers, virtualKeyCode) ⇒ Boolean
Registers a system wide hotkey.
Every time the user presses the hotkey registered here, this window will receive a hotkey event. It will receive the event even if the application is in the background and does not have the input focus because the user is working with some other application.
true if the hotkey was registered successfully. false if some other application already registered a hotkey with this modifier/virtualKeyCode combination.
Use EVT_HOTKEY(hotkeyId, fnc) in the event table to capture the event. This function is currently only implemented under MSW and macOS and always returns false in the other ports.
2613 |
# File 'lib/wx/doc/gen/window.rb', line 2613 def register_hot_key(hotkeyId, modifiers, virtualKeyCode) end |
#release_mouse ⇒ void
This method returns an undefined value.
Releases mouse input captured with #capture_mouse.
2442 |
# File 'lib/wx/doc/gen/window.rb', line 2442 def release_mouse; end |
#remove_child(child) ⇒ void
This method returns an undefined value.
Removes a child window.
This is called automatically by window deletion functions so should not be required by the application programmer. Notice that this function is mostly internal to wxWidgets and shouldn’t be called by the user code.
376 |
# File 'lib/wx/doc/gen/window.rb', line 376 def remove_child(child) end |
#remove_event_handler(handler) ⇒ Boolean
Find the given handler in the windows event handler stack and removes (but does not delete) it from the stack.
See EvtHandler#unlink for more info.
Returns true if it was found and false otherwise (this also results in an assert failure so this function should only be called when the handler is supposed to be there).
1767 |
# File 'lib/wx/doc/gen/window.rb', line 1767 def remove_event_handler(handler) end |
#reparent(newParent) ⇒ Boolean
Reparents the window, i.e. the window will be removed from its current parent window (e.g.
a non-standard toolbar in a Frame) and then re-inserted into another. Notice that currently you need to explicitly call Notebook#remove_page before reparenting a notebook page.
419 |
# File 'lib/wx/doc/gen/window.rb', line 419 def reparent(newParent) end |
#screen_to_client(pt) ⇒ Wx::Point
Converts from screen to client window coordinates.
1342 |
# File 'lib/wx/doc/gen/window.rb', line 1342 def screen_to_client(pt) end |
#scroll_lines(lines) ⇒ Boolean
Scrolls the window by the given number of lines down (if lines is positive) or up.
Returns true if the window was scrolled, false if it was already on top/bottom and nothing was done.
This function is currently only implemented under MSW and TextCtrl under WXGTK (it also works for Scrolled classes under all platforms).
495 |
# File 'lib/wx/doc/gen/window.rb', line 495 def scroll_lines(lines) end |
#scroll_pages(pages) ⇒ Boolean
Scrolls the window by the given number of pages down (if pages is positive) or up.
Returns true if the window was scrolled, false if it was already on top/bottom and nothing was done.
This function is currently only implemented under MSW and WXGTK.
509 |
# File 'lib/wx/doc/gen/window.rb', line 509 def scroll_pages(pages) end |
#scroll_window(dx, dy, rect = nil) ⇒ void
This method returns an undefined value.
Physically scrolls the pixels in the window and move child windows accordingly.
Note that you can often use Scrolled instead of using this function directly.
522 |
# File 'lib/wx/doc/gen/window.rb', line 522 def scroll_window(dx, dy, rect=nil) end |
#send_size_event(flags = 0) ⇒ void
This method returns an undefined value.
This function sends a dummy size event to the window allowing it to re-layout its children positions.
It is sometimes useful to call this function after adding or deleting a children after the frame creation or if a child size changes. Note that if the frame is using either sizers or constraints for the children layout, it is enough to call #layout directly and this function should not be used in this case. If flags includes SEND_EVENT_POST value, this function posts the event, i.e. schedules it for later processing, instead of dispatching it directly. You can also use #post_size_event as a more readable equivalent of calling this function with this flag.
994 |
# File 'lib/wx/doc/gen/window.rb', line 994 def send_size_event(flags=0) end |
#send_size_event_to_parent(flags = 0) ⇒ void
This method returns an undefined value.
Safe wrapper for #get_parent->#send_size_event.
This function simply checks that the window has a valid parent which is not in process of being deleted and calls #send_size_event on it. It is used internally by windows such as toolbars changes to whose state should result in parent re-layout (e.g. when a toolbar is added to the top of the window, all the other windows must be shifted down).
1002 |
# File 'lib/wx/doc/gen/window.rb', line 1002 def send_size_event_to_parent(flags=0) end |
#set_accelerator_table(accel) ⇒ void Also known as: accelerator_table=
This method returns an undefined value.
Sets the accelerator table for this window.
See AcceleratorTable.
2272 |
# File 'lib/wx/doc/gen/window.rb', line 2272 def set_accelerator_table(accel) end |
#set_auto_layout(autoLayout) ⇒ void Also known as: auto_layout=
This method returns an undefined value.
Determines whether the #layout function will be called automatically when the window is resized.
This method is called implicitly by #set_sizer but if you use set_constraints you should call it manually or otherwise the window layout won’t be correctly updated when its size changes.
2389 |
# File 'lib/wx/doc/gen/window.rb', line 2389 def set_auto_layout(autoLayout) end |
#set_background_colour(colour) ⇒ Boolean Also known as: background_colour=
Sets the background colour of the window.
Notice that as with #set_foreground_colour, setting the background colour of a native control may not affect the entire control and could be not supported at all depending on the control and platform. Please see #inherit_attributes for explanation of the difference between this method and #set_own_background_colour.
The background colour is usually painted by the default EraseEvent event handler function under Windows and automatically under GTK. Note that setting the background colour does not cause an immediate refresh, so you may wish to call #clear_background or #refresh after calling this function. Using this function will disable attempts to use themes for this window, if the system supports them. Use with care since usually the themes represent the appearance chosen by the user to be used for all applications on the system.
true if the colour was really changed, false if it was already set to this colour and nothing was done.
1523 |
# File 'lib/wx/doc/gen/window.rb', line 1523 def set_background_colour(colour) end |
#set_background_style(style) ⇒ Boolean Also known as: background_style=
Sets the background style of the window.
The default background style is BackgroundStyle::BG_STYLE_ERASE which indicates that the window background may be erased in EVT_ERASE_BACKGROUND handler. This is a safe, compatibility default; however you may want to change it to BackgroundStyle::BG_STYLE_SYSTEM if you don’t define any erase background event handlers at all, to avoid unnecessary generation of erase background events and always let system erase the background. And you should change the background style to BackgroundStyle::BG_STYLE_PAINT if you define an EVT_PAINT handler which completely overwrites the window background as in this case erasing it previously, either in EVT_ERASE_BACKGROUND handler or in the system default handler, would result in flicker as the background pixels will be repainted twice every time the window is redrawn. Do ensure that the background is entirely erased by your EVT_PAINT handler in this case however as otherwise garbage may be left on screen. Notice that in previous versions of wxWidgets a common way to work around the above mentioned flickering problem was to define an empty EVT_ERASE_BACKGROUND handler. Setting background style to BackgroundStyle::BG_STYLE_PAINT is a simpler and more efficient solution to the same problem. Under WXGTK and WXOSX, you can use BackgroundStyle::BG_STYLE_TRANSPARENT to obtain full transparency of the window background. Note that WXGTK supports this only since GTK 2.12 with a compositing manager enabled, call #is_transparent_background_supported to check whether this is the case, see the example of doing it in the shapedsample“. Also, in order for SetBackgroundStyle(wxBG_STYLE_TRANSPARENT)
to work, it must be called before #create. If you’re using your own Wx::Window-derived class you should write your code in the following way:
class MyWidget < Wx::Window
def initialize(parent, ...)
super() # Use default ctor here!
# Do this first:
set_background_style(Wx::BG_STYLE_TRANSPARENT)
# And really create the window afterwards:
create(parent, ...)
end
end
1550 |
# File 'lib/wx/doc/gen/window.rb', line 1550 def set_background_style(style) end |
#set_can_focus(canFocus) ⇒ void Also known as: can_focus=
This method returns an undefined value.
This method is only implemented by ports which have support for native TAB traversal (such as GTK+ 2.0).
It is called by wxWidgets’ container control code to give the native system a hint when doing TAB traversal. A call to this does not disable or change the effect of programmatically calling #set_focus.
324 |
# File 'lib/wx/doc/gen/window.rb', line 324 def set_can_focus(canFocus) end |
#set_caret(caret) ⇒ void Also known as: caret=
This method returns an undefined value.
Sets the caret() associated with the window.
2447 |
# File 'lib/wx/doc/gen/window.rb', line 2447 def set_caret(caret) end |
#set_client_size(width, height) ⇒ void #set_client_size(size) ⇒ void #set_client_size(rect) ⇒ void Also known as: client_size=
1021 |
# File 'lib/wx/doc/gen/window.rb', line 1021 def set_client_size(*args) end |
#set_containing_sizer(sizer) ⇒ void Also known as: containing_sizer=
This method returns an undefined value.
Used by Sizer internally to notify the window about being managed by the given sizer.
This method should not be called from outside the library, unless you’re implementing a custom sizer class and in the latter case you must call this method with the pointer to the sizer itself whenever a window is added to it and with NULL argument when the window is removed from it.
1029 |
# File 'lib/wx/doc/gen/window.rb', line 1029 def set_containing_sizer(sizer) end |
#set_cursor(cursor) ⇒ Boolean Also known as: cursor=
Sets the window’s cursor.
Notice that the window cursor also sets it for the children of the window implicitly. The cursor may be NULL_CURSOR in which case the window cursor will be reset back to default.
2458 |
# File 'lib/wx/doc/gen/window.rb', line 2458 def set_cursor(cursor) end |
#set_double_buffered(on) ⇒ void Also known as: double_buffered=
This method returns an undefined value.
Turn on or off double buffering of the window if the system supports it.
2561 |
# File 'lib/wx/doc/gen/window.rb', line 2561 def set_double_buffered(on) end |
#set_drop_target(target) ⇒ void Also known as: drop_target=
This method returns an undefined value.
Associates a drop target with this window.
If the window already has a drop target, it is deleted.
2324 |
# File 'lib/wx/doc/gen/window.rb', line 2324 def set_drop_target(target) end |
#set_event_handler(handler) ⇒ void Also known as: event_handler=
This method returns an undefined value.
Sets the event handler for this window.
Note that if you use this function you may want to use as the “next” handler of handler the window itself; in this way when handler doesn’t process an event, the window itself will have a chance to do it.
1775 |
# File 'lib/wx/doc/gen/window.rb', line 1775 def set_event_handler(handler) end |
#set_extra_style(exStyle) ⇒ void Also known as: extra_style=
This method returns an undefined value.
Sets the extra style bits for the window.
The currently defined extra style bits are reported in the class description.
1831 |
# File 'lib/wx/doc/gen/window.rb', line 1831 def set_extra_style(exStyle) end |
#set_focus ⇒ void
This method returns an undefined value.
This sets the window to receive keyboard input.
343 |
# File 'lib/wx/doc/gen/window.rb', line 343 def set_focus; end |
#set_focus_from_kbd ⇒ void
This method returns an undefined value.
This function is called by wxWidgets keyboard navigation code when the user gives the focus to this window from keyboard (e.g. using TAB key).
By default this method simply calls #set_focus but can be overridden to do something in addition to this in the derived classes.
349 |
# File 'lib/wx/doc/gen/window.rb', line 349 def set_focus_from_kbd; end |
#set_font(font) ⇒ Boolean Also known as: font=
Sets the font for this window.
This function should not be called for the parent window if you don’t want its font to be inherited by its children, use #set_own_font instead in this case and see #inherit_attributes for more explanations. Please notice that the given font is not automatically used for PaintDC objects associated with this window, you need to call DC#set_font too. However this font is used by any standard controls for drawing their text as well as by #get_text_extent.
true if the font was really changed, false if it was already set to this font and nothing was done.
1574 |
# File 'lib/wx/doc/gen/window.rb', line 1574 def set_font(font) end |
#set_foreground_colour(colour) ⇒ Boolean Also known as: foreground_colour=
Sets the foreground colour of the window.
The meaning of foreground colour varies according to the window class; it may be the text colour or other colour, or it may not be used at all. Additionally, not all native controls support changing their foreground colour so this method may change their colour only partially or even not at all. Please see #inherit_attributes for explanation of the difference between this method and #set_own_foreground_colour.
true if the colour was really changed, false if it was already set to this colour and nothing was done.
1589 |
# File 'lib/wx/doc/gen/window.rb', line 1589 def set_foreground_colour(colour) end |
#set_help_text(helpText) ⇒ void Also known as: help_text=
This method returns an undefined value.
Sets the help text to be used as context-sensitive help for this window.
Note that the text is actually stored by the current HelpProvider implementation, and not in the window object itself.
2026 |
# File 'lib/wx/doc/gen/window.rb', line 2026 def set_help_text(helpText) end |
#set_id(winid) ⇒ void Also known as: id=
This method returns an undefined value.
Sets the identifier of the window.
Each window has an integer identifier. If the application has not provided one, an identifier will be generated. Normally, the identifier should be provided on creation and should not be modified subsequently.
2222 |
# File 'lib/wx/doc/gen/window.rb', line 2222 def set_id(winid) end |
#set_initial_size(size = Wx::DEFAULT_SIZE) ⇒ void Also known as: initial_size=
This method returns an undefined value.
A smart SetSize that will fill in default size components with the window’s best size values.
Also sets the window’s minsize to the value passed in for use with sizers. This means that if a full or partial size is passed to this function then the sizers will use that size instead of the results of #get_best_size to determine the minimum needs of the window for layout. Most controls will use this to set their initial size, and their min size to the passed in value (if any.)
1042 |
# File 'lib/wx/doc/gen/window.rb', line 1042 def set_initial_size(size=Wx::DEFAULT_SIZE) end |
#set_label(label) ⇒ void Also known as: label=
This method returns an undefined value.
Sets the window’s label.
2231 |
# File 'lib/wx/doc/gen/window.rb', line 2231 def set_label(label) end |
#set_layout_direction(dir) ⇒ void Also known as: layout_direction=
This method returns an undefined value.
Sets the layout direction for this window.
This function is only supported under MSW and GTK platforms, but not under Mac currently.
2239 |
# File 'lib/wx/doc/gen/window.rb', line 2239 def set_layout_direction(dir) end |
#set_max_client_size(size) ⇒ void Also known as: max_client_size=
This method returns an undefined value.
Sets the maximum client size of the window, to indicate to the sizer layout mechanism that this is the maximum possible size of its client area.
Note that this method is just a shortcut for:
set_max_size(client_to_window_size(size))
1055 |
# File 'lib/wx/doc/gen/window.rb', line 1055 def set_max_client_size(size) end |
#set_max_size(size) ⇒ void Also known as: max_size=
This method returns an undefined value.
Sets the maximum size of the window, to indicate to the sizer layout mechanism that this is the maximum possible size.
1065 |
# File 'lib/wx/doc/gen/window.rb', line 1065 def set_max_size(size) end |
#set_min_client_size(size) ⇒ void Also known as: min_client_size=
This method returns an undefined value.
Sets the minimum client size of the window, to indicate to the sizer layout mechanism that this is the minimum required size of window’s client area.
You may need to call this if you change the window size after construction and before adding to its parent sizer. Note, that just as with #set_min_size, calling this method doesn’t prevent the program from explicitly making the window smaller than the specified size. Note that this method is just a shortcut for:
set_min_size(client_to_window_size(size))
1080 |
# File 'lib/wx/doc/gen/window.rb', line 1080 def set_min_client_size(size) end |
#set_min_size(size) ⇒ void Also known as: min_size=
This method returns an undefined value.
Sets the minimum size of the window, to indicate to the sizer layout mechanism that this is the minimum required size.
You may need to call this if you change the window size after construction and before adding to its parent sizer. Notice that calling this method doesn’t prevent the program from making the window explicitly smaller than the specified size by calling #set_size, it just ensures that it won’t become smaller than this size during the automatic layout.
1091 |
# File 'lib/wx/doc/gen/window.rb', line 1091 def set_min_size(size) end |
#set_name(name) ⇒ void Also known as: name=
This method returns an undefined value.
Sets the window’s name.
2248 |
# File 'lib/wx/doc/gen/window.rb', line 2248 def set_name(name) end |
#set_next_handler(handler) ⇒ void Also known as: next_handler=
This method returns an undefined value.
Wx::Windows cannot be used to form event handler chains; this function thus will assert when called.
Note that instead you can use #push_event_handler or #set_event_handler to implement a stack of event handlers to override Wx::Window‘s own event handling mechanism.
1783 |
# File 'lib/wx/doc/gen/window.rb', line 1783 def set_next_handler(handler) end |
#set_own_background_colour(colour) ⇒ void Also known as: own_background_colour=
This method returns an undefined value.
Sets the background colour of the window but prevents it from being inherited by the children of this window.
1599 |
# File 'lib/wx/doc/gen/window.rb', line 1599 def set_own_background_colour(colour) end |
#set_own_font(font) ⇒ void Also known as: own_font=
This method returns an undefined value.
Sets the font of the window but prevents it from being inherited by the children of this window.
1627 |
# File 'lib/wx/doc/gen/window.rb', line 1627 def set_own_font(font) end |
#set_own_foreground_colour(colour) ⇒ void Also known as: own_foreground_colour=
This method returns an undefined value.
Sets the foreground colour of the window but prevents it from being inherited by the children of this window.
1637 |
# File 'lib/wx/doc/gen/window.rb', line 1637 def set_own_foreground_colour(colour) end |
#set_position(pt) ⇒ void Also known as: position=
This method returns an undefined value.
Moves the window to the specified position.
This is exactly the same as calling #move with the default arguments.
1293 |
# File 'lib/wx/doc/gen/window.rb', line 1293 def set_position(pt) end |
#set_previous_handler(handler) ⇒ void Also known as: previous_handler=
This method returns an undefined value.
Wx::Windows cannot be used to form event handler chains; this function thus will assert when called.
Note that instead you can use #push_event_handler or #set_event_handler to implement a stack of event handlers to override Wx::Window‘s own event handling mechanism.
1791 |
# File 'lib/wx/doc/gen/window.rb', line 1791 def set_previous_handler(handler) end |
#set_scroll_pos(orientation, pos, refresh = true) ⇒ void
This method returns an undefined value.
Sets the position of one of the built-in scrollbars.
This function does not directly affect the contents of the window: it is up to the application to take note of scrollbar attributes and redraw contents accordingly.
556 |
# File 'lib/wx/doc/gen/window.rb', line 556 def set_scroll_pos(orientation, pos, refresh=true) end |
#set_scrollbar(orientation, position, thumbSize, range, refresh = true) ⇒ void
This method returns an undefined value.
Sets the scrollbar properties of a built-in scrollbar.
Let's say you wish to display 50 lines of text, using the same font. The window is sized so that you can only see 16 lines at a time. You would use: ```ruby set_scrollbar(Wx::VERTICAL, 0, 16, 50) ``` Note that with the window at this size, the thumb position can never go above 50 minus 16, or 34. You can determine how many lines are currently visible by dividing the current view size by the character height in pixels. When defining your own scrollbar behaviour, you will always need to recalculate the scrollbar settings when the window size changes. You could therefore put your scrollbar calculations and SetScrollbar call into a function named AdjustScrollbars, which can be called initially and also from your SizeEvent handler function.
579 |
# File 'lib/wx/doc/gen/window.rb', line 579 def (orientation, position, thumbSize, range, refresh=true) end |
#set_size(x, y, width, height, sizeFlags = Wx::SIZE_AUTO) ⇒ void #set_size(rect) ⇒ void #set_size(size) ⇒ void Also known as: size=
1135 |
# File 'lib/wx/doc/gen/window.rb', line 1135 def set_size(*args) end |
#set_size_hints(minSize, maxSize = Wx::DEFAULT_SIZE, incSize = Wx::DEFAULT_SIZE) ⇒ void #set_size_hints(minW, minH, maxW = -1, maxH = -1, incW = -1, incH = -1) ⇒ void Also known as: size_hints=
1157 |
# File 'lib/wx/doc/gen/window.rb', line 1157 def set_size_hints(*args) end |
#set_sizer(sizer) ⇒ void Also known as: sizer=
This method returns an undefined value.
Sets the window to have the given layout sizer.
The window will then own the object, and will take care of its deletion. If an existing layout constraints object is already owned by the window, it will be deleted if the deleteOld parameter is true. Note that this function will also call #set_auto_layout implicitly with true parameter if the sizer is non-NULL and false otherwise so that the sizer will be effectively used to layout the window children whenever it is resized.
SetSizer enables and disables Layout automatically.
2361 |
# File 'lib/wx/doc/gen/window.rb', line 2361 def set_sizer(sizer) end |
#set_sizer_and_fit(sizer) ⇒ void Also known as: sizer_and_fit=
This method returns an undefined value.
Associate the sizer with the window and set the window size and minimal size accordingly.
This method calls #set_sizer and then Sizer#set_size_hints which sets the initial window size to the size needed to accommodate all sizer elements and sets the minimal size to the same size, this preventing the user from resizing this window to be less than this minimal size (if it’s a top-level window which can be directly resized by the user).
2369 |
# File 'lib/wx/doc/gen/window.rb', line 2369 def set_sizer_and_fit(sizer) end |
#set_theme_enabled(enable) ⇒ void Also known as: theme_enabled=
This method returns an undefined value.
This function tells a window if it should use the system’s “theme” code to draw the windows’ background instead of its own background drawing code.
This does not always have any effect since the underlying platform obviously needs to support the notion of themes in user defined windows. One such platform is GTK+ where windows can have (very colourful) backgrounds defined by a user’s selected theme. Dialogs, notebook pages and the status bar have this flag set to true by default so that the default look and feel is simulated best.
1666 |
# File 'lib/wx/doc/gen/window.rb', line 1666 def set_theme_enabled(enable) end |
#set_tool_tip(tipString) ⇒ void #set_tool_tip(tip) ⇒ void Also known as: tool_tip=
2061 |
# File 'lib/wx/doc/gen/window.rb', line 2061 def set_tool_tip(*args) end |
#set_transparent(alpha) ⇒ Boolean Also known as: transparent=
Set the transparency of the window.
If the system supports transparent windows, returns true, otherwise returns false and the window remains fully opaque. See also #can_set_transparent. The parameter alpha is in the range 0..255 where 0 corresponds to a fully transparent window and 255 to the fully opaque one. The constants IMAGE_ALPHA_TRANSPARENT and IMAGE_ALPHA_OPAQUE can be used.
1690 |
# File 'lib/wx/doc/gen/window.rb', line 1690 def set_transparent(alpha) end |
#set_validator(validator) ⇒ void Also known as: validator=
This method returns an undefined value.
Deletes the current validator (if any) and sets the window validator, having called Validator#clone to create a new validator of this type.
2125 |
# File 'lib/wx/doc/gen/window.rb', line 2125 def set_validator(validator) end |
#set_virtual_size(width, height) ⇒ void #set_virtual_size(size) ⇒ void Also known as: virtual_size=
1172 |
# File 'lib/wx/doc/gen/window.rb', line 1172 def set_virtual_size(*args) end |
#set_window_style(style) ⇒ void Also known as: window_style=
This method returns an undefined value.
See #set_window_style_flag for more info.
1847 |
# File 'lib/wx/doc/gen/window.rb', line 1847 def set_window_style(style) end |
#set_window_style_flag(style) ⇒ void Also known as: window_style_flag=
This method returns an undefined value.
Sets the style of the window.
Please note that some styles cannot be changed after the window creation and that #refresh might need to be called after changing the others for the change to take place immediately. See Window styles for more information about flags.
1841 |
# File 'lib/wx/doc/gen/window.rb', line 1841 def set_window_style_flag(style) end |
#set_window_variant(variant) ⇒ void Also known as: window_variant=
This method returns an undefined value.
Chooses a different variant of the window display to use.
Window variants currently just differ in size, as can be seen from Wx::WindowVariant documentation. Under all platforms but macOS, this function does nothing more than change the font used by the window. However under macOS it is implemented natively and selects the appropriate variant of the native widget, which has better appearance than just scaled down or up version of the normal variant, so it should be preferred to directly tweaking the font size. By default the controls naturally use the normal variant.
2257 |
# File 'lib/wx/doc/gen/window.rb', line 2257 def set_window_variant(variant) end |
#should_inherit_colours ⇒ Boolean
Return true from here to allow the colours of this window to be changed by #inherit_attributes.
Returning false forbids inheriting them from the parent window. The base class version returns false, but this method is overridden in Control where it returns true.
1657 |
# File 'lib/wx/doc/gen/window.rb', line 1657 def should_inherit_colours; end |
#show(show = true) ⇒ Boolean
Shows or hides the window.
You may need to call raise for a top level window if you want to bring it to top, although this is not needed if #show is called immediately after the frame creation. Notice that the default state of newly created top level windows is hidden (to allow you to create their contents without flicker) unlike for all the other, not derived from TopLevelWindow, windows that are by default created in the shown state.
true if the window has been shown or hidden or false if nothing was done because it already was in the requested state.
1994 |
# File 'lib/wx/doc/gen/window.rb', line 1994 def show(show=true) end |
#show_with_effect(effect, timeout = 0) ⇒ Boolean
2007 |
# File 'lib/wx/doc/gen/window.rb', line 2007 def show_with_effect(effect, timeout=0) end |
#switch_sizer(new_sizer) ⇒ Wx::Sizer
Switches the current sizer with the given sizer and detaches and returns the ‘old’ sizer.
93 |
# File 'lib/wx/doc/window.rb', line 93 def switch_sizer(new_sizer) end |
#thaw ⇒ void
1370 |
# File 'lib/wx/doc/gen/window.rb', line 1370 def thaw; end |
#to_dip(sz) ⇒ Wx::Size #to_dip(pt) ⇒ Wx::Point #to_dip(d) ⇒ Integer
701 |
# File 'lib/wx/doc/gen/window.rb', line 701 def to_dip(*args) end |
#to_phys(sz) ⇒ Wx::Size #to_phys(pt) ⇒ Wx::Point #to_phys(d) ⇒ Integer
777 |
# File 'lib/wx/doc/gen/window.rb', line 777 def to_phys(*args) end |
#toggle_window_style(flag) ⇒ Boolean
Turns the given flag on if it’s currently turned off and vice versa.
This function cannot be used if the value of the flag is 0 (which is often the case for default flags). Also, please notice that not all styles can be changed after the control creation. Returns true if the style was turned on by this function, false if it was switched off.
1859 |
# File 'lib/wx/doc/gen/window.rb', line 1859 def toggle_window_style(flag) end |
#transfer_data_from_window ⇒ Boolean
Transfers values from child controls to data areas specified by their validators.
Returns false if a transfer failed. Notice that this also calls #transfer_data_from_window for all children recursively.
2136 |
# File 'lib/wx/doc/gen/window.rb', line 2136 def transfer_data_from_window; end |
#transfer_data_to_window ⇒ Boolean
Transfers values to child controls from data areas specified by their validators.
Notice that this also calls #transfer_data_to_window for all children recursively. Returns false if a transfer failed.
2146 |
# File 'lib/wx/doc/gen/window.rb', line 2146 def transfer_data_to_window; end |
#unregister_hot_key(hotkeyId) ⇒ Boolean
Unregisters a system wide hotkey.
true if the hotkey was unregistered successfully, false if the id was invalid.
This function is currently only implemented under MSW.
2628 |
# File 'lib/wx/doc/gen/window.rb', line 2628 def unregister_hot_key(hotkeyId) end |
#unset_tool_tip ⇒ void
This method returns an undefined value.
Unset any existing tooltip.
2069 |
# File 'lib/wx/doc/gen/window.rb', line 2069 def unset_tool_tip; end |
#update ⇒ void
This method returns an undefined value.
Calling this method immediately repaints the invalidated area of the window and all of its children recursively (this normally only happens when the flow of control returns to the event loop).
Notice that this function doesn’t invalidate any area of the window so nothing happens if nothing has been invalidated (i.e. marked as requiring a redraw). Use #refresh first if you want to immediately redraw the window unconditionally.
1500 |
# File 'lib/wx/doc/gen/window.rb', line 1500 def update; end |
#update_window_ui(flags = Wx::UpdateUI::UPDATE_UI_NONE) ⇒ void
This method returns an undefined value.
This function sends one or more UpdateUIEvent to the window.
The particular implementation depends on the window; for example a ToolBar will send an update UI event for each toolbar button, and a Frame will send an update UI event for each menubar menu item. You can call this function from your application to ensure that your UI is up-to-date at this point (as far as your UpdateUIEvent handlers are concerned). This may be necessary if you have called UpdateUIEvent.set_mode or UpdateUIEvent.set_update_interval to limit the overhead that wxWidgets incurs by sending update UI events in idle time. flags should be a bitlist of one or more of the UpdateUI enumeration. If you are calling this function from an OnInternalIdle or OnIdle function, make sure you pass the UpdateUI::UPDATE_UI_FROMIDLE flag, since this tells the window to only update the UI elements that need to be updated in idle time. Some windows update their elements only when necessary, for example when a menu is about to be shown. The following is an example of how to call UpdateWindowUI from an idle function.
class MyWindow
...
def on_internal_idle
update_window_ui(Wx::UPDATE_UI_FROMIDLE) if Wx::UpdateUIEvent.can_update(self)
end
...
end
2650 |
# File 'lib/wx/doc/gen/window.rb', line 2650 def update_window_ui(flags=Wx::UpdateUI::UPDATE_UI_NONE) end |
#use_background_colour ⇒ Boolean
Return true if a background colour has been set for this window.
Same as #use_bg_col
1618 |
# File 'lib/wx/doc/gen/window.rb', line 1618 def use_background_colour; end |
#use_bg_col ⇒ Boolean
Return true if a background colour has been set for this window.
1612 |
# File 'lib/wx/doc/gen/window.rb', line 1612 def use_bg_col; end |
#use_foreground_colour ⇒ Boolean
Return true if a foreground colour has been set for this window.
1642 |
# File 'lib/wx/doc/gen/window.rb', line 1642 def use_foreground_colour; end |
#validate ⇒ Boolean
Validates the current values of the child controls using their validators.
Notice that this also calls #validate for all children recursively. Returns false if any of the validations failed.
2156 |
# File 'lib/wx/doc/gen/window.rb', line 2156 def validate; end |
#warp_pointer(x, y) ⇒ void
This method returns an undefined value.
Moves the pointer to the given position on the window.
Apple Human Interface Guidelines forbid moving the mouse cursor programmatically so you should avoid using this function in Mac applications (and probably avoid using it under the other platforms without good reason as well).
2471 |
# File 'lib/wx/doc/gen/window.rb', line 2471 def warp_pointer(x, y) end |
#window_to_client_size(size) ⇒ Wx::Size
Converts window size size to corresponding client area size In other words, the returned value is what would #get_client_size return if this window had given window size.
Components with DEFAULT_COORD value are left unchanged. Note that the conversion is not always exact, it assumes that non-client area doesn’t change and so doesn’t take into account things like menu bar (un)wrapping or (dis)appearance of the scrollbars.
617 |
# File 'lib/wx/doc/gen/window.rb', line 617 def window_to_client_size(size) end |