Class: Wx::Window

Inherits:
EvtHandler show all
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: This style is obsolete and doesn't do anything. See #set_transparent.

  • 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:

Category: Miscellaneous Windows

See Also:

Class Method Summary collapse

Instance Method Summary collapse

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_minimize, #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_backstage_clicked, #evt_backstage_item_clicked, #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_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_label_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_label_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_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_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_webview_browsing_data_cleared, #evt_webview_created, #evt_webview_error, #evt_webview_fullscreen_changed, #evt_webview_loaded, #evt_webview_navigated, #evt_webview_navigating, #evt_webview_newwindow, #evt_webview_newwindow_features, #evt_webview_pdf_saved, #evt_webview_script_message_received, #evt_webview_script_result, #evt_webview_title_changed, #evt_webview_window_close_requested, #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, #make_shared, #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

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 #initialize(parent, id, pos = Wx::DEFAULT_POSITION, size = Wx::DEFAULT_SIZE, style = 0, name = Wx::PANEL_NAME_STR) {|win| ... } ⇒ Wx::Window

Returns a new instance of Window.

Overloads:

  • #initialize ⇒ Wx::Window

    Default constructor.

  • #initialize(parent, id, pos = Wx::DEFAULT_POSITION, size = Wx::DEFAULT_SIZE, style = 0, name = Wx::PANEL_NAME_STR) ⇒ Wx::Window

    Constructs a window, which can be a child of a frame, dialog or any other non-control window.

    Parameters:

    • parent (Wx::Window) —

      Pointer to a parent window.

    • id (Integer) —

      Window identifier. If StandardID::ID_ANY, will automatically create an identifier. See Window IDs for more information about IDs.

    • pos (Array(Integer, Integer), Wx::Point) (defaults to: Wx::DEFAULT_POSITION) —

      Window position. DEFAULT_POSITION indicates that wxWidgets should generate a default position for the window. If using the Wx::Window class directly, supply an actual position.

    • size (Array(Integer, Integer), Wx::Size) (defaults to: Wx::DEFAULT_SIZE) —

      Window size. DEFAULT_SIZE indicates that wxWidgets should generate a default size for the window. If no suitable size can be found, the window will be sized to 20x20 pixels so that the window is visible but obviously not correctly sized.

    • style (Integer) (defaults to: 0) —

      Window style. For generic window styles, please see Wx::Window.

    • name (String) (defaults to: Wx::PANEL_NAME_STR) —

      Window name.

  • #initialize(parent, id, pos = Wx::DEFAULT_POSITION, size = Wx::DEFAULT_SIZE, style = 0, name = Wx::PANEL_NAME_STR) {|win| ... } ⇒ Wx::Window

    Constructs a window, which can be a child of a frame, dialog or any other non-control window.

    Parameters:

    • parent (Wx::Window) —

      Pointer to a parent window.

    • id (Integer) —

      Window identifier. If StandardID::ID_ANY, will automatically create an identifier. See Window IDs for more information about IDs.

    • pos (Array(Integer, Integer), Wx::Point) (defaults to: Wx::DEFAULT_POSITION) —

      Window position. DEFAULT_POSITION indicates that wxWidgets should generate a default position for the window. If using the Wx::Window class directly, supply an actual position.

    • size (Array(Integer, Integer), Wx::Size) (defaults to: Wx::DEFAULT_SIZE) —

      Window size. DEFAULT_SIZE indicates that wxWidgets should generate a default size for the window. If no suitable size can be found, the window will be sized to 20x20 pixels so that the window is visible but obviously not correctly sized.

    • style (Integer) (defaults to: 0) —

      Window style. For generic window styles, please see Wx::Window.

    • name (String) (defaults to: Wx::PANEL_NAME_STR) —

      Window name.

    Yield Parameters:



2910
# File 'lib/wx/doc/gen/window.rb', line 2910

def initialize(*args) end

Class Method Details

.find_focus ⇒ Wx::Window

Finds the window or control which currently has the keyboard focus.

Remark:

Note that this is a static function, so it can be called without needing a Wx::Window pointer.

Returns:

See Also:



2817
# File 'lib/wx/doc/gen/window.rb', line 2817

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 nil, 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 nil if not found.

Parameters:

  • id (Integer)
  • parent (Wx::Window) (defaults to: 0)

Returns:

See Also:

  • find_window


2828
# File 'lib/wx/doc/gen/window.rb', line 2828

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 nil, 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 nil if not found.

Parameters:

  • label (String)
  • parent (Wx::Window) (defaults to: 0)

Returns:

See Also:

  • find_window


2840
# File 'lib/wx/doc/gen/window.rb', line 2840

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 nil, 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 nil if not found.

Parameters:

  • name (String)
  • parent (Wx::Window) (defaults to: 0)

Returns:



2851
# File 'lib/wx/doc/gen/window.rb', line 2851

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

Overloads:

  • .self.from_dip(sz, w) ⇒ Wx::Size

    Non window-specific DPI-independent pixels conversion functions.

    The display resolution depends on the window in general as different windows can appear on different monitors using different resolutions, however sometimes no window is available for converting the resolution independent pixels to the physical values and in this case these static overloads can be used with nil value for w argument. Using these methods is discouraged as passing nil will prevent your application from correctly supporting monitors with different resolutions even in the future wxWidgets versions which will add support for them, and passing non-null window is just a less convenient way of calling the non-static from_dip method.

    Parameters:

    Returns:

  • .self.from_dip(pt, w) ⇒ Wx::Point

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    Parameters:

    Returns:

  • .self.from_dip(d, w) ⇒ Integer

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    Parameters:

    Returns:

    • (Integer)


732
# File 'lib/wx/doc/gen/window.rb', line 732

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

Overloads:

  • .self.from_phys(sz, w) ⇒ Wx::Size

    Convert from physical pixels to logical pixels for any window.

    This function can be used without any window pointer, i.e. w can be nil. In this case, it uses the content scale factor of the main screen if supported or just does nothing (i.e. uses scale factor of 1) otherwise. Using member overloads is always preferable, if possible, as they always use the actually appropriate content scale factor.

    Parameters:

    Returns:

  • .self.from_phys(pt, w) ⇒ Wx::Point

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    Parameters:

    Returns:

  • .self.from_phys(d, w) ⇒ Integer

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    Parameters:

    Returns:

    • (Integer)


817
# File 'lib/wx/doc/gen/window.rb', line 817

def self.from_phys(*args) end

.get_capture ⇒ Wx::Window

Returns the currently captured window.

Returns:

See Also:



2862
# File 'lib/wx/doc/gen/window.rb', line 2862

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.

Parameters:

  • variant (Wx::WindowVariant) (defaults to: Wx::WindowVariant::WINDOW_VARIANT_NORMAL)

Returns:

See Also:



2805
# File 'lib/wx/doc/gen/window.rb', line 2805

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.

Parameters:

  • count (Integer) (defaults to: 1) —

    The number of sequential IDs to reserve.

Returns:

  • (Integer)

See Also:



2875
# File 'lib/wx/doc/gen/window.rb', line 2875

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

Overloads:

  • .self.to_dip(sz, w) ⇒ Wx::Size

    Non window-specific pixel to DPI-independent pixels conversion functions.

    The display resolution depends on the window in general as different windows can appear on different monitors using different resolutions, however sometimes no window is available for converting the resolution independent pixels to the physical values and in this case these static overloads can be used with nil value for w argument. Using these methods is discouraged as passing nil will prevent your application from correctly supporting monitors with different resolutions even in the future wxWidgets versions which will add support for them, and passing non-null window is just a less convenient way of calling the non-static to_dip method.

    Parameters:

    Returns:

  • .self.to_dip(pt, w) ⇒ Wx::Point

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    Parameters:

    Returns:

  • .self.to_dip(d, w) ⇒ Integer

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    Parameters:

    Returns:

    • (Integer)


777
# File 'lib/wx/doc/gen/window.rb', line 777

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

Overloads:

  • .self.to_phys(sz, w) ⇒ Wx::Size

    Convert from logical pixels to physical pixels for any window.

    This function can be used without any window pointer, i.e. w can be nil. In this case, it uses the content scale factor of the main screen if supported or just does nothing (i.e. uses scale factor of 1) otherwise. Using member overloads is always preferable, if possible, as they always use the actually appropriate content scale factor.

    Parameters:

    Returns:

  • .self.to_phys(pt, w) ⇒ Wx::Point

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    Parameters:

    Returns:

  • .self.to_phys(d, w) ⇒ Integer

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    Parameters:

    Returns:

    • (Integer)


853
# File 'lib/wx/doc/gen/window.rb', line 853

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.

Parameters:

  • id (Integer) —

    The starting ID of the range of IDs to unreserve.

  • count (Integer) (defaults to: 1) —

    The number of sequential IDs to unreserve.

See Also:



2886
# File 'lib/wx/doc/gen/window.rb', line 2886

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.

Returns:

  • (Boolean)

See Also:



277
# File 'lib/wx/doc/gen/window.rb', line 277

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.

Returns:

  • (Boolean)


281
# File 'lib/wx/doc/gen/window.rb', line 281

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.

Returns:

  • (Boolean)


287
# File 'lib/wx/doc/gen/window.rb', line 287

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.

Parameters:



402
# File 'lib/wx/doc/gen/window.rb', line 402

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.

Parameters:

  • x (Integer)
  • width (Integer)
  • widthTotal (Integer)

Returns:

  • (Integer)


2290
# File 'lib/wx/doc/gen/window.rb', line 2290

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.

Remark:

This function is currently not implemented.

Parameters:

  • hflag (Boolean) (defaults to: true) —

    Whether the horizontal scroll bar should always be visible.

  • vflag (Boolean) (defaults to: true) —

    Whether the vertical scroll bar should always be visible.



477
# File 'lib/wx/doc/gen/window.rb', line 477

def always_show_scrollbars(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.

Returns:

  • (Boolean)


642
# File 'lib/wx/doc/gen/window.rb', line 642

def begin_repositioning_children; end

#cache_best_size(size) ⇒ void

This method returns an undefined value.

Sets the cached best size value.

Parameters:

  • size (Array(Integer, Integer), Wx::Size)

See Also:



656
# File 'lib/wx/doc/gen/window.rb', line 656

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

Returns:

  • (Boolean)


312
# File 'lib/wx/doc/gen/window.rb', line 312

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?

Returns:

  • (Boolean)


317
# File 'lib/wx/doc/gen/window.rb', line 317

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.

Parameters:

Returns:

  • (Boolean)


509
# File 'lib/wx/doc/gen/window.rb', line 509

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.

Returns:

  • (Boolean)


1760
# File 'lib/wx/doc/gen/window.rb', line 1760

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.

See Also:



2517
# File 'lib/wx/doc/gen/window.rb', line 2517

def capture_mouse; end

#center(dir = Wx::Orientation::BOTH) ⇒ void

This method returns an undefined value.

A synonym for #centre.

Parameters:

  • dir (Integer) (defaults to: Wx::Orientation::BOTH)


1250
# File 'lib/wx/doc/gen/window.rb', line 1250

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.

Parameters:

  • dir (Integer) (defaults to: Wx::Orientation::BOTH)


1255
# File 'lib/wx/doc/gen/window.rb', line 1255

def center_on_parent(dir=Wx::Orientation::BOTH) end

#centre(direction = Wx::Orientation::BOTH) ⇒ void

This method returns an undefined value.

Centres the window.

Remark:

If the window is a top level one (i.e. doesn't have a parent), it will be centred relative to the screen anyhow.

Parameters:

  • direction (Integer) (defaults to: Wx::Orientation::BOTH) —

    Specifies the direction for the centring. May be Orientation::HORIZONTAL, Orientation::VERTICAL or Orientation::BOTH. It may also include the CENTRE_ON_SCREEN flag if you want to centre the window on the entire screen and not on its parent window.

See Also:



1267
# File 'lib/wx/doc/gen/window.rb', line 1267

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.

Remark:

This method 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.

Parameters:

See Also:



1281
# File 'lib/wx/doc/gen/window.rb', line 1281

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.



1421
# File 'lib/wx/doc/gen/window.rb', line 1421

def clear_background; end

#client_to_screen(pt) ⇒ Wx::Point

Converts to screen coordinates from coordinates relative to this window.

Parameters:

  • pt (Array(Integer, Integer), Wx::Point) —

    The client position for the second form of the function.

Returns:



1371
# File 'lib/wx/doc/gen/window.rb', line 1371

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.

Parameters:

  • size (Array(Integer, Integer), Wx::Size)

Returns:

See Also:



664
# File 'lib/wx/doc/gen/window.rb', line 664

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.

Remark:

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

Parameters:

  • force (Boolean) (defaults to: false) —

    false if the window's close handler should be able to veto the destruction of this window, true if it cannot.

Returns:

  • (Boolean)

See Also:



2401
# File 'lib/wx/doc/gen/window.rb', line 2401

def close(force=false) end

#convert_dialog_to_pixels(pt) ⇒ Wx::Point #convert_dialog_to_pixels(sz) ⇒ Wx::Size

Overloads:

  • #convert_dialog_to_pixels(pt) ⇒ Wx::Point

    Converts a point or size from dialog units to pixels.

    For the x dimension, the dialog units are multiplied by the average character width and then divided by 4. For the y dimension, the dialog units are multiplied by the average character height and then divided by 8.

    Remark:

    Dialog units are used for maintaining a dialog's proportions even if the font changes. You can also use these functions programmatically.

    Parameters:

    Returns:

    See Also:

  • #convert_dialog_to_pixels(sz) ⇒ Wx::Size

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    Parameters:

    • sz (Array(Integer, Integer), Wx::Size)

    Returns:



1390
# File 'lib/wx/doc/gen/window.rb', line 1390

def convert_dialog_to_pixels(*args) end

#convert_pixels_to_dialog(pt) ⇒ Wx::Point #convert_pixels_to_dialog(sz) ⇒ Wx::Size

Overloads:

  • #convert_pixels_to_dialog(pt) ⇒ Wx::Point

    Converts a point or size from pixels to dialog units.

    For the x dimension, the pixels are multiplied by 4 and then divided by the average character width. For the y dimension, the pixels are multiplied by 8 and then divided by the average character height.

    Remark:

    Dialog units are used for maintaining a dialog's proportions even if the font changes.

    Parameters:

    Returns:

    See Also:

  • #convert_pixels_to_dialog(sz) ⇒ Wx::Size

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    Parameters:

    • sz (Array(Integer, Integer), Wx::Size)

    Returns:



1409
# File 'lib/wx/doc/gen/window.rb', line 1409

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

Parameters:

  • parent (Wx::Window)
  • id (Integer)
  • pos (Array(Integer, Integer), Wx::Point) (defaults to: Wx::DEFAULT_POSITION)
  • size (Array(Integer, Integer), Wx::Size) (defaults to: Wx::DEFAULT_SIZE)
  • style (Integer) (defaults to: 0)
  • name (String) (defaults to: Wx::PANEL_NAME_STR)

Returns:

  • (Boolean)


2966
# File 'lib/wx/doc/gen/window.rb', line 2966

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.

Returns:

  • (Boolean)


2408
# File 'lib/wx/doc/gen/window.rb', line 2408

def destroy; end

#destroy_children ⇒ Boolean

Destroys all children of a window.

Called automatically by the destructor.

Returns:

  • (Boolean)


408
# File 'lib/wx/doc/gen/window.rb', line 408

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.

Returns:

  • (Boolean)


2051
# File 'lib/wx/doc/gen/window.rb', line 2051

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.



294
# File 'lib/wx/doc/gen/window.rb', line 294

def disable_focus_from_keyboard; end

#do_prepare_update_window_ui(event) ⇒ void

This method returns an undefined value.

When #update_window_ui runs, it creates instances of UpdateUIEvent.

Those instances may vary depending on the window that the UpdateUIEvent will control. For example, a CheckBox with CHK_3STATE should enable UpdateUIEvent#is3state, but most other windows should not. This function can be overridden to perform the window-specific initializations, such as enabling setting the checkable state.

Parameters:

See Also:



2794
# File 'lib/wx/doc/gen/window.rb', line 2794

def do_prepare_update_window_ui(event) 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

Parameters:



2665
# File 'lib/wx/doc/gen/window.rb', line 2665

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).

Remark:

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.

Parameters:

  • accept (Boolean) —

    If true, the window is eligible for drop file events. If false, the window will not accept drop file events.

See Also:



2447
# File 'lib/wx/doc/gen/window.rb', line 2447

def drag_accept_files(accept) end

#each_child {|child| ... } ⇒ Object #each_child ⇒ Enumerator

Yield each child window to the given block. Returns an Enumerator if no block given.

Overloads:

  • #each_child {|child| ... } ⇒ Object

    Returns last result of block.

    Yield Parameters:

    Returns:

    • (Object) —

      last result of block

  • #each_child ⇒ Enumerator

    Returns enumerator.

    Returns:

    • (Enumerator) —

      enumerator



64
# File 'lib/wx/doc/window.rb', line 64

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.

Parameters:

  • enable (Boolean) (defaults to: true) —

    If true, enables the window for input. If false, disables the window.

Returns:

  • (Boolean)

See Also:



2069
# File 'lib/wx/doc/gen/window.rb', line 2069

def enable(enable=true) end

#enable_focus_from_keyboard ⇒ void

This method returns an undefined value.

Allow giving focus to this window using the keyboard navigation keys.

Some windows don't accept focus from keyboard by default, even though they can be focused by clicking on them. Currently this is the case for single line read-only TextCtrl under MSW, which is consistent with the native applications behaviour, but makes it impossible for the users relying on the keyboard, e.g. because they use a screen reader, to reach them. Calling this function allows pressing TAB to focus such windows too. This function undoes the effect of #disable_focus_from_keyboard and vice versa.



301
# File 'lib/wx/doc/gen/window.rb', line 301

def enable_focus_from_keyboard; end

#enable_input_method(enable = true) ⇒ void

This method returns an undefined value.

Enable or disable input method for this window.

Input method is enabled for all windows by default, but it may be useful to disable it for custom windows which don't accept text input, as otherwise the input method windows may still be shown when the user types in them, even though the text entered in them is ignored. Note that input method can be disabled or enabled at any time, e.g. a custom control could enable it only when its current item is editable. This function is currently implemented for WXMSW, WXGTK and WXOSX. In WXGTK and WXOSX it doesn't affect native controls which always handle input method themselves.

Parameters:

  • enable (Boolean) (defaults to: true)

See Also:



371
# File 'lib/wx/doc/gen/window.rb', line 371

def enable_input_method(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.

Parameters:

Returns:

  • (Boolean)


2619
# File 'lib/wx/doc/gen/window.rb', line 2619

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.

Parameters:

  • enable (Boolean)


345
# File 'lib/wx/doc/gen/window.rb', line 345

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.



648
# File 'lib/wx/doc/gen/window.rb', line 648

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.

Parameters:

  • id (Integer)

Returns:

See Also:



76
# File 'lib/wx/doc/window.rb', line 76

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.

Parameters:

  • label (String)

Returns:

See Also:



84
# File 'lib/wx/doc/window.rb', line 84

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.

Parameters:

  • name (String)

Returns:



91
# File 'lib/wx/doc/window.rb', line 91

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.

See Also:



681
# File 'lib/wx/doc/gen/window.rb', line 681

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.



687
# File 'lib/wx/doc/gen/window.rb', line 687

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.

See Also:



1432
# File 'lib/wx/doc/gen/window.rb', line 1432

def freeze; end

#from_dip(sz) ⇒ Wx::Size #from_dip(pt) ⇒ Wx::Point #from_dip(d) ⇒ Integer

Overloads:

  • #from_dip(sz) ⇒ Wx::Size

    Convert DPI-independent pixel values to the value in pixels appropriate for the current toolkit.

    A DPI-independent pixel is just a pixel at the standard 96 DPI resolution. To keep the same physical size at higher resolution, the physical pixel value must be scaled by #get_dpi_scale_factor but this scaling may be already done by the underlying toolkit (GTK+, Cocoa, ...) automatically. This method performs the conversion only if it is not already done by the lower level toolkit and so by using it with pixel values you can guarantee that the physical size of the corresponding elements will remain the same in all resolutions under all platforms. For example, instead of creating a bitmap of the hard coded size of 32 pixels you should use

      bmp = Wx::Bitmap.new(from_dip(Wx::Size.new(32, 32)))
    

    to avoid using tiny bitmaps on high DPI screens. Notice that this function is only needed when using hard coded pixel values. It is not necessary if the sizes are already based on the DPI-independent units such as dialog units or if you are relying on the controls automatic best size determination and using sizers to lay out them. Also note that if either component of sz has the special value of -1, it is returned unchanged independently of the current DPI, to preserve the special value of -1 in wxWidgets API (it is often used to mean "unspecified").

    Parameters:

    • sz (Array(Integer, Integer), Wx::Size)

    Returns:

  • #from_dip(pt) ⇒ Wx::Point

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    Parameters:

    Returns:

  • #from_dip(d) ⇒ Integer

    Convert DPI-independent distance in pixels to the value in pixels appropriate for the current toolkit.

    This is the same as FromDIP(const Size& sz) overload, but assumes that the resolution is the same in horizontal and vertical directions. If d has the special value of -1, it is returned unchanged independently of the current DPI.

    Parameters:

    • d (Integer)

    Returns:

    • (Integer)


712
# File 'lib/wx/doc/gen/window.rb', line 712

def from_dip(*args) end

#from_phys(sz) ⇒ Wx::Size #from_phys(pt) ⇒ Wx::Point #from_phys(d) ⇒ Integer

Overloads:

  • #from_phys(sz) ⇒ Wx::Size

    Convert from physical pixels to logical pixels.

    All window coordinates in wxWidgets API are always expressed in logical pixels, but the meaning of logical pixels depends on the platform. Physical pixels always mean the same thing and refer to the actual display pixels or, also, sizes of the bitmaps. Under some platforms logical pixels are actually the same as physical ones (this is the case for MSW), but under other platforms (e.g. GTK or macOS) this is not the case and #get_content_scale_factor defines the ratio between one logical and one physical pixel. This function can be used to convert a value in physical pixels to logical pixels independently of the platform used. It simply does nothing under MSW, but divides the input value by the content scale factor under the other platforms. Note that dividing an integer value by scale factor doesn't always yield an integer value. This function rounds the resulting value to the closest integer, e.g. 15 physical pixels are translated to 8, not 7, logical pixels in 200% DPI scaling. This ensures that a physical bitmap of size 15 is not truncated if the result of this function is used to create a window to show it, but it does mean that there will be one extra pixel, not covered by this bitmap, left.

    Parameters:

    • sz (Array(Integer, Integer), Wx::Size)

    Returns:

    See Also:

  • #from_phys(pt) ⇒ Wx::Point

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    Parameters:

    Returns:

  • #from_phys(d) ⇒ Integer

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    Parameters:

    • d (Integer)

    Returns:

    • (Integer)


797
# File 'lib/wx/doc/gen/window.rb', line 797

def from_phys(*args) end

#get_accelerator_table ⇒ Wx::AcceleratorTable Also known as: accelerator_table

Gets the accelerator table for this window, if any.



2364
# File 'lib/wx/doc/gen/window.rb', line 2364

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.

Returns:

  • (Boolean)


2506
# File 'lib/wx/doc/gen/window.rb', line 2506

def get_auto_layout; end

#get_background_colour ⇒ Wx::Colour Also known as: background_colour

Returns the background colour of the window.



1460
# File 'lib/wx/doc/gen/window.rb', line 1460

def get_background_colour; end

#get_background_style ⇒ Wx::BackgroundStyle Also known as: background_style

Returns the background style of the window.



1471
# File 'lib/wx/doc/gen/window.rb', line 1471

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.

Parameters:

  • width (Integer)

Returns:

  • (Integer)

See Also:

  • do_get_best_client_height


872
# File 'lib/wx/doc/gen/window.rb', line 872

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.



863
# File 'lib/wx/doc/gen/window.rb', line 863

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).

Returns:



998
# File 'lib/wx/doc/gen/window.rb', line 998

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.

Parameters:

  • height (Integer)

Returns:

  • (Integer)

See Also:

  • do_get_best_client_width


881
# File 'lib/wx/doc/gen/window.rb', line 881

def get_best_width(height) end

#get_border(flags) ⇒ Wx::Border #get_border ⇒ Wx::Border Also known as: border

Overloads:



2642
# File 'lib/wx/doc/gen/window.rb', line 2642

def get_border(*args) end

#get_caret ⇒ Wx::Caret Also known as: caret

Returns the caret() associated with the window.

Returns:



2521
# File 'lib/wx/doc/gen/window.rb', line 2521

def get_caret; end

#get_char_height ⇒ Integer Also known as: char_height

Returns the character height for this window.

Returns:

  • (Integer)


1476
# File 'lib/wx/doc/gen/window.rb', line 1476

def get_char_height; end

#get_char_width ⇒ Integer Also known as: char_width

Returns the average character width for this window.

Returns:

  • (Integer)


1481
# File 'lib/wx/doc/gen/window.rb', line 1481

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*.

Returns:

  • (Wx::WindowList)


414
# File 'lib/wx/doc/gen/window.rb', line 414

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...).

Returns:



1317
# File 'lib/wx/doc/gen/window.rb', line 1317

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.

Returns:



1322
# File 'lib/wx/doc/gen/window.rb', line 1322

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.

Returns:



886
# File 'lib/wx/doc/gen/window.rb', line 886

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 nil.

Returns:



2451
# File 'lib/wx/doc/gen/window.rb', line 2451

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.

Note:

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.

Returns:

  • (Float)


1012
# File 'lib/wx/doc/gen/window.rb', line 1012

def get_content_scale_factor; end

#get_cursor ⇒ Wx::Cursor Also known as: cursor

Return the cursor associated with this window.



2530
# File 'lib/wx/doc/gen/window.rb', line 2530

def get_cursor; end

#get_cursor_bundle ⇒ Wx::CursorBundle Also known as: cursor_bundle

Returns the cursor bundle associated with this window.

Returns:

See Also:



2538
# File 'lib/wx/doc/gen/window.rb', line 2538

def get_cursor_bundle; 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.



1489
# File 'lib/wx/doc/gen/window.rb', line 1489

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.



1499
# File 'lib/wx/doc/gen/window.rb', line 1499

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.

Returns:

  • (Float)


1023
# File 'lib/wx/doc/gen/window.rb', line 1023

def get_dpi_scale_factor; end

#get_drop_target ⇒ Wx::DropTarget Also known as: drop_target

Returns the associated drop target, which may be nil.

Returns:

See Also:



2424
# File 'lib/wx/doc/gen/window.rb', line 2424

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.



897
# File 'lib/wx/doc/gen/window.rb', line 897

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.



1781
# File 'lib/wx/doc/gen/window.rb', line 1781

def get_event_handler; end

#get_extra_style ⇒ Integer Also known as: extra_style

Returns the extra style bits for the window.

Returns:

  • (Integer)


1885
# File 'lib/wx/doc/gen/window.rb', line 1885

def get_extra_style; end

#get_font ⇒ Wx::Font Also known as: font

Returns the font for this window.

Returns:

See Also:



1507
# File 'lib/wx/doc/gen/window.rb', line 1507

def get_font; end

#get_foreground_colour ⇒ Wx::Colour Also known as: foreground_colour

Returns the foreground colour of the window.

Remark:

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.



1521
# File 'lib/wx/doc/gen/window.rb', line 1521

def get_foreground_colour; end

#get_grand_parent ⇒ Wx::Window Also known as: grand_parent

Returns the grandparent of a window, or nil if there isn't one.

Returns:



426
# File 'lib/wx/doc/gen/window.rb', line 426

def get_grand_parent; end

#get_help_id_at_point(pt) ⇒ Integer Also known as: help_id_at_point

Get the ID to be used for help events generated at the given point.

By default help events use the ID of the window for which they are generated, but in some cases it may be preferable to use an ID for a sub-element of the window instead, e.g. this is used by ToolBar to generate help events with the ID of the tool under the mouse, if any. Similarly, this function may be overridden in other composite controls in the application code.

Parameters:

Returns:

  • (Integer)


2104
# File 'lib/wx/doc/gen/window.rb', line 2104

def get_help_id_at_point(pt) 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.



2114
# File 'lib/wx/doc/gen/window.rb', line 2114

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.

Parameters:

Returns:

  • (String)


2133
# File 'lib/wx/doc/gen/window.rb', line 2133

def get_help_text_at_point(point, origin) end

#get_id ⇒ Integer Also known as: id

Returns the identifier of the window.

Remark:

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.

Returns:

  • (Integer)

See Also:



2266
# File 'lib/wx/doc/gen/window.rb', line 2266

def get_id; end

#get_input_method_cursor_rect ⇒ Wx::Rect Also known as: input_method_cursor_rect

Return the area where the text is being entered.

This is the rectangle last passed to #update_input_method_cursor_rect for this window or an empty rectangle if it hadn't been called for it or if another window has called it since.

Returns:



394
# File 'lib/wx/doc/gen/window.rb', line 394

def get_input_method_cursor_rect; end

#get_label ⇒ String Also known as: label

Generic way of getting a label from any window, for identification purposes.

Remark:

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.

Returns:

  • (String)


2277
# File 'lib/wx/doc/gen/window.rb', line 2277

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.

Returns:



2282
# File 'lib/wx/doc/gen/window.rb', line 2282

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.

Returns:

See Also:



921
# File 'lib/wx/doc/gen/window.rb', line 921

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.

Returns:

  • (Integer)

See Also:



980
# File 'lib/wx/doc/gen/window.rb', line 980

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.



930
# File 'lib/wx/doc/gen/window.rb', line 930

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.

Returns:

  • (Integer)

See Also:



972
# File 'lib/wx/doc/gen/window.rb', line 972

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.

Returns:

See Also:



939
# File 'lib/wx/doc/gen/window.rb', line 939

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.

Returns:

  • (Integer)

See Also:



964
# File 'lib/wx/doc/gen/window.rb', line 964

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.



948
# File 'lib/wx/doc/gen/window.rb', line 948

def get_min_size; end

#get_min_size_from_known_direction(direction, size, availableOtherDir) ⇒ Wx::Size Also known as: min_size_from_known_direction

May be overridden if the control minimal size depends on the layout direction.

This function is called when using sizers for the layout to request minimum controls size once its size in the specified direction is fixed by the layout algorithm and known to be equal to size. It may be useful to override it if the control minimal size varies depending on its size in some direction. For example, controls showing multi-line text may return the size needed to show their text after wrapping the contents to fit the given width when direction is Orientation::HORIZONTAL and size is the available width. The default implementation of this method returns DEFAULT_SIZE (to be precise, it may return #get_effective_min_size if the deprecated #inform_first_direction is overridden and returns true, but this shouldn't be done in the new code).

The minimal size of the window when its size in the given direction is fixed to size or DEFAULT_SIZE if the minimum size doesn't depend on the layout direction and is always the same.

Parameters:

  • direction (Integer) —

    The direction in which the size is fixed, either Orientation::HORIZONTAL or Orientation::VERTICAL.

  • size (Integer) —

    The size in the direction given by the direction parameter, always valid, i.e. positive.

  • availableOtherDir (Integer) —

    The size available in the other direction, may be -1 if the available size is not known.

Returns:

See Also:



912
# File 'lib/wx/doc/gen/window.rb', line 912

def get_min_size_from_known_direction(direction, size, availableOtherDir) 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.

Returns:

  • (Integer)

See Also:



956
# File 'lib/wx/doc/gen/window.rb', line 956

def get_min_width; end

#get_name ⇒ String Also known as: name

Returns the window's name.

Remark:

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.

Returns:

  • (String)

See Also:



2301
# File 'lib/wx/doc/gen/window.rb', line 2301

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 nil if this window is the last child.

Returns:

See Also:



434
# File 'lib/wx/doc/gen/window.rb', line 434

def get_next_sibling; end

#get_parent ⇒ Wx::Window Also known as: parent

Returns the parent of the window, or nil if there is no parent.

Returns:



439
# File 'lib/wx/doc/gen/window.rb', line 439

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: popup_menu_selection_from_user

Overloads:

  • #get_popup_menu_selection_from_user(menu, pos = Wx::DEFAULT_POSITION) ⇒ Integer

    This function shows a popup menu at the given position in this window and returns the selected id.

    It can be more convenient than the general purpose #popup_menu function for simple menus proposing a choice in a list of strings to the user. Notice that to avoid unexpected conflicts between the (usually consecutive range of) ids used by the menu passed to this function and the existing EVT_UPDATE_UI() handlers, this function temporarily disables UI updates for the window, so you need to manually disable (or toggle or ...) any items which should be disabled in the menu before showing it. The parameter menu is the menu to show. The parameter pos (or the parameters x and y) is the position at which to show the menu in client coordinates. It is recommended to not explicitly specify coordinates when calling this method in response to mouse click, because some of the ports (namely, WXGTK) can do a better job of positioning the menu in that case. The selected menu item id or StandardID::ID_NONE if none selected or an error occurred.

    Parameters:

    • menu (Wx::Menu)
    • pos (Array(Integer, Integer), Wx::Point) (defaults to: Wx::DEFAULT_POSITION)

    Returns:

    • (Integer)
  • #get_popup_menu_selection_from_user(menu, x, y) ⇒ Integer

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    Parameters:

    • menu (Wx::Menu)
    • x (Integer)
    • y (Integer)

    Returns:

    • (Integer)


2185
# File 'lib/wx/doc/gen/window.rb', line 2185

def get_popup_menu_selection_from_user(*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.

Returns:

See Also:



1288
# File 'lib/wx/doc/gen/window.rb', line 1288

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 nil if this window is the first child.

Returns:

See Also:



447
# File 'lib/wx/doc/gen/window.rb', line 447

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.

As with #get_position, the rectangle position is relative to the parent window for child windows or relative to the display origin for top level windows.

Returns:

See Also:



1296
# File 'lib/wx/doc/gen/window.rb', line 1296

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.

Returns:

See Also:



1304
# File 'lib/wx/doc/gen/window.rb', line 1304

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.

Returns:

See Also:



1312
# File 'lib/wx/doc/gen/window.rb', line 1312

def get_screen_rect; end

#get_scroll_pos(orientation) ⇒ Integer Also known as: scroll_pos

Returns the built-in scrollbar position.

Parameters:

  • orientation (Integer)

Returns:

  • (Integer)

See Also:



485
# File 'lib/wx/doc/gen/window.rb', line 485

def get_scroll_pos(orientation) end

#get_scroll_range(orientation) ⇒ Integer Also known as: scroll_range

Returns the built-in scrollbar range.

Parameters:

  • orientation (Integer)

Returns:

  • (Integer)

See Also:



494
# File 'lib/wx/doc/gen/window.rb', line 494

def get_scroll_range(orientation) end

#get_scroll_thumb(orientation) ⇒ Integer Also known as: scroll_thumb

Returns the built-in scrollbar thumb size.

Parameters:

  • orientation (Integer)

Returns:

  • (Integer)

See Also:



503
# File 'lib/wx/doc/gen/window.rb', line 503

def get_scroll_thumb(orientation) end

#get_scrollbar_size(orient) ⇒ Integer Also known as: scrollbar_size

Returns the space taken by the scrollbar of the given orientation when it is shown in this window.

For a vertical scrollbar this is its width and for a horizontal one its height, i.e. the amount by which showing the scrollbar reduces the client size of the window in the corresponding direction. This is normally the same as the value of the SystemMetric::SYS_VSCROLL_X or SystemMetric::SYS_HSCROLL_Y system metric, but it is 0 for the windows using overlay scrollbars, which are drawn on top of the window contents and hence don't reduce its client area at all. Because of this, prefer using this function rather than the system metrics directly when computing the size required by a scrollable window. Note that the returned value doesn't depend on whether the scrollbar is currently shown, use #has_scrollbar to check for this.

Parameters:

Returns:

  • (Integer)


527
# File 'lib/wx/doc/gen/window.rb', line 527

def get_scrollbar_size(orient) end

#get_size ⇒ Wx::Size Also known as: size

See the GetSize(int*,int*) overload for more info.

Returns:



985
# File 'lib/wx/doc/gen/window.rb', line 985

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 nil.

Returns:



2456
# File 'lib/wx/doc/gen/window.rb', line 2456

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.

Parameters:

  • string (String)

Returns:



1527
# File 'lib/wx/doc/gen/window.rb', line 1527

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.

Returns:

  • (Boolean)

See Also:



1753
# File 'lib/wx/doc/gen/window.rb', line 1753

def get_theme_enabled; end

#get_tool_tip ⇒ Wx::ToolTip Also known as: tool_tip

Get the associated tooltip or nil if none.

Returns:



2138
# File 'lib/wx/doc/gen/window.rb', line 2138

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.

Returns:

  • (String)


2143
# File 'lib/wx/doc/gen/window.rb', line 2143

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.

Returns:



1541
# File 'lib/wx/doc/gen/window.rb', line 1541

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.

Returns:

See Also:



1536
# File 'lib/wx/doc/gen/window.rb', line 1536

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 nil if there is none.

Returns:



2217
# File 'lib/wx/doc/gen/window.rb', line 2217

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.

Returns:

See Also:



993
# File 'lib/wx/doc/gen/window.rb', line 993

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.

Returns:



1028
# File 'lib/wx/doc/gen/window.rb', line 1028

def get_window_border_size; end

#get_window_style ⇒ Integer Also known as: window_style

See #get_window_style_flag for more info.

Returns:

  • (Integer)


1897
# File 'lib/wx/doc/gen/window.rb', line 1897

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.

Returns:

  • (Integer)


1892
# File 'lib/wx/doc/gen/window.rb', line 1892

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.

Returns:



2306
# File 'lib/wx/doc/gen/window.rb', line 2306

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.

Parameters:

Returns:

  • (Boolean)

See Also:



1790
# File 'lib/wx/doc/gen/window.rb', line 1790

def handle_as_navigation_key(event) end

#handle_window_event(event) ⇒ Boolean

Shorthand for:

  get_event_handler.safely_process_event(event)

Parameters:

Returns:

  • (Boolean)

See Also:



1800
# File 'lib/wx/doc/gen/window.rb', line 1800

def handle_window_event(event) end

#has_capture ⇒ Boolean Also known as: has_capture?

Returns true if this window has the current mouse capture.

Returns:

  • (Boolean)

See Also:



2549
# File 'lib/wx/doc/gen/window.rb', line 2549

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.

Parameters:

  • exFlag (Integer)

Returns:

  • (Boolean)

See Also:



1906
# File 'lib/wx/doc/gen/window.rb', line 1906

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.

Parameters:

  • flag (Integer)

Returns:

  • (Boolean)


1912
# File 'lib/wx/doc/gen/window.rb', line 1912

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.

Returns:

  • (Boolean)

See Also:



325
# File 'lib/wx/doc/gen/window.rb', line 325

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.

Returns:

  • (Boolean)


2671
# File 'lib/wx/doc/gen/window.rb', line 2671

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.

Parameters:

Returns:

  • (Boolean)


517
# File 'lib/wx/doc/gen/window.rb', line 517

def has_scrollbar(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.

Returns:

  • (Boolean)


1548
# File 'lib/wx/doc/gen/window.rb', line 1548

def has_transparent_background; end

#hide ⇒ Boolean

Equivalent to calling #show(false).

Returns:

  • (Boolean)


1987
# File 'lib/wx/doc/gen/window.rb', line 1987

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.

Parameters:

Returns:

  • (Boolean)


1995
# File 'lib/wx/doc/gen/window.rb', line 1995

def hide_with_effect(effect, timeout=0) end

#hit_test(x, y) ⇒ Wx::HitTest #hit_test(pt) ⇒ Wx::HitTest

Overloads:

  • #hit_test(x, y) ⇒ Wx::HitTest

    Return where the given point lies, exactly.

    This method is used to test whether the point lies inside the client window area or on one of its scrollbars. The point coordinates are specified in client window coordinates.

    Parameters:

    • x (Integer)
    • y (Integer)

    Returns:

  • #hit_test(pt) ⇒ Wx::HitTest

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    Parameters:

    Returns:



2633
# File 'lib/wx/doc/gen/window.rb', line 2633

def hit_test(*args) end

#inform_first_direction(direction, size, availableOtherDir) ⇒ Boolean

Compatibility function called by #get_min_size_from_known_direction.

This function shouldn't be used in the new code, please override #get_min_size_from_known_direction instead.

Parameters:

  • direction (Integer)
  • size (Integer)
  • availableOtherDir (Integer)

Returns:

  • (Boolean)


1038
# File 'lib/wx/doc/gen/window.rb', line 1038

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.



2679
# File 'lib/wx/doc/gen/window.rb', line 2679

def inherit_attributes; end

#inherits_background_colour ⇒ Boolean

Return true if this window inherits the background colour from its parent.

Returns:

  • (Boolean)

See Also:



1687
# File 'lib/wx/doc/gen/window.rb', line 1687

def inherits_background_colour; end

#inherits_foreground_colour ⇒ Boolean

Return true if this window inherits the foreground colour from its parent.

Returns:

  • (Boolean)

See Also:



1729
# File 'lib/wx/doc/gen/window.rb', line 1729

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.



2683
# File 'lib/wx/doc/gen/window.rb', line 2683

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.

See Also:



1045
# File 'lib/wx/doc/gen/window.rb', line 1045

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.

Returns:

  • (Boolean)


2415
# File 'lib/wx/doc/gen/window.rb', line 2415

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.

Parameters:

  • win (Wx::Window) —

    Any window, possible nil (false is always returned then).

Returns:

  • (Boolean)


456
# File 'lib/wx/doc/gen/window.rb', line 456

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.

Returns:

  • (Boolean)

See Also:



2690
# File 'lib/wx/doc/gen/window.rb', line 2690

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

Returns:

  • (Boolean)

See Also:



2002
# File 'lib/wx/doc/gen/window.rb', line 2002

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?

Overloads:

  • #is_exposed(x, y) ⇒ Boolean

    Returns true if the given point or rectangle area has been exposed since the last repaint.

    Call this in a paint event handler to optimize redrawing by only redrawing those areas, which have been exposed.

    Parameters:

    • x (Integer)
    • y (Integer)

    Returns:

    • (Boolean)
  • #is_exposed(pt) ⇒ Boolean

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    Parameters:

    Returns:

    • (Boolean)
  • #is_exposed(x, y, w, h) ⇒ Boolean

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    Parameters:

    • x (Integer)
    • y (Integer)
    • w (Integer)
    • h (Integer)

    Returns:

    • (Boolean)
  • #is_exposed(rect) ⇒ Boolean

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    Parameters:

    Returns:

    • (Boolean)


2027
# File 'lib/wx/doc/gen/window.rb', line 2027

def is_exposed(*args) end

#is_focusable ⇒ Boolean Also known as: focusable?

Can this window itself have focus?

Returns:

  • (Boolean)


305
# File 'lib/wx/doc/gen/window.rb', line 305

def is_focusable; end

#is_frozen ⇒ Boolean Also known as: frozen?

Returns true if the window is currently frozen by a call to #freeze.

Returns:

  • (Boolean)

See Also:



1450
# File 'lib/wx/doc/gen/window.rb', line 1450

def is_frozen; end

#is_input_method_enabled ⇒ Boolean Also known as: input_method_enabled?

Return true if input method is enabled for this window.

Note that this function simply returns false if #enable_input_method was called with false argument and doesn't check whether the input method is actually used by the window or not.

Returns:

  • (Boolean)


377
# File 'lib/wx/doc/gen/window.rb', line 377

def is_input_method_enabled; end

#is_retained ⇒ Boolean Also known as: retained?

Returns true if the window is retained, false otherwise.

Remark:

Retained windows are only available on X platforms.

Returns:

  • (Boolean)


2707
# File 'lib/wx/doc/gen/window.rb', line 2707

def is_retained; end

#is_scrollbar_always_shown(orient) ⇒ Boolean Also known as: scrollbar_always_shown?

Return whether a scrollbar is always shown.

Parameters:

Returns:

  • (Boolean)

See Also:



536
# File 'lib/wx/doc/gen/window.rb', line 536

def is_scrollbar_always_shown(orient) end

#is_shown ⇒ Boolean Also known as: shown?

Returns true if the window is shown, false if it has been hidden.

Returns:

  • (Boolean)

See Also:



2035
# File 'lib/wx/doc/gen/window.rb', line 2035

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.

Returns:

  • (Boolean)

See Also:



2043
# File 'lib/wx/doc/gen/window.rb', line 2043

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.

Returns:

  • (Boolean)


2714
# File 'lib/wx/doc/gen/window.rb', line 2714

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).

Returns:

  • (Boolean)


2721
# File 'lib/wx/doc/gen/window.rb', line 2721

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.

Parameters:

  • reason (String) (defaults to: nil) —

    If not nil, a reason message is provided if transparency is not supported.

Returns:

  • (Boolean)


1640
# File 'lib/wx/doc/gen/window.rb', line 1640

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.

Returns:

  • (Boolean)

See Also:



2490
# File 'lib/wx/doc/gen/window.rb', line 2490

def layout; end

#line_down ⇒ Boolean

Same as ScrollLines (1).

Returns:

  • (Boolean)


586
# File 'lib/wx/doc/gen/window.rb', line 586

def line_down; end

#line_up ⇒ Boolean

Same as ScrollLines (-1).

Returns:

  • (Boolean)


582
# File 'lib/wx/doc/gen/window.rb', line 582

def line_up; end

#locked(&block) ⇒ Object

Locks the window from updates while executing the given block.

Parameters:

  • block (Proc)


68
# File 'lib/wx/doc/window.rb', line 68

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.

Remark:

This function only works for TopLevelWindow-derived classes.

See Also:



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

Overloads:

  • #move(x, y, flags = Wx::SIZE_USE_EXISTING) ⇒ void

    This method returns an undefined value.

    Moves the window to the given position.

    Remark:

    Implementations of SetSize can also implicitly implement the #move function, which is defined in the base Wx::Window class as the call: ```ruby set_size(x, y, Wx::DEFAULT_COORD, Wx::DEFAULT_COORD, Wx::SIZE_USE_EXISTING) ```

    Parameters:

    • x (Integer) —

      Required x position.

    • y (Integer) —

      Required y position.

    • flags (Integer) (defaults to: Wx::SIZE_USE_EXISTING) —

      See #set_size for more info about this parameter.

    See Also:

  • #move(pt, flags = Wx::SIZE_USE_EXISTING) ⇒ void

    This method returns an undefined value.

    Moves the window to the given position.

    Remark:

    Implementations of #set_size can also implicitly implement the #move function, which is defined in the base Wx::Window class as the call: ```ruby set_size(x, y, Wx::DEFAULT_COORD, Wx::DEFAULT_COORD, Wx::SIZE_USE_EXISTING) ```

    Parameters:

    • pt (Array(Integer, Integer), Wx::Point) —

      Point object representing the position.

    • flags (Integer) (defaults to: Wx::SIZE_USE_EXISTING) —

      See #set_size for more info about this parameter.

    See Also:



1358
# File 'lib/wx/doc/gen/window.rb', line 1358

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.

Parameters:

  • win (Wx::Window) —

    A sibling of this window which should precede it in tab order, must not be nil



1956
# File 'lib/wx/doc/gen/window.rb', line 1956

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.

Parameters:



1961
# File 'lib/wx/doc/gen/window.rb', line 1961

def move_before_in_tab_order(win) end

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.

Remark:

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.

Parameters:

Returns:

  • (Boolean)


1976
# File 'lib/wx/doc/gen/window.rb', line 1976

def navigate(flags=NavigationKeyEvent::IsForward) end

Performs a keyboard navigation action inside this window.

See #navigate for more information.

Parameters:

  • flags (Integer) (defaults to: NavigationKeyEvent::IsForward)

Returns:

  • (Boolean)


1983
# File 'lib/wx/doc/gen/window.rb', line 1983

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.



2728
# File 'lib/wx/doc/gen/window.rb', line 2728

def on_internal_idle; end

#page_down ⇒ Boolean

Same as ScrollPages (1).

Returns:

  • (Boolean)


594
# File 'lib/wx/doc/gen/window.rb', line 594

def page_down; end

#page_up ⇒ Boolean

Same as ScrollPages (-1).

Returns:

  • (Boolean)


590
# File 'lib/wx/doc/gen/window.rb', line 590

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.

Yield Parameters:

Returns:

  • (::Object) —

    result from block



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.

Yield Parameters:

Returns:

  • (::Object) —

    result from block



55
# File 'lib/wx/doc/window.rb', line 55

def paint_buffered; end

#pop_event_handler(deleteHandler = false) ⇒ Wx::EvtHandler

Removes and returns the top-most event handler on the event handler stack.

E.g. in the case of: when calling W->pop_event_handler, the event handler A will be removed and B will be the first handler of the stack. Note that it's an error to call this function when no event handlers were pushed on this window (i.e. when the window itself is its only event handler).

Parameters:

  • deleteHandler (Boolean) (defaults to: false) —

    If this is true, the handler will be deleted after it is removed (and the returned value will be nil).

Returns:

See Also:

  • Events are Processed


1828
# File 'lib/wx/doc/gen/window.rb', line 1828

def pop_event_handler(deleteHandler=false) end

Overloads:

  • #popup_menu(menu, pos = Wx::DEFAULT_POSITION) ⇒ Boolean

    Pops up the given menu at the specified coordinates, relative to this window, and returns control when the user has dismissed the menu.

    If a menu item is selected, the corresponding menu event is generated and will be processed as usual. If coordinates are not specified, the current mouse cursor position is used. menu is the menu to pop up. The position where the menu will appear can be specified either as a Point pos or by two integers (x and y). Note that this function switches focus to this window before showing the menu.

    Remark:

    Just before the menu is popped up, Menu::UpdateUI is called to ensure that the menu items are in the correct state. The menu does not get deleted by the window. It is recommended to not explicitly specify coordinates when calling PopupMenu in response to mouse click, because some of the ports (namely, WXGTK) can do a better job of positioning the menu in that case.

    Parameters:

    • menu (Wx::Menu)
    • pos (Array(Integer, Integer), Wx::Point) (defaults to: Wx::DEFAULT_POSITION)

    Returns:

    • (Boolean)

    See Also:

  • #popup_menu(menu, x, y) ⇒ Boolean

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    Parameters:

    • menu (Wx::Menu)
    • x (Integer)
    • y (Integer)

    Returns:

    • (Boolean)


2211
# File 'lib/wx/doc/gen/window.rb', line 2211

def popup_menu(*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.



1051
# File 'lib/wx/doc/gen/window.rb', line 1051

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.



1057
# File 'lib/wx/doc/gen/window.rb', line 1057

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.

Parameters:

Returns:

  • (Boolean)


1811
# File 'lib/wx/doc/gen/window.rb', line 1811

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.

Parameters:

Returns:

  • (Boolean)


1818
# File 'lib/wx/doc/gen/window.rb', line 1818

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.

Parameters:

See Also:

  • Events are Processed


1845
# File 'lib/wx/doc/gen/window.rb', line 1845

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.

Remark:

This function only works for TopLevelWindow-derived classes.

See Also:



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.

Parameters:

  • eraseBackground (Boolean) (defaults to: true) —

    If true, the background will be erased too. Note that in non-MSW ports background is always erased.

  • rect (Wx::Rect) (defaults to: nil) —

    If non-null, only the given rectangle will be treated as damaged.

See Also:



1558
# File 'lib/wx/doc/gen/window.rb', line 1558

def refresh(eraseBackground=true, rect=nil) end

#refresh_rect(rect, eraseBackground = true) ⇒ void

This method returns an undefined value.

Redraws the contents of the given rectangle: only the area inside it will be repainted.

This is the same as #refresh but has a nicer syntax as it can be called with a temporary Rect object as argument like this RefreshRect(wxRect(x, y, w, h)).

Parameters:

  • rect (Wx::Rect)
  • eraseBackground (Boolean) (defaults to: true)


1566
# File 'lib/wx/doc/gen/window.rb', line 1566

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.

Remark:

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.

Parameters:

  • hotkeyId (Integer) —

    Numeric identifier of the hotkey. For applications this must be between 0 and 0xBFFF. If this function is called from a shared DLL, it must be a system wide unique identifier between 0xC000 and 0xFFFF. This is a MSW specific detail.

  • modifiers (Integer) —

    A bitwise combination of KeyModifier::MOD_SHIFT, KeyModifier::MOD_CONTROL, KeyModifier::MOD_ALT or KeyModifier::MOD_WIN specifying the modifier keys that have to be pressed along with the key.

  • virtualKeyCode (Integer) —

    The key code of the hotkey, e.g. an ASCII character such as 'K' or one of elements of KeyCode enum.

Returns:

  • (Boolean)

See Also:

Requires:

  • USE_HOTKEY


2748
# File 'lib/wx/doc/gen/window.rb', line 2748

def register_hot_key(hotkeyId, modifiers, virtualKeyCode) end

#release_mouse ⇒ void

This method returns an undefined value.

Releases mouse input captured with #capture_mouse.

See Also:



2561
# File 'lib/wx/doc/gen/window.rb', line 2561

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.

Parameters:



422
# File 'lib/wx/doc/gen/window.rb', line 422

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).

Parameters:

  • handler (Wx::EvtHandler) —

    The event handler to remove, must be non-null and must be present in this windows event handlers stack.

Returns:

  • (Boolean)

See Also:



1856
# File 'lib/wx/doc/gen/window.rb', line 1856

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 (and most likely you want to call #show for the window afterwards).

Parameters:

Returns:

  • (Boolean)


465
# File 'lib/wx/doc/gen/window.rb', line 465

def reparent(newParent) end

#screen_to_client(pt) ⇒ Wx::Point

Converts from screen to client window coordinates.

Parameters:

  • pt (Array(Integer, Integer), Wx::Point) —

    The screen position.

Returns:



1414
# File 'lib/wx/doc/gen/window.rb', line 1414

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.

Remark:

This function is currently only implemented under MSW and TextCtrl under WXGTK (it also works for Scrolled classes under all platforms).

Parameters:

  • lines (Integer)

Returns:

  • (Boolean)

See Also:



551
# File 'lib/wx/doc/gen/window.rb', line 551

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.

Remark:

This function is currently only implemented under MSW and WXGTK.

Parameters:

  • pages (Integer)

Returns:

  • (Boolean)

See Also:



565
# File 'lib/wx/doc/gen/window.rb', line 565

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.

Remark:

Note that you can often use Scrolled instead of using this function directly.

Parameters:

  • dx (Integer) —

    Amount to scroll horizontally.

  • dy (Integer) —

    Amount to scroll vertically.

  • rect (Wx::Rect) (defaults to: nil) —

    Rectangle to scroll, if it is nil, the whole window is scrolled (this is always the case under WXGTK which doesn't support this parameter)



578
# File 'lib/wx/doc/gen/window.rb', line 578

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.

Parameters:

  • flags (Integer) (defaults to: 0) —

    May include SEND_EVENT_POST. Default value is 0.



1065
# File 'lib/wx/doc/gen/window.rb', line 1065

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).

Parameters:

  • flags (Integer) (defaults to: 0) —

    See description of this parameter in #send_size_event documentation.

See Also:



1073
# File 'lib/wx/doc/gen/window.rb', line 1073

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.

Parameters:



2372
# File 'lib/wx/doc/gen/window.rb', line 2372

def set_accelerator_table(accel) end

#set_accessible_name(name) ⇒ void Also known as: accessible_name=

This method returns an undefined value.

Sets the name used by screen readers for this window.

By default, screen readers use the label of the window, if it has one, or, for some controls such as TextCtrl, the text of the label preceding it. This function allows to give a name to the windows without a label, e.g. buttons showing only a bitmap, or to use a different name than the label. Pass an empty string to use the default name again. Currently this function is implemented under MSW, where it requires Setup::USE_ACCESSIBILITY to be enabled, and macOS. Under the other platforms it doesn't do anything.

Parameters:

  • name (String)


2382
# File 'lib/wx/doc/gen/window.rb', line 2382

def set_accessible_name(name) 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.

Parameters:

  • autoLayout (Boolean) —

    Set this to true if you wish the #layout function to be called automatically when the window is resized.

See Also:



2499
# File 'lib/wx/doc/gen/window.rb', line 2499

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.

Remark:

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.

Parameters:

  • colour (Wx::Colour, String, Symbol) —

    The colour to be used as the background colour; pass NULL_COLOUR to reset to the default colour. Note that you may want to use SystemSettings.get_colour to retrieve a suitable colour to use rather than setting a hard-coded one.

Returns:

  • (Boolean)

See Also:



1602
# File 'lib/wx/doc/gen/window.rb', line 1602

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, WXOSX, WXMSW and Qt, 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. Under WXMSW this is supported since 3.3.0. 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


1629
# File 'lib/wx/doc/gen/window.rb', line 1629

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.

Parameters:

  • canFocus (Boolean)

See Also:



336
# File 'lib/wx/doc/gen/window.rb', line 336

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.

Parameters:



2566
# File 'lib/wx/doc/gen/window.rb', line 2566

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=

Overloads:

  • #set_client_size(width, height) ⇒ void

    This method returns an undefined value.

    This sets the size of the window client area in pixels.

    Using this function to size a window tends to be more device-independent than #set_size, since the application need not worry about what dimensions the border or title bar have when trying to fit the window around panel items, for example. Note that special value of -1 which can be used in some other functions to preserve the existing size is not supported for width and height here, i.e. they both must be valid, positive integers.

    Parameters:

    • width (Integer)
    • height (Integer)

    See Also:

  • #set_client_size(size) ⇒ void

    This method returns an undefined value.

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    Parameters:

    • size (Array(Integer, Integer), Wx::Size)
  • #set_client_size(rect) ⇒ void

    This method returns an undefined value.

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    Parameters:



1092
# File 'lib/wx/doc/gen/window.rb', line 1092

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 nil argument when the window is removed from it.

Parameters:



1100
# File 'lib/wx/doc/gen/window.rb', line 1100

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. This function doesn't allow specifying higher resolution versions of the cursor to use on high DPI displays. Use #set_cursor_bundle in order to do this.

Parameters:

  • cursor (Wx::Cursor) —

    Specifies the cursor that the window should normally display.

Returns:

  • (Boolean)

See Also:



2579
# File 'lib/wx/doc/gen/window.rb', line 2579

def set_cursor(cursor) end

#set_cursor_bundle(cursors) ⇒ Boolean Also known as: cursor_bundle=

Sets a collection of cursors to be used by the window.

The window will automatically select the cursor of the appropriate size among those available in cursors and will update it as necessary if the DPI scaling changes.

Parameters:

Returns:

  • (Boolean)


2587
# File 'lib/wx/doc/gen/window.rb', line 2587

def set_cursor_bundle(cursors) 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.

Parameters:

  • on (Boolean)


2696
# File 'lib/wx/doc/gen/window.rb', line 2696

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.

Parameters:

See Also:



2434
# File 'lib/wx/doc/gen/window.rb', line 2434

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.

Parameters:

  • handler (Wx::EvtHandler) —

    Specifies the handler to be set. Cannot be nil.

See Also:

  • Events are Processed


1864
# File 'lib/wx/doc/gen/window.rb', line 1864

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.

Parameters:

  • exStyle (Integer)


1920
# File 'lib/wx/doc/gen/window.rb', line 1920

def set_extra_style(exStyle) end

#set_focus ⇒ void

This method returns an undefined value.

This sets the window to receive keyboard input.



355
# File 'lib/wx/doc/gen/window.rb', line 355

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.



361
# File 'lib/wx/doc/gen/window.rb', line 361

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::SetFont 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.

Parameters:

Returns:

  • (Boolean)

See Also:



1653
# File 'lib/wx/doc/gen/window.rb', line 1653

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.

Parameters:

  • colour (Wx::Colour, String, Symbol) —

    The colour to be used as the foreground colour; pass NULL_COLOUR to reset to the default colour.

Returns:

  • (Boolean)

See Also:



1668
# File 'lib/wx/doc/gen/window.rb', line 1668

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.

Parameters:

  • helpText (String)

See Also:



2124
# File 'lib/wx/doc/gen/window.rb', line 2124

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.

Remark:

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.

Parameters:

  • winid (Integer)

See Also:



2320
# File 'lib/wx/doc/gen/window.rb', line 2320

def set_id(winid) end

#set_initial_size(size = Wx::DEFAULT_SIZE) ⇒ Boolean Also known as: initial_size=

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.) true if the size was changed (the return value is only available in wxWidgets 3.3.4 or later)

Parameters:

  • size (Array(Integer, Integer), Wx::Size) (defaults to: Wx::DEFAULT_SIZE)

Returns:

  • (Boolean)

See Also:



1114
# File 'lib/wx/doc/gen/window.rb', line 1114

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.

Please note that not all windows have labels and this function may do nothing in this case. And some other derived windows use different functions for changing the text shown in them, e.g. TextCtrl uses TextCtrl#set_value or TextCtrl#change_value and trying to use #set_label on it will assert to help to detect possibly erroneous calls to #set_label.

Parameters:

  • label (String) —

    The window label.

See Also:



2329
# File 'lib/wx/doc/gen/window.rb', line 2329

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.

Parameters:



2337
# File 'lib/wx/doc/gen/window.rb', line 2337

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))

Parameters:

  • size (Array(Integer, Integer), Wx::Size)

See Also:



1127
# File 'lib/wx/doc/gen/window.rb', line 1127

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.

Parameters:

  • size (Array(Integer, Integer), Wx::Size)

See Also:



1137
# File 'lib/wx/doc/gen/window.rb', line 1137

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))

Parameters:

  • size (Array(Integer, Integer), Wx::Size)

See Also:



1152
# File 'lib/wx/doc/gen/window.rb', line 1152

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.

Parameters:

  • size (Array(Integer, Integer), Wx::Size)

See Also:



1163
# File 'lib/wx/doc/gen/window.rb', line 1163

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.

Parameters:

  • name (String) —

    A name to set for the window.

See Also:



2346
# File 'lib/wx/doc/gen/window.rb', line 2346

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.

Parameters:



1872
# File 'lib/wx/doc/gen/window.rb', line 1872

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.

Parameters:

See Also:



1678
# File 'lib/wx/doc/gen/window.rb', line 1678

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.

Parameters:

See Also:



1706
# File 'lib/wx/doc/gen/window.rb', line 1706

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.

Parameters:

See Also:



1716
# File 'lib/wx/doc/gen/window.rb', line 1716

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.

Parameters:



1365
# File 'lib/wx/doc/gen/window.rb', line 1365

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.

Parameters:



1880
# File 'lib/wx/doc/gen/window.rb', line 1880

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.

Remark:

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.

Parameters:

  • orientation (Integer) —

    Determines the scrollbar whose position is to be set. May be Orientation::HORIZONTAL or Orientation::VERTICAL.

  • pos (Integer) —

    Position in scroll units.

  • refresh (Boolean) (defaults to: true) —

    true to redraw the scrollbar, false otherwise.

See Also:



612
# File 'lib/wx/doc/gen/window.rb', line 612

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.

Remark:

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.

Parameters:

  • orientation (Integer) —

    Determines the scrollbar whose page size is to be set. May be Orientation::HORIZONTAL or Orientation::VERTICAL.

  • position (Integer) —

    The position of the scrollbar in scroll units.

  • thumbSize (Integer) —

    The size of the thumb, or visible portion of the scrollbar, in scroll units.

  • range (Integer) —

    The maximum position of the scrollbar. Value of -1 can be used to ask for the scrollbar to be shown but in the disabled state: this can be used to avoid removing the scrollbar even when it is not needed (currently this is only implemented in WXMSW port).

  • refresh (Boolean) (defaults to: true) —

    true to redraw the scrollbar, false otherwise.

See Also:



635
# File 'lib/wx/doc/gen/window.rb', line 635

def set_scrollbar(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=

Overloads:

  • #set_size(x, y, width, height, sizeFlags = Wx::SIZE_AUTO) ⇒ void

    This method returns an undefined value.

    Sets the size of the window in pixels.

    Remark:

    This overload sets the position and optionally size, of the window. Parameters may be DEFAULT_COORD to indicate either that a default should be supplied by wxWidgets, or that the current value of the dimension should be used.

    Parameters:

    • x (Integer) —

      Required x position in pixels, or DEFAULT_COORD to indicate that the existing value should be used.

    • y (Integer) —

      Required y position in pixels, or DEFAULT_COORD to indicate that the existing value should be used.

    • width (Integer) —

      Required width in pixels, or DEFAULT_COORD to indicate that the existing value should be used.

    • height (Integer) —

      Required height position in pixels, or DEFAULT_COORD to indicate that the existing value should be used.

    • sizeFlags (Integer) (defaults to: Wx::SIZE_AUTO) —

      Indicates the interpretation of other parameters. It is a bit list of the following:

      • SIZE_AUTO_WIDTH: a DEFAULT_COORD width value is taken to indicate a wxWidgets-supplied default width.
      • SIZE_AUTO_HEIGHT: a DEFAULT_COORD height value is taken to indicate a wxWidgets-supplied default height.
      • SIZE_AUTO: DEFAULT_COORD size values are taken to indicate a wxWidgets-supplied default size.
      • SIZE_USE_EXISTING: existing dimensions should be used if DEFAULT_COORD values are supplied.
      • SIZE_ALLOW_MINUS_ONE: allow negative dimensions (i.e. value of DEFAULT_COORD) to be interpreted as real dimensions, not default values.
      • SIZE_FORCE: normally, if the position and the size of the window are already the same as the parameters of this function, nothing is done. but with this flag a window resize may be forced even in this case (supported in wx 2.6.2 and later and only implemented for MSW and ignored elsewhere currently).

    See Also:

  • #set_size(rect) ⇒ void

    This method returns an undefined value.

    Sets the size of the window in pixels.

    The size is specified using a Rect, Size or by a couple of int objects.

    Remark:

    This form must be used with non-default width and height values.

    Parameters:

    See Also:

  • #set_size(size) ⇒ void

    This method returns an undefined value.

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    Parameters:

    • size (Array(Integer, Integer), Wx::Size)


1207
# File 'lib/wx/doc/gen/window.rb', line 1207

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=

Overloads:

  • #set_size_hints(minSize, maxSize = Wx::DEFAULT_SIZE, incSize = Wx::DEFAULT_SIZE) ⇒ void

    This method returns an undefined value.

    Use of this function for windows which are not toplevel windows (such as Dialog or Frame) is discouraged.

    Please use #set_min_size and #set_max_size instead.

    Parameters:

    • minSize (Array(Integer, Integer), Wx::Size)
    • maxSize (Array(Integer, Integer), Wx::Size) (defaults to: Wx::DEFAULT_SIZE)
    • incSize (Array(Integer, Integer), Wx::Size) (defaults to: Wx::DEFAULT_SIZE)

    See Also:

  • #set_size_hints(minW, minH, maxW = -1, maxH = -1, incW = -1, incH = -1) ⇒ void

    This method returns an undefined value.

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    Parameters:

    • minW (Integer)
    • minH (Integer)
    • maxW (Integer) (defaults to: -1)
    • maxH (Integer) (defaults to: -1)
    • incW (Integer) (defaults to: -1)
    • incH (Integer) (defaults to: -1)


1229
# File 'lib/wx/doc/gen/window.rb', line 1229

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.

Remark:

SetSizer enables and disables Layout automatically.

Parameters:

  • sizer (Wx::Sizer) —

    The sizer to set. Pass nil to disassociate and conditionally delete the window's sizer. See below.



2471
# File 'lib/wx/doc/gen/window.rb', line 2471

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).

Parameters:



2479
# File 'lib/wx/doc/gen/window.rb', line 2479

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.

Parameters:

  • enable (Boolean)

See Also:



1745
# File 'lib/wx/doc/gen/window.rb', line 1745

def set_theme_enabled(enable) end

#set_tool_tip(tipString) ⇒ void #set_tool_tip(tip) ⇒ void Also known as: tool_tip=

Overloads:

  • #set_tool_tip(tipString) ⇒ void

    This method returns an undefined value.

    Attach a tooltip to the window.

    ToolTip pointer can be nil in the overload taking the pointer, meaning to unset any existing tooltips; however #unset_tool_tip provides a more readable alternative to this operation. Notice that these methods are always available, even if wxWidgets was compiled with Setup::USE_TOOLTIPS set to 0, but don't do anything in this case.

    Parameters:

    • tipString (String)

    See Also:

  • #set_tool_tip(tip) ⇒ void

    This method returns an undefined value.

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    Parameters:



2159
# File 'lib/wx/doc/gen/window.rb', line 2159

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.

Parameters:

  • alpha (Integer)

Returns:

  • (Boolean)


1769
# File 'lib/wx/doc/gen/window.rb', line 1769

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.

Parameters:



2223
# File 'lib/wx/doc/gen/window.rb', line 2223

def set_validator(validator) end

#set_virtual_size(width, height) ⇒ void #set_virtual_size(size) ⇒ void Also known as: virtual_size=

Overloads:

  • #set_virtual_size(width, height) ⇒ void

    This method returns an undefined value.

    Sets the virtual size of the window in pixels.

    Parameters:

    • width (Integer)
    • height (Integer)

    See Also:

  • #set_virtual_size(size) ⇒ void

    This method returns an undefined value.

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    Parameters:

    • size (Array(Integer, Integer), Wx::Size)


1244
# File 'lib/wx/doc/gen/window.rb', line 1244

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.

Parameters:

  • style (Integer)


1936
# File 'lib/wx/doc/gen/window.rb', line 1936

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.

Parameters:

  • style (Integer)

See Also:



1930
# File 'lib/wx/doc/gen/window.rb', line 1930

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.

Parameters:



2355
# File 'lib/wx/doc/gen/window.rb', line 2355

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.

Returns:

  • (Boolean)


1736
# File 'lib/wx/doc/gen/window.rb', line 1736

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.

Parameters:

  • show (Boolean) (defaults to: true) —

    If true displays the window. Otherwise, hides it.

Returns:

  • (Boolean)

See Also:



2083
# File 'lib/wx/doc/gen/window.rb', line 2083

def show(show=true) end

#show_with_effect(effect, timeout = 0) ⇒ Boolean

This function shows a window, like #show, but using a special visual effect if possible.

Note:

Currently this function is only implemented in WXMSW and WXOSX and does the same thing as #show in the other ports.

Parameters:

  • effect (Wx::ShowEffect) —

    The effect to use.

  • timeout (Integer) (defaults to: 0) —

    The timeout parameter specifies the time of the animation, in milliseconds. If the default value of 0 is used, the default animation time for the current platform is used.

Returns:

  • (Boolean)

See Also:



2096
# File 'lib/wx/doc/gen/window.rb', line 2096

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.

Parameters:

  • new_sizer (Wx::Sizer) —

    new sizer for window

Returns:



96
# File 'lib/wx/doc/window.rb', line 96

def switch_sizer(new_sizer) end

#thaw ⇒ void

This method returns an undefined value.

Re-enables window updating after a previous call to #freeze.

To really thaw the control, it must be called exactly the same number of times as #freeze. If the window has any children, they are recursively thawed too.

See Also:



1442
# File 'lib/wx/doc/gen/window.rb', line 1442

def thaw; end

#to_dip(sz) ⇒ Wx::Size #to_dip(pt) ⇒ Wx::Point #to_dip(d) ⇒ Integer

Overloads:

  • #to_dip(sz) ⇒ Wx::Size

    Convert pixel values of the current toolkit to DPI-independent pixel values.

    A DPI-independent pixel is just a pixel at the standard 96 DPI resolution. To keep the same physical size at higher resolution, the physical pixel value must be scaled by #get_dpi_scale_factor but this scaling may be already done by the underlying toolkit (GTK+, Cocoa, ...) automatically. This method performs the conversion only if it is not already done by the lower level toolkit, For example, you may want to use this to store window sizes and positions so that they can be re-used regardless of the display DPI:

      pt = Wx::Point.new(to_dip(get_position))
      size = Wx::Size.new(to_dip(get_size))
    

    Also note that if either component of sz has the special value of -1, it is returned unchanged independently of the current DPI, to preserve the special value of -1 in wxWidgets API (it is often used to mean "unspecified").

    Parameters:

    • sz (Array(Integer, Integer), Wx::Size)

    Returns:

  • #to_dip(pt) ⇒ Wx::Point

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    Parameters:

    Returns:

  • #to_dip(d) ⇒ Integer

    Convert pixel values of the current toolkit to DPI-independent pixel values.

    This is the same as ToDIP(const Size& sz) overload, but assumes that the resolution is the same in horizontal and vertical directions. If d has the special value of -1, it is returned unchanged independently of the current DPI.

    Parameters:

    • d (Integer)

    Returns:

    • (Integer)


757
# File 'lib/wx/doc/gen/window.rb', line 757

def to_dip(*args) end

#to_phys(sz) ⇒ Wx::Size #to_phys(pt) ⇒ Wx::Point #to_phys(d) ⇒ Integer

Overloads:

  • #to_phys(sz) ⇒ Wx::Size

    Convert from logical pixels to physical pixels.

    This function performs the transformation in the converse direction compared to from_phys.

    Parameters:

    • sz (Array(Integer, Integer), Wx::Size)

    Returns:

  • #to_phys(pt) ⇒ Wx::Point

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    Parameters:

    Returns:

  • #to_phys(d) ⇒ Integer

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    Parameters:

    • d (Integer)

    Returns:

    • (Integer)


833
# File 'lib/wx/doc/gen/window.rb', line 833

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.

Parameters:

  • flag (Integer)

Returns:

  • (Boolean)

See Also:



1948
# File 'lib/wx/doc/gen/window.rb', line 1948

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.

Returns:

  • (Boolean)

See Also:



2234
# File 'lib/wx/doc/gen/window.rb', line 2234

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.

Returns:

  • (Boolean)

See Also:



2244
# File 'lib/wx/doc/gen/window.rb', line 2244

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.

Remark:

This function is currently only implemented under MSW.

Parameters:

  • hotkeyId (Integer) —

    Numeric identifier of the hotkey. Must be the same id that was passed to #register_hot_key.

Returns:

  • (Boolean)

See Also:

Requires:

  • USE_HOTKEY


2763
# File 'lib/wx/doc/gen/window.rb', line 2763

def unregister_hot_key(hotkeyId) end

#unset_tool_tip ⇒ void

This method returns an undefined value.

Unset any existing tooltip.

See Also:



2167
# File 'lib/wx/doc/gen/window.rb', line 2167

def unset_tool_tip; end

#update ⇒ void

This method returns an undefined value.

Immediately repaints the invalidated area of the window and all of its children recursively.

Note:

This function is not guaranteed to be implemented in all ports, notably it doesn't do anything in WXGTK port when using Wayland.

Normally, windows are only repainted when a EVT_PAINT is generated, which can't happen before the flow of control returns to the event loop. This doesn't create any problems in well-written applications that don't spend too much time in their event handlers. However, if some event handler performs a long-running operation, this function may be used to make the changes appear on the screen immediately, before waiting for its completion. Please note that it is not recommended to do this and the preferred way to ensure that the UI is updated is to perform all time consuming operations in background threads and avoid blocking the main thread. 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.



1579
# File 'lib/wx/doc/gen/window.rb', line 1579

def update; end

#update_input_method_cursor_rect(rect) ⇒ void

This method returns an undefined value.

Set the area where the text is being entered.

Custom windows accepting text input should call this function to let the input method know where to show its windows, e.g. the one with the text being composed or the list of candidates for it. For a custom text control, rect would be the rectangle corresponding to the current insertion point position. This function must be called whenever this rectangle changes, e.g. when the insertion point moves or the window is scrolled. Note that it is not sufficient to update the rectangle when a key is pressed because some input methods, e.g. Fcitx under Linux, process the keys before the window receives them. This function is currently implemented for WXMSW, WXGTK and WXOSX.

Parameters:

  • rect (Wx::Rect) —

    The rectangle in client coordinates or an empty rectangle to let the input method use its default position.

See Also:



388
# File 'lib/wx/doc/gen/window.rb', line 388

def update_input_method_cursor_rect(rect) 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

Parameters:

  • flags (Integer) (defaults to: Wx::UpdateUI::UPDATE_UI_NONE)

See Also:



2785
# File 'lib/wx/doc/gen/window.rb', line 2785

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

Returns:

  • (Boolean)


1697
# File 'lib/wx/doc/gen/window.rb', line 1697

def use_background_colour; end

#use_bg_col ⇒ Boolean

Return true if a background colour has been set for this window.

Returns:

  • (Boolean)


1691
# File 'lib/wx/doc/gen/window.rb', line 1691

def use_bg_col; end

#use_foreground_colour ⇒ Boolean

Return true if a foreground colour has been set for this window.

Returns:

  • (Boolean)


1721
# File 'lib/wx/doc/gen/window.rb', line 1721

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.



2254
# File 'lib/wx/doc/gen/window.rb', line 2254

def validate; end

#warp_pointer(x, y) ⇒ void

This method returns an undefined value.

Moves the pointer to the given position on the window.

Note:

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).

Note:

This function only works when using WXGTK with Wayland if the compositor implements the "pointer warp" protocol. In addition, its implementation is subject to the limitations imposed by the compositor, e.g. mutter (the Wayland compositor used by GNOME) requires a mouse button to be pressed when this function is called and doesn't move the pointer otherwise.

Parameters:

  • x (Integer) —

    The new x position for the cursor.

  • y (Integer) —

    The new y position for the cursor.



2606
# File 'lib/wx/doc/gen/window.rb', line 2606

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.

Parameters:

  • size (Array(Integer, Integer), Wx::Size)

Returns:

See Also:



673
# File 'lib/wx/doc/gen/window.rb', line 673

def window_to_client_size(size) end