# :stopdoc: # This file is automatically generated by the WXRuby3 documentation # generator. Do not alter this file. # :startdoc: module Wx # This class is used for idle events, which are generated when the system becomes idle. # # Note that, unless you do something specifically, the idle events are not sent if the system remains idle once it has become it, e.g. only a single idle event will be generated until something else resulting in more normal events happens and only then is the next idle event sent again. # If you need to ensure a continuous stream of idle events, you can either use {Wx::IdleEvent#request_more} method in your handler or call {wake_up_idle} periodically (for example from a timer event handler), but note that both of these approaches (and especially the first one) increase the system load and so should be avoided if possible. # By default, idle events are sent to all windows, including even the hidden ones because they may be shown if some condition is met from their {Wx::EVT_IDLE} (or related {Wx::EVT_UPDATE_UI}) handler. The children of hidden windows do not receive idle events however as they can't change their state in any way noticeable by the user. Finally, the global {Wx::App} object also receives these events, as usual, so it can be used for any global idle time processing. # If sending idle events to all windows is causing a significant overhead in your application, you can call {Wx::IdleEvent.set_mode} with the value {Wx::IdleMode::IDLE_PROCESS_SPECIFIED}, and set the {Wx::WS_EX_PROCESS_IDLE} extra window style for every window which should receive idle events, all the other ones will not receive them in this case. # ### Events using this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::IdleEvent} events. # Event handler methods: # # - {Wx::EvtHandler#evt_idle}(meth = nil, &block): Process a {Wx::EVT_IDLE} event. # # Category: {Wx::Events} # # ## Delayed Action Mechanism # # {Wx::IdleEvent} can be used to perform some action "at slightly later time". This can be necessary in several circumstances when, for whatever reason, something can't be done in the current event handler. For example, if a mouse event handler is called with the mouse button pressed, the mouse can be currently captured and some operations with it notably capturing it again might be impossible or lead to undesirable results. If you still want to capture it, you can do it from {Wx::EVT_IDLE} handler when it is called the next time instead of doing it immediately. # This can be achieved in two different ways: when using static event tables, you will need a flag indicating to the (always connected) idle event handler whether the desired action should be performed. The originally called handler would then set it to indicate that it should indeed be done and the idle handler itself would reset it to prevent it from doing the same action again. # Using dynamically connected event handlers things are even simpler as the original event handler can simply {Wx::EvtHandler#connect} or {Wx::EvtHandler#bind} the idle event handler which would only be executed then and could {Wx::EvtHandler#disconnect} or {Wx::EvtHandler#unbind} itself. # @see Events and Event Handling # @see Wx::UpdateUIEvent # @see Wx::Window#on_internal_idle # # class IdleEvent < Event # Constructor. # @return [Wx::IdleEvent] def initialize; end # Returns true if the OnIdle function processing this event requested more processing time. # # # @see Wx::IdleEvent#request_more # @return [Boolean] def more_requested; end # Tells wxWidgets that more processing is required. # # This function can be called by an OnIdle handler for a window or window event handler to indicate that {Wx::App::OnIdle} should forward the OnIdle event once more to the application windows. # If no window calls this function during OnIdle, then the application will remain in a passive event loop (not calling OnIdle) until a new event is posted to the application by the windowing system. # @see Wx::IdleEvent#more_requested # @param needMore [Boolean] # @return [void] def request_more(needMore=true) end # Static function returning a value specifying how wxWidgets will send idle events: to all windows, or only to those which specify that they will process the events. # # # @see Wx::IdleEvent.set_mode. # @return [Wx::IdleMode] def self.get_mode; end # Static function for specifying how wxWidgets will send idle events: to all windows, or only to those which specify that they will process the events. # @param mode [Wx::IdleMode] Can be one of the {Wx::IdleMode} values. The default is {Wx::IdleMode::IDLE_PROCESS_ALL}. # @return [void] def self.set_mode(mode) end end # IdleEvent # This class is not used by the event handlers by itself, but is a base class for other event classes (such as {Wx::BookCtrlEvent}). # # It (or an object of a derived class) is sent when the controls state is being changed and allows the program to {Wx::NotifyEvent#veto} this change if it wants to prevent it from happening. # # Category: {Wx::Events} # @see Wx::BookCtrlEvent # # class NotifyEvent < CommandEvent # Constructor (used internally by wxWidgets only). # @param eventType [Wx::Notebook::EventType] # @param id [Integer] # @return [Wx::NotifyEvent] def initialize(eventType=Wx::EVT_NULL, id=0) end # This is the opposite of {Wx::NotifyEvent#veto}: it explicitly allows the event to be processed. # # For most events it is not necessary to call this method as the events are allowed anyhow but some are forbidden by default (this will be mentioned in the corresponding event description). # @return [void] def allow; end # Returns true if the change is allowed ({Wx::NotifyEvent#veto} hasn't been called) or false otherwise (if it was). # @return [Boolean] def is_allowed; end alias_method :allowed?, :is_allowed # Prevents the change announced by this event from happening. # # It is in general a good idea to notify the user about the reasons for vetoing the change because otherwise the applications behaviour (which just refuses to do what the user wants) might be quite surprising. # @return [void] def veto; end end # NotifyEvent # A scroll event holds information about events sent from stand-alone scrollbars (see {Wx::ScrollBar}) and sliders (see {Wx::Slider}). # # Note that scrolled windows send the {Wx::ScrollWinEvent} which does not derive from {Wx::CommandEvent}, but from {Wx::Event} directly - don't confuse these two kinds of events and use the event table macros mentioned below only for the scrollbar-like controls. # # ## The difference between EVT_SCROLL_THUMBRELEASE and EVT_SCROLL_CHANGED # # The EVT_SCROLL_THUMBRELEASE event is only emitted when actually dragging the thumb using the mouse and releasing it (This EVT_SCROLL_THUMBRELEASE event is also followed by an EVT_SCROLL_CHANGED event). # The EVT_SCROLL_CHANGED event also occurs when using the keyboard to change the thumb position, and when clicking next to the thumb (In all these cases the EVT_SCROLL_THUMBRELEASE event does not happen). # In short, the EVT_SCROLL_CHANGED event is triggered when scrolling/ moving has finished independently of the way it had started. Please see the Widgets Sample ("Slider" page) to see the difference between EVT_SCROLL_THUMBRELEASE and EVT_SCROLL_CHANGED in action. # #
# Remark: #

Note that unless specifying a scroll control identifier, you will need to test for scrollbar orientation with {Wx::ScrollEvent#get_orientation}, since horizontal and vertical scroll events are processed using the same event handler. #

#
# # ### Events using this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::ScrollEvent} events. # Event handler methods: except for this, the macros behave exactly the same. # # - {Wx::EvtHandler#evt_scroll}(meth = nil, &block): Process all scroll events. # # - {Wx::EvtHandler#evt_scroll_top}(meth = nil, &block): Process {Wx::EVT_SCROLL_TOP} scroll-to-top events (minimum position). # # - {Wx::EvtHandler#evt_scroll_bottom}(meth = nil, &block): Process {Wx::EVT_SCROLL_BOTTOM} scroll-to-bottom events (maximum position). # # - {Wx::EvtHandler#evt_scroll_lineup}(meth = nil, &block): Process {Wx::EVT_SCROLL_LINEUP} line up events. # # - {Wx::EvtHandler#evt_scroll_linedown}(meth = nil, &block): Process {Wx::EVT_SCROLL_LINEDOWN} line down events. # # - {Wx::EvtHandler#evt_scroll_pageup}(meth = nil, &block): Process {Wx::EVT_SCROLL_PAGEUP} page up events. # # - {Wx::EvtHandler#evt_scroll_pagedown}(meth = nil, &block): Process {Wx::EVT_SCROLL_PAGEDOWN} page down events. # # - {Wx::EvtHandler#evt_scroll_thumbtrack}(meth = nil, &block): Process {Wx::EVT_SCROLL_THUMBTRACK} thumbtrack events (frequent events sent as the user drags the thumbtrack). # # - {Wx::EvtHandler#evt_scroll_thumbrelease}(meth = nil, &block): Process {Wx::EVT_SCROLL_THUMBRELEASE} thumb release events. # # - {Wx::EvtHandler#evt_scroll_changed}(meth = nil, &block): Process {Wx::EVT_SCROLL_CHANGED} end of scrolling events (MSW only). # # - {Wx::EvtHandler#evt_command_scroll}(id, meth = nil, &block): Process all scroll events. # # - {Wx::EvtHandler#evt_command_scroll_top}(id, meth = nil, &block): Process {Wx::EVT_SCROLL_TOP} scroll-to-top events (minimum position). # # - {Wx::EvtHandler#evt_command_scroll_bottom}(id, meth = nil, &block): Process {Wx::EVT_SCROLL_BOTTOM} scroll-to-bottom events (maximum position). # # - {Wx::EvtHandler#evt_command_scroll_lineup}(id, meth = nil, &block): Process {Wx::EVT_SCROLL_LINEUP} line up events. # # - {Wx::EvtHandler#evt_command_scroll_linedown}(id, meth = nil, &block): Process {Wx::EVT_SCROLL_LINEDOWN} line down events. # # - {Wx::EvtHandler#evt_command_scroll_pageup}(id, meth = nil, &block): Process {Wx::EVT_SCROLL_PAGEUP} page up events. # # - {Wx::EvtHandler#evt_command_scroll_pagedown}(id, meth = nil, &block): Process {Wx::EVT_SCROLL_PAGEDOWN} page down events. # # - {Wx::EvtHandler#evt_command_scroll_thumbtrack}(id, meth = nil, &block): Process {Wx::EVT_SCROLL_THUMBTRACK} thumbtrack events (frequent events sent as the user drags the thumbtrack). # # - {Wx::EvtHandler#evt_command_scroll_thumbrelease}(meth = nil, &block): Process {Wx::EVT_SCROLL_THUMBRELEASE} thumb release events. # # - {Wx::EvtHandler#evt_command_scroll_changed}(meth = nil, &block): Process {Wx::EVT_SCROLL_CHANGED} end of scrolling events (MSW only). # # Category: {Wx::Events} # @see Wx::ScrollBar # @see Wx::Slider # @see Wx::SpinButton # @see Wx::ScrollWinEvent # @see Events and Event Handling # # class ScrollEvent < CommandEvent # Constructor. # @param commandType [Wx::Notebook::EventType] # @param id [Integer] # @param pos [Integer] # @param orientation [Integer] # @return [Wx::ScrollEvent] def initialize(commandType=Wx::EVT_NULL, id=0, pos=0, orientation=0) end # Returns {Wx::Orientation::HORIZONTAL} or {Wx::Orientation::VERTICAL}, depending on the orientation of the scrollbar. # @return [Integer] def get_orientation; end alias_method :orientation, :get_orientation # Returns the position of the scrollbar. # @return [Integer] def get_position; end alias_method :position, :get_position # @param orient [Integer] # @return [void] def set_orientation(orient) end alias_method :orientation=, :set_orientation # @param pos [Integer] # @return [void] def set_position(pos) end alias_method :position=, :set_position end # ScrollEvent # A scroll event holds information about events sent from scrolling windows. # # Note that you can use the EVT_SCROLLWIN* macros for intercepting scroll window events from the receiving window. # ### Events using this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::ScrollWinEvent} events. # Event handler methods: # # - {Wx::EvtHandler#evt_scrollwin}(meth = nil, &block): Process all scroll events. # # - {Wx::EvtHandler#evt_scrollwin_top}(meth = nil, &block): Process {Wx::EVT_SCROLLWIN_TOP} scroll-to-top events. # # - {Wx::EvtHandler#evt_scrollwin_bottom}(meth = nil, &block): Process {Wx::EVT_SCROLLWIN_BOTTOM} scroll-to-bottom events. # # - {Wx::EvtHandler#evt_scrollwin_lineup}(meth = nil, &block): Process {Wx::EVT_SCROLLWIN_LINEUP} line up events. # # - {Wx::EvtHandler#evt_scrollwin_linedown}(meth = nil, &block): Process {Wx::EVT_SCROLLWIN_LINEDOWN} line down events. # # - {Wx::EvtHandler#evt_scrollwin_pageup}(meth = nil, &block): Process {Wx::EVT_SCROLLWIN_PAGEUP} page up events. # # - {Wx::EvtHandler#evt_scrollwin_pagedown}(meth = nil, &block): Process {Wx::EVT_SCROLLWIN_PAGEDOWN} page down events. # # - {Wx::EvtHandler#evt_scrollwin_thumbtrack}(meth = nil, &block): Process {Wx::EVT_SCROLLWIN_THUMBTRACK} thumbtrack events (frequent events sent as the user drags the thumbtrack). # # - {Wx::EvtHandler#evt_scrollwin_thumbrelease}(meth = nil, &block): Process {Wx::EVT_SCROLLWIN_THUMBRELEASE} thumb release events. # # Category: {Wx::Events} # @see Wx::ScrollEvent # @see Events and Event Handling # # class ScrollWinEvent < Event # Constructor. # @param commandType [Wx::Notebook::EventType] # @param pos [Integer] # @param orientation [Integer] # @return [Wx::ScrollWinEvent] def initialize(commandType=Wx::EVT_NULL, pos=0, orientation=0) end # Returns {Wx::Orientation::HORIZONTAL} or {Wx::Orientation::VERTICAL}, depending on the orientation of the scrollbar. # # Todo{Wx::Orientation::HORIZONTAL} and {Wx::Orientation::VERTICAL} should go in their own enum # @return [Integer] def get_orientation; end alias_method :orientation, :get_orientation # Returns the position of the scrollbar for the thumb track and release events. # # Note that this field can't be used for the other events, you need to query the window itself for the current position in that case. # @return [Integer] def get_position; end alias_method :position, :get_position # @param orient [Integer] # @return [void] def set_orientation(orient) end alias_method :orientation=, :set_orientation # @param pos [Integer] # @return [void] def set_position(pos) end alias_method :position=, :set_position end # ScrollWinEvent # This event class contains information about the events generated by the mouse: they include mouse buttons press and release events and mouse move events. # # All mouse events involving the buttons use {Wx::MouseButton::MOUSE_BTN_LEFT} for the left mouse button, {Wx::MouseButton::MOUSE_BTN_MIDDLE} for the middle one and {Wx::MouseButton::MOUSE_BTN_RIGHT} for the right one. And if the system supports more buttons, the {Wx::MouseButton::MOUSE_BTN_AUX1} and {Wx::MouseButton::MOUSE_BTN_AUX2} events can also be generated. Note that not all mice have even a middle button so a portable application should avoid relying on the events from it (but the right button click can be emulated using the left mouse button with the control key under Mac platforms with a single button mouse). # For the {Wx::EVT_ENTER_WINDOW} and {Wx::EVT_LEAVE_WINDOW} events purposes, the mouse is considered to be inside the window if it is in the window client area and not inside one of its children. In other words, the parent window receives {Wx::EVT_LEAVE_WINDOW} event not only when the mouse leaves the window entirely but also when it enters one of its children. # The position associated with a mouse event is expressed in the window coordinates of the window which generated the event, you can use {Wx::Window#client_to_screen} to convert it to screen coordinates and possibly call {Wx::Window#screen_to_client} next to convert it to window coordinates of another window. # #
# Note: #

Note the difference between methods like {Wx::MouseEvent#left_down} and the inherited {Wx::MouseState#left_is_down}: the former returns true when the event corresponds to the left mouse button click while the latter returns true if the left mouse button is currently being pressed. For example, when the user is dragging the mouse you can use {Wx::MouseEvent::LeftIsDown} to test whether the left mouse button is (still) depressed. Also, by convention, if {Wx::MouseEvent#left_down} returns true, {Wx::MouseEvent::LeftIsDown} will also return true in wxWidgets whatever the underlying GUI behaviour is (which is platform-dependent). The same applies, of course, to other mouse buttons as well. #

#
# # ### Events using this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::MouseEvent} events. # Event handler methods: # # - {Wx::EvtHandler#evt_left_down}(meth = nil, &block): Process a {Wx::EVT_LEFT_DOWN} event. The handler of this event should normally call event.Skip() to allow the default processing to take place as otherwise the window under mouse wouldn't get the focus. # # - {Wx::EvtHandler#evt_left_up}(meth = nil, &block): Process a {Wx::EVT_LEFT_UP} event. # # - {Wx::EvtHandler#evt_left_dclick}(meth = nil, &block): Process a {Wx::EVT_LEFT_DCLICK} event. # # - {Wx::EvtHandler#evt_middle_down}(meth = nil, &block): Process a {Wx::EVT_MIDDLE_DOWN} event. # # - {Wx::EvtHandler#evt_middle_up}(meth = nil, &block): Process a {Wx::EVT_MIDDLE_UP} event. # # - {Wx::EvtHandler#evt_middle_dclick}(meth = nil, &block): Process a {Wx::EVT_MIDDLE_DCLICK} event. # # - {Wx::EvtHandler#evt_right_down}(meth = nil, &block): Process a {Wx::EVT_RIGHT_DOWN} event. # # - {Wx::EvtHandler#evt_right_up}(meth = nil, &block): Process a {Wx::EVT_RIGHT_UP} event. # # - {Wx::EvtHandler#evt_right_dclick}(meth = nil, &block): Process a {Wx::EVT_RIGHT_DCLICK} event. # # - EVT_MOUSE_AUX1_DOWN(func): Process a {Wx::EVT_AUX1_DOWN} event. # # - EVT_MOUSE_AUX1_UP(func): Process a {Wx::EVT_AUX1_UP} event. # # - EVT_MOUSE_AUX1_DCLICK(func): Process a {Wx::EVT_AUX1_DCLICK} event. # # - EVT_MOUSE_AUX2_DOWN(func): Process a {Wx::EVT_AUX2_DOWN} event. # # - EVT_MOUSE_AUX2_UP(func): Process a {Wx::EVT_AUX2_UP} event. # # - EVT_MOUSE_AUX2_DCLICK(func): Process a {Wx::EVT_AUX2_DCLICK} event. # # - {Wx::EvtHandler#evt_motion}(meth = nil, &block): Process a {Wx::EVT_MOTION} event. # # - {Wx::EvtHandler#evt_enter_window}(meth = nil, &block): Process a {Wx::EVT_ENTER_WINDOW} event. # # - {Wx::EvtHandler#evt_leave_window}(meth = nil, &block): Process a {Wx::EVT_LEAVE_WINDOW} event. # # - {Wx::EvtHandler#evt_mousewheel}(meth = nil, &block): Process a {Wx::EVT_MOUSEWHEEL} event. # # - {Wx::EvtHandler#evt_mouse_events}(meth = nil, &block): Process all mouse events. # # - {Wx::EvtHandler#evt_magnify}(meth = nil, &block): Process a {Wx::EVT_MAGNIFY} event (new since wxWidgets 3.1.0). # # Category: {Wx::Events} # @see Wx::KeyEvent # # class MouseEvent < Event # Constructor. # # Valid event types are: # # - {Wx::EVT_ENTER_WINDOW} # # - {Wx::EVT_LEAVE_WINDOW} # # - {Wx::EVT_LEFT_DOWN} # # - {Wx::EVT_LEFT_UP} # # - {Wx::EVT_LEFT_DCLICK} # # - {Wx::EVT_MIDDLE_DOWN} # # - {Wx::EVT_MIDDLE_UP} # # - {Wx::EVT_MIDDLE_DCLICK} # # - {Wx::EVT_RIGHT_DOWN} # # - {Wx::EVT_RIGHT_UP} # # - {Wx::EVT_RIGHT_DCLICK} # # - {Wx::EVT_AUX1_DOWN} # # - {Wx::EVT_AUX1_UP} # # - {Wx::EVT_AUX1_DCLICK} # # - {Wx::EVT_AUX2_DOWN} # # - {Wx::EVT_AUX2_UP} # # - {Wx::EVT_AUX2_DCLICK} # # - {Wx::EVT_MOTION} # # - {Wx::EVT_MOUSEWHEEL} # # - {Wx::EVT_MAGNIFY} # @param mouseEventType [Wx::Notebook::EventType] # @return [Wx::MouseEvent] def initialize(mouseEventType=Wx::EVT_NULL) end # Returns true if the event was a first extra button double click. # @return [Boolean] def aux1d_click; end # Returns true if the first extra button mouse button changed to down. # @return [Boolean] def aux1down; end # Returns true if the first extra button mouse button changed to up. # @return [Boolean] def aux1up; end # Returns true if the event was a second extra button double click. # @return [Boolean] def aux2d_click; end # Returns true if the second extra button mouse button changed to down. # @return [Boolean] def aux2down; end # Returns true if the second extra button mouse button changed to up. # @return [Boolean] def aux2up; end # Returns true if the event was generated by the specified button. # # # @see wxMouseState::ButtoinIsDown() # @param but [Wx::MouseButton] # @return [Boolean] def button(but) end # If the argument is omitted, this returns true if the event was a mouse double click event. # # Otherwise the argument specifies which double click event was generated (see {Wx::MouseEvent#button} for the possible values). # @param but [Wx::MouseButton] # @return [Boolean] def button_d_click(but=Wx::MouseButton::MOUSE_BTN_ANY) end # If the argument is omitted, this returns true if the event was a mouse button down event. # # Otherwise the argument specifies which button-down event was generated (see {Wx::MouseEvent#button} for the possible values). # @param but [Wx::MouseButton] # @return [Boolean] def button_down(but=Wx::MouseButton::MOUSE_BTN_ANY) end # If the argument is omitted, this returns true if the event was a mouse button up event. # # Otherwise the argument specifies which button-up event was generated (see {Wx::MouseEvent#button} for the possible values). # @param but [Wx::MouseButton] # @return [Boolean] def button_up(but=Wx::MouseButton::MOUSE_BTN_ANY) end # Returns true if this was a dragging event (motion while a button is depressed). # # # @see Wx::MouseEvent#moving # @return [Boolean] def dragging; end # Returns true if the mouse was entering the window. # # # @see Wx::MouseEvent#leaving # @return [Boolean] def entering; end # Returns the mouse button which generated this event or {Wx::MouseButton::MOUSE_BTN_NONE} if no button is involved (for mouse move, enter or leave event, for example). # # Otherwise {Wx::MouseButton::MOUSE_BTN_LEFT} is returned for the left button down, up and double click events, {Wx::MouseButton::MOUSE_BTN_MIDDLE} and {Wx::MouseButton::MOUSE_BTN_RIGHT} for the same events for the middle and the right buttons respectively. # @return [Integer] def get_button; end # Returns the number of mouse clicks for this event: 1 for a simple click, 2 for a double-click, 3 for a triple-click and so on. # # Currently this function is implemented only in WXOSX and returns -1 for the other platforms (you can still distinguish simple clicks from double-clicks as they generate different kinds of events however). # @return [Integer] def get_click_count; end alias_method :click_count, :get_click_count # Returns the configured number of lines (or whatever) to be scrolled per wheel action. # # Default value under most platforms is three. # @see Wx::MouseEvent#get_columns_per_action # @return [Integer] def get_lines_per_action; end alias_method :lines_per_action, :get_lines_per_action # Returns the configured number of columns (or whatever) to be scrolled per wheel action. # # Default value under most platforms is three. # @see Wx::MouseEvent#get_lines_per_action # @return [Integer] def get_columns_per_action; end alias_method :columns_per_action, :get_columns_per_action # Returns the logical mouse position in pixels (i.e. translated according to the translation set for the DC, which usually indicates that the window has been scrolled). # @param dc [Wx::DC] # @return [Wx::Point] def get_logical_position(dc) end alias_method :logical_position, :get_logical_position # For magnify (pinch to zoom) events: returns the change in magnification. # # A value of 0 means no change, a positive value means we should enlarge (or zoom in), a negative value means we should shrink (or zoom out). # This method is only valid to call for {Wx::EVT_MAGNIFY} events which are currently only generated under macOS. # @see Wx::MouseEvent#magnify # @return [Float] def get_magnification; end alias_method :magnification, :get_magnification # Get wheel delta, normally 120. # # This is the threshold for action to be taken, and one such action (for example, scrolling one increment) should occur for each delta. # @return [Integer] def get_wheel_delta; end alias_method :wheel_delta, :get_wheel_delta # On Mac, has the user selected "Natural" scrolling in their System Preferences? Currently false on all other OS's. # # "Natural" scrolling means that content scrolling happens in the opposite direction, and if you are indeed scrolling content then you don't need to use this function because macOS has already inverted the scroll direction. But there can be special situations where you want the mouse wheel action to work always in the same direction and in that case you will need this function. # @return [Boolean] def is_wheel_inverted; end alias_method :wheel_inverted?, :is_wheel_inverted # Get wheel rotation, positive or negative indicates direction of rotation. # # Current devices all send an event when rotation is at least +/-WheelDelta, but finer resolution devices can be created in the future. # Because of this you shouldn't assume that one event is equal to 1 line, but you should be able to either do partial line scrolling or wait until several events accumulate before scrolling. # @return [Integer] def get_wheel_rotation; end alias_method :wheel_rotation, :get_wheel_rotation # Gets the axis the wheel operation concerns. # # Usually the mouse wheel is used to scroll vertically so {Wx::MouseWheelAxis::MOUSE_WHEEL_VERTICAL} is returned but some mice (and most trackpads) also allow to use the wheel to scroll horizontally in which case {Wx::MouseWheelAxis::MOUSE_WHEEL_HORIZONTAL} is returned. # Notice that before wxWidgets 2.9.4 this method returned int. # @return [Wx::MouseWheelAxis] def get_wheel_axis; end alias_method :wheel_axis, :get_wheel_axis # Returns true if the event was a mouse button event (not necessarily a button down event - that may be tested using {Wx::MouseEvent#button_down}). # @return [Boolean] def is_button; end alias_method :button?, :is_button # Returns true if the system has been setup to do page scrolling with the mouse wheel instead of line scrolling. # @return [Boolean] def is_page_scroll; end alias_method :page_scroll?, :is_page_scroll # Returns true if the mouse was leaving the window. # # # @see Wx::MouseEvent#entering. # @return [Boolean] def leaving; end # Returns true if the event was a left double click. # @return [Boolean] def left_d_click; end # Returns true if the left mouse button changed to down. # @return [Boolean] def left_down; end # Returns true if the left mouse button changed to up. # @return [Boolean] def left_up; end # Returns true if the event is a magnify (i.e. pinch to zoom) event. # # Such events are currently generated only under macOS. # @see Wx::MouseEvent#get_magnification # @return [Boolean] def magnify; end # Returns true if the Meta key was down at the time of the event. # @return [Boolean] def meta_down; end # Returns true if the event was a middle double click. # @return [Boolean] def middle_d_click; end # Returns true if the middle mouse button changed to down. # @return [Boolean] def middle_down; end # Returns true if the middle mouse button changed to up. # @return [Boolean] def middle_up; end # Returns true if this was a motion event and no mouse buttons were pressed. # # If any mouse button is held pressed, then this method returns false and {Wx::MouseEvent#dragging} returns true. # @return [Boolean] def moving; end # Returns true if the event was a right double click. # @return [Boolean] def right_d_click; end # Returns true if the right mouse button changed to down. # @return [Boolean] def right_down; end # Returns true if the right mouse button changed to up. # @return [Boolean] def right_up; end # Returns the physical mouse position. # @return [Wx::Point] def get_position; end alias_method :position, :get_position # Returns X coordinate of the physical mouse event position. # @return [Integer] def get_x; end alias_method :x, :get_x # Returns Y coordinate of the physical mouse event position. # @return [Integer] def get_y; end alias_method :y, :get_y # Returns true if the left mouse button is currently down. # @return [Boolean] def left_is_down; end # Returns true if the middle mouse button is currently down. # @return [Boolean] def middle_is_down; end # Returns true if the right mouse button is currently down. # @return [Boolean] def right_is_down; end # Returns true if the first extra button mouse button is currently down. # @return [Boolean] def aux1is_down; end # Returns true if the second extra button mouse button is currently down. # @return [Boolean] def aux2is_down; end # @param x [Integer] # @return [void] def set_x(x) end alias_method :x=, :set_x # @param y [Integer] # @return [void] def set_y(y) end alias_method :y=, :set_y # @param pos [Array(Integer, Integer), Wx::Point] # @return [void] def set_position(pos) end alias_method :position=, :set_position # @param down [Boolean] # @return [void] def set_left_down(down) end alias_method :left_down=, :set_left_down # @param down [Boolean] # @return [void] def set_middle_down(down) end alias_method :middle_down=, :set_middle_down # @param down [Boolean] # @return [void] def set_right_down(down) end alias_method :right_down=, :set_right_down # @param down [Boolean] # @return [void] def set_aux1down(down) end alias_method :aux1down=, :set_aux1down # @param down [Boolean] # @return [void] def set_aux2down(down) end alias_method :aux2down=, :set_aux2down # @param state [Wx::MouseState] # @return [void] def set_state(state) end alias_method :state=, :set_state # Return the bit mask of all pressed modifier keys. # # The return value is a combination of {Wx::KeyModifier::MOD_ALT}, {Wx::KeyModifier::MOD_CONTROL}, {Wx::KeyModifier::MOD_SHIFT} and {Wx::KeyModifier::MOD_META} bit masks. Additionally, {Wx::KeyModifier::MOD_NONE} is defined as 0, i.e. corresponds to no modifiers (see {Wx::MouseEvent#has_any_modifiers}) and {Wx::KeyModifier::MOD_CMD} is either {Wx::KeyModifier::MOD_CONTROL} (MSW and Unix) or {Wx::KeyModifier::MOD_META} (Mac), see {Wx::MouseEvent#cmd_down}. See {Wx::KeyModifier} for the full list of modifiers. # Notice that this function is easier to use correctly than, for example, {Wx::MouseEvent#control_down} because when using the latter you also have to remember to test that none of the other modifiers is pressed: # # ```ruby # if event.control_down && !event.alt_down && !event.shift_down && !event.meta_down # # ... handle Ctrl-XXX ... # ``` # # and forgetting to do it can result in serious program bugs (e.g. program not working with European keyboard layout where AltGr key which is seen by the program as combination of CTRL and ALT is used). On the other hand, you can simply write: # # ```ruby # if event.get_modifiers == Wx::KeyModifier::MOD_CONTROL # # ... handle Ctrl-XXX ... # ``` # # with this function. # @return [Integer] def get_modifiers; end alias_method :modifiers, :get_modifiers # Returns true if any modifiers at all are pressed. # # This is equivalent to Wx::MouseEvent#get_modifiers != {Wx::KeyModifier::MOD_NONE}. # Notice that this is different from {Wx::MouseEvent#has_modifiers} method which doesn't take e.g. Shift modifier into account. This method is most suitable for mouse events when any modifier, including Shift, can change the interpretation of the event. # @return [Boolean] def has_any_modifiers; end alias_method :has_any_modifiers?, :has_any_modifiers # Returns true if Control or Alt are pressed. # # Checks if Control, Alt or, under macOS only, Command key are pressed (notice that the real Control key is still taken into account under OS X too). # This method returns false if only Shift is pressed for compatibility reasons and also because pressing Shift usually doesn't change the interpretation of key events, see {Wx::MouseEvent#has_any_modifiers} if you want to take Shift into account as well. # @return [Boolean] def has_modifiers; end alias_method :has_modifiers?, :has_modifiers # Returns true if the Control key or Apple/Command key under macOS is pressed. # # This function doesn't distinguish between right and left control keys. # Notice that {Wx::MouseEvent#get_modifiers} should usually be used instead of this one. # @return [Boolean] def control_down; end # Returns true if the Control key (also under macOS). # # This function doesn't distinguish between right and left control keys. # Notice that {Wx::MouseEvent#get_modifiers} should usually be used instead of this one. # @return [Boolean] def raw_control_down; end # Returns true if the Shift key is pressed. # # This function doesn't distinguish between right and left shift keys. # Notice that {Wx::MouseEvent#get_modifiers} should usually be used instead of this one. # @return [Boolean] def shift_down; end # Returns true if the Alt key is pressed. # # Notice that {Wx::MouseEvent#get_modifiers} should usually be used instead of this one. # @return [Boolean] def alt_down; end # Returns true if the key used for command accelerators is pressed. # # Same as {Wx::MouseEvent#control_down}. Deprecated. # Notice that {Wx::MouseEvent#get_modifiers} should usually be used instead of this one. # @return [Boolean] def cmd_down; end # @param down [Boolean] # @return [void] def set_control_down(down) end alias_method :control_down=, :set_control_down # @param down [Boolean] # @return [void] def set_raw_control_down(down) end alias_method :raw_control_down=, :set_raw_control_down # @param down [Boolean] # @return [void] def set_shift_down(down) end alias_method :shift_down=, :set_shift_down # @param down [Boolean] # @return [void] def set_alt_down(down) end alias_method :alt_down=, :set_alt_down # @param down [Boolean] # @return [void] def set_meta_down(down) end alias_method :meta_down=, :set_meta_down end # MouseEvent # A {Wx::SetCursorEvent} is generated from {Wx::Window} when the mouse cursor is about to be set as a result of mouse motion. # # This event gives the application the chance to perform specific mouse cursor processing based on the current position of the mouse within the window. Use {Wx::SetCursorEvent#set_cursor} to specify the cursor you want to be displayed. # ### Events using this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::SetCursorEvent} events. # Event handler methods: # # - {Wx::EvtHandler#evt_set_cursor}(meth = nil, &block): Process a {Wx::EVT_SET_CURSOR} event. # # Category: {Wx::Events} # @see Wx::SetCursor # @see Wx::Window#set_cursor # # class SetCursorEvent < Event # Constructor, used by the library itself internally to initialize the event object. # @param x [Integer] # @param y [Integer] # @return [Wx::SetCursorEvent] def initialize(x=0, y=0) end # Returns a reference to the cursor specified by this event. # @return [Wx::Cursor] def get_cursor; end alias_method :cursor, :get_cursor # Returns the X coordinate of the mouse in client coordinates. # @return [Integer] def get_x; end alias_method :x, :get_x # Returns the Y coordinate of the mouse in client coordinates. # @return [Integer] def get_y; end alias_method :y, :get_y # Returns true if the cursor specified by this event is a valid cursor. # #
# Remark: #

You cannot specify {Wx::NULL_CURSOR} with this event, as it is not considered a valid cursor. #

#
# @return [Boolean] def has_cursor; end alias_method :has_cursor?, :has_cursor # Sets the cursor associated with this event. # @param cursor [Wx::Cursor] # @return [void] def set_cursor(cursor) end alias_method :cursor=, :set_cursor end # SetCursorEvent # This is the base class for all supported gesture events. # #
# Note: #

Gesture events are not generated by default, you must call {Wx::Window#enable_touch_events} with the appropriate parameter to request their generation. #

#
# # Category: {Wx::Events} # @see Wx::PanGestureEvent # @see Wx::ZoomGestureEvent # @see Wx::RotateGestureEvent # # class GestureEvent < Event # Constructor. # @param winid [Integer] # @param type [Wx::Notebook::EventType] # @return [Wx::GestureEvent] def initialize(winid=0, type=Wx::EVT_NULL) end # Returns the position where the event took effect, in client coordinates: position of Pan event, center of zoom for Zoom event, center of rotation for Rotate event, center of box formed by 2 fingers for Two Finger Tap event and position of the pressed finger for Press and Tap Event. # @return [Wx::Point] def get_position; end alias_method :position, :get_position # Returns true if the event was the first in a gesture sequence. # @return [Boolean] def is_gesture_start; end alias_method :gesture_start?, :is_gesture_start # Returns true if the event was the last in a gesture sequence. # @return [Boolean] def is_gesture_end; end alias_method :gesture_end?, :is_gesture_end # Sets the position where the event took effect, in client coordinates: position of Pan event, center of zoom for Zoom event, center of rotation for Rotate event. # @param pos [Array(Integer, Integer), Wx::Point] # @return [void] def set_position(pos) end alias_method :position=, :set_position # Sets the event to be the first in a gesture sequence. # @param isStart [Boolean] # @return [void] def set_gesture_start(isStart=true) end alias_method :gesture_start=, :set_gesture_start # Sets the event to be the last in a gesture sequence. # @param isEnd [Boolean] # @return [void] def set_gesture_end(isEnd=true) end alias_method :gesture_end=, :set_gesture_end end # GestureEvent # This event is generated when the user moves a finger on the surface. # # WXGTK also generates this event during mouse dragging (mouse motion while a left mouse button is depressed). # Note that OSX requires the primary mouse button to be pressed while performing the finger movement. # ### Events using this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::PanGestureEvent} events. # Event handler methods: # # - {Wx::EvtHandler#evt_gesture_pan}(id, meth = nil, &block): Process a {Wx::EVT_GESTURE_PAN}. # # Category: {Wx::Events} # class PanGestureEvent < GestureEvent # Constructor. # @param winid [Integer] # @return [Wx::PanGestureEvent] def initialize(winid=0) end # Returns the distance covered since the previous panning event. # @return [Wx::Point] def get_delta; end alias_method :delta, :get_delta # Sets the distance covered since the previous panning event. # @param delta [Array(Integer, Integer), Wx::Point] # @return [void] def set_delta(delta) end alias_method :delta=, :set_delta end # PanGestureEvent # This event is generated when two fingers pinch the surface to zoom in or out. # # ### Events using this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::ZoomGestureEvent} events. # Event handler methods: # # - {Wx::EvtHandler#evt_gesture_zoom}(id, meth = nil, &block): Process a {Wx::EVT_GESTURE_ZOOM}. # # Category: {Wx::Events} # class ZoomGestureEvent < GestureEvent # Constructor. # @param windid [Integer] # @return [Wx::ZoomGestureEvent] def initialize(windid=0) end # Returns the zoom Factor since the gesture started. # # Hence, starting of the gesture is considered as 1:1. A value greater than 1.0 means we should enlarge (or zoom in), a value less than 1.0 means we should shrink (or zoom out). # @return [Float] def get_zoom_factor; end alias_method :zoom_factor, :get_zoom_factor # Sets the zoom Factor. # @param zoomFactor [Float] # @return [void] def set_zoom_factor(zoomFactor) end alias_method :zoom_factor=, :set_zoom_factor end # ZoomGestureEvent # This event is generated when two fingers move in opposite directions on the surface. # # ### Events using this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::RotateGestureEvent} events. # Event handler methods: # # - {Wx::EvtHandler#evt_gesture_rotate}(id, meth = nil, &block): Process a {Wx::EVT_GESTURE_ROTATE}. # # Category: {Wx::Events} # class RotateGestureEvent < GestureEvent # Constructor. # @param windid [Integer] # @return [Wx::RotateGestureEvent] def initialize(windid=0) end # Returns the total angle of rotation in radians in clockwise direction since the gesture was first started i.e. # # when {Wx::RotateGestureEvent#is_gesture_start} returned true. This value is always greater than or equal to zero. # @return [Float] def get_rotation_angle; end alias_method :rotation_angle, :get_rotation_angle # Sets the total angle of rotation in radians in clockwise direction since the gesture was first started i.e. # # when {Wx::RotateGestureEvent#is_gesture_start} returned true. This value is always greater than or equal to zero. # @param rotationAngle [Float] # @return [void] def set_rotation_angle(rotationAngle) end alias_method :rotation_angle=, :set_rotation_angle end # RotateGestureEvent # This event is generated when two fingers touch the surface at the same time. # # ### Events using this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::TwoFingerTapEvent} events. # Event handler methods: # # - {Wx::EvtHandler#evt_two_finger_tap}(id, meth = nil, &block): Process a {Wx::EVT_TWO_FINGER_TAP}. # # Category: {Wx::Events} # class TwoFingerTapEvent < GestureEvent # Constructor. # @param windid [Integer] # @return [Wx::TwoFingerTapEvent] def initialize(windid=0) end end # TwoFingerTapEvent # This event is generated when one finger touches the surface and remains stationary. # # Note that currently it is only generated under WXGTK and WXOSX. # WXGTK also generates this event when left mouse button is being pressed for some minimum duration of time. # ### Events using this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::LongPressEvent} events. # Event handler methods: # # - {Wx::EvtHandler#evt_long_press}(id, meth = nil, &block): Process a {Wx::EVT_LONG_PRESS}. # # Category: {Wx::Events} # class LongPressEvent < GestureEvent # Constructor. # @param windid [Integer] # @return [Wx::LongPressEvent] def initialize(windid=0) end end # LongPressEvent # This event is generated when the user press the surface with one finger and taps with another. # # Note that once started the event will also be generated when the finger that was pressed moves on surface. # ### Events using this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::PressAndTapEvent} events. # Event handler methods: # # - {Wx::EvtHandler#evt_press_and_tap}(id, meth = nil, &block): Process a {Wx::EVT_PRESS_AND_TAP}. # # Category: {Wx::Events} # class PressAndTapEvent < GestureEvent # Constructor. # @param windid [Integer] # @return [Wx::PressAndTapEvent] def initialize(windid=0) end end # PressAndTapEvent # This event class contains information about key press and release events. # # The main information carried by this event is the key being pressed or released. It can be accessed using one of {Wx::KeyEvent#get_unicode_key}, {Wx::KeyEvent#get_key_code} or {Wx::KeyEvent#get_raw_key_code} functions. For the printable characters, {Wx::KeyEvent#get_unicode_key} should be used as it works for any keys, including non-Latin-1 characters that can be entered when using national keyboard layouts. {Wx::KeyEvent#get_key_code} should be used to handle special characters (such as cursor arrows keys or HOME or INS and so on) which correspond to {Wx::KeyCode} enum elements above the {Wx::KeyCode::K_START} constant. While {Wx::KeyEvent#get_key_code} also returns the character code for Latin-1 keys for compatibility, it doesn't work for Unicode characters in general and will return {Wx::KeyCode::K_NONE} for any non-Latin-1 ones. If both {Wx::KeyEvent#get_unicode_key} and {Wx::KeyEvent#get_key_code} return {Wx::KeyCode::K_NONE} then the key has no WXK_xxx mapping and {Wx::KeyEvent#get_raw_key_code} can be used to distinguish between keys, but raw key codes are platform specific. For these reasons, it is recommended to always use {Wx::KeyEvent#get_unicode_key} and only fall back to {Wx::KeyEvent#get_key_code} if {Wx::KeyEvent#get_unicode_key} returned {Wx::KeyCode::K_NONE}, meaning that the event corresponds to a non-printable special keys, then optionally check {Wx::KeyEvent#get_raw_key_code} if {Wx::KeyEvent#get_key_code} also returned {Wx::KeyCode::K_NONE} or simply ignore that key. # While these three functions can be used with the events of {Wx::EVT_KEY_DOWN}, {Wx::EVT_KEY_UP} and {Wx::EVT_CHAR} types, the values returned by them are different for the first two events and the last one. For the latter, the key returned corresponds to the character that would appear in e.g. a text zone if the user pressed the key in it. As such, its value depends on the current state of the Shift key and, for the letters, on the state of Caps Lock modifier. For example, if A key is pressed without Shift being held down, {Wx::KeyEvent} of type {Wx::EVT_CHAR} generated for this key press will return (from either {Wx::KeyEvent#get_key_code} or {Wx::KeyEvent#get_unicode_key} as their meanings coincide for ASCII characters) key code of 97 corresponding the ASCII value of a. And if the same key is pressed but with Shift being held (or Caps Lock being active), then the key could would be 65, i.e. ASCII value of capital A. # However for the key down and up events the returned key code will instead be A independently of the state of the modifier keys i.e. it depends only on physical key being pressed and is not translated to its logical representation using the current keyboard state. Such untranslated key codes are defined as follows: # # - For the letters they correspond to the upper case value of the letter. # - For the other alphanumeric keys (e.g. 7 or +), the untranslated key code corresponds to the character produced by the key when it is pressed without Shift. E.g. in standard US keyboard layout the untranslated key code for the key =/+ in the upper right corner of the keyboard is 61 which is the ASCII value of =. # - For the rest of the keys (i.e. special non-printable keys) it is the same as the normal key code as no translation is used anyhow. # # Notice that the first rule applies to all Unicode letters, not just the usual Latin-1 ones. However for non-Latin-1 letters only {Wx::KeyEvent#get_unicode_key} can be used to retrieve the key code as {Wx::KeyEvent#get_key_code} just returns {Wx::KeyCode::K_NONE} in this case. # Also, note that {Wx::EVT_CHAR} events are not generated for keys which do not have a wxWidgets mapping, so {Wx::KeyEvent#get_raw_key_code} should never be required for this event. # To summarize: you should handle {Wx::EVT_CHAR} if you need the translated key and {Wx::EVT_KEY_DOWN} if you only need the value of the key itself, independent of the current keyboard state. # #
# Note: #

Not all key down events may be generated by the user. As an example, {Wx::EVT_KEY_DOWN} with = key code can be generated using the standard US keyboard layout but not using the German one because the = key corresponds to Shift-0 key combination in this layout and the key code for it is 0, not =. Because of this you should avoid requiring your users to type key events that might be impossible to enter on their keyboard. #

#
# # Another difference between key and char events is that another kind of translation is done for the latter ones when the Control key is pressed: char events for ASCII letters in this case carry codes corresponding to the ASCII value of Ctrl-Latter, i.e. 1 for Ctrl-A, 2 for Ctrl-B and so on until 26 for Ctrl-Z. This is convenient for terminal-like applications and can be completely ignored by all the other ones (if you need to handle Ctrl-A it is probably a better idea to use the key event rather than the char one). Notice that currently no translation is done for the presses of [, \, ], ^ and _ keys which might be mapped to ASCII values from 27 to 31. Since version 2.9.2, the enum values {Wx::KeyCode::K_CONTROL}_A - {Wx::KeyCode::K_CONTROL}_Z can be used instead of the non-descriptive constant values 1-26. # Finally, modifier keys only generate key events but no char events at all. The modifiers keys are {Wx::KeyCode::K_SHIFT}, {Wx::KeyCode::K_CONTROL}, {Wx::KeyCode::K_ALT} and various {Wx::KeyCode::K_WINDOWS}_XXX from {Wx::KeyCode} enum. # Modifier keys events are special in one additional aspect: usually the keyboard state associated with a key press is well defined, e.g. {Wx::KeyboardState#shift_down} returns true only if the Shift key was held pressed when the key that generated this event itself was pressed. There is an ambiguity for the key press events for Shift key itself however. By convention, it is considered to be already pressed when it is pressed and already released when it is released. In other words, {Wx::EVT_KEY_DOWN} event for the Shift key itself will have {Wx::KeyModifier::MOD_SHIFT} in {Wx::KeyEvent#get_modifiers} and {Wx::KeyEvent#shift_down} will return true while the {Wx::EVT_KEY_UP} event for Shift itself will not have {Wx::KeyModifier::MOD_SHIFT} in its modifiers and {Wx::KeyEvent#shift_down} will return false. # Tip: You may discover the key codes and modifiers generated by all the keys on your system interactively by running the Key Event Sample wxWidgets sample and pressing some keys in it. # #
# Note: #

If a key down (EVT_KEY_DOWN) event is caught and the event handler does not call event.Skip() then the corresponding char event (EVT_CHAR) will not happen. This is by design and enables the programs that handle both types of events to avoid processing the same key twice. As a consequence, if you do not want to suppress the {Wx::EVT_CHAR} events for the keys you handle, always call event.Skip() in your {Wx::EVT_KEY_DOWN} handler. Not doing may also prevent accelerators defined using this key from working. #

#
# #
# Note: #

If a key is maintained in a pressed state, you will typically get a lot of (automatically generated) key down events but only one key up one at the end when the key is released so it is wrong to assume that there is one up event corresponding to each down one. #

#
# #
# Note: #

For Windows programmers: The key and char events in wxWidgets are similar to but slightly different from Windows WM_KEYDOWN and WM_CHAR events. In particular, Alt-x combination will generate a char event in wxWidgets (unless it is used as an accelerator) and almost all keys, including ones without ASCII equivalents, generate char events too. #

#
# # ### Events using this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::KeyEvent} events. # Event handler methods: # # - {Wx::EvtHandler#evt_key_down}(meth = nil, &block): Process a {Wx::EVT_KEY_DOWN} event (any key has been pressed). If this event is handled and not skipped, {Wx::EVT_CHAR} will not be generated at all for this key press (but {Wx::EVT_KEY_UP} will be). # # - {Wx::EvtHandler#evt_key_up}(meth = nil, &block): Process a {Wx::EVT_KEY_UP} event (any key has been released). # # - {Wx::EvtHandler#evt_char}(meth = nil, &block): Process a {Wx::EVT_CHAR} event. # # - {Wx::EvtHandler#evt_char_hook}(meth = nil, &block): Process a {Wx::EVT_CHAR_HOOK} event. Unlike all the other key events, this event is propagated upwards the window hierarchy which allows intercepting it in the parent window of the focused window to which it is sent initially (if there is no focused window, this event is sent to the {Wx::App} global object). It is also generated before any other key events and so gives the parent window an opportunity to modify the keyboard handling of its children, e.g. it is used internally by wxWidgets in some ports to intercept pressing Esc key in any child of a dialog to close the dialog itself when it's pressed. By default, if this event is handled, i.e. the handler doesn't call {Wx::Event#skip}, neither {Wx::EVT_KEY_DOWN} nor {Wx::EVT_CHAR} events will be generated (although {Wx::EVT_KEY_UP} still will be), i.e. it replaces the normal key events. However by calling the special {Wx::KeyEvent#do_allow_next_event} method you can handle {Wx::EVT_CHAR_HOOK} and still allow normal events generation. This is something that is rarely useful but can be required if you need to prevent a parent {Wx::EVT_CHAR_HOOK} handler from running without suppressing the normal key events. Finally notice that this event is not generated when the mouse is captured as it is considered that the window which has the capture should receive all the keyboard events too without allowing its parent {Wx::TopLevelWindow} to interfere with their processing. # # Category: {Wx::Events} # @see Wx::KeyboardState # # class KeyEvent < Event # Obtains the position (in client coordinates) at which the key was pressed. # # Notice that under most platforms this position is simply the current mouse pointer position and has no special relationship to the key event itself. # x and y may be NULL if the corresponding coordinate is not needed. # @return [Wx::Point] def get_position; end alias_method :position, :get_position # Constructor. # # Currently, the only valid event types are {Wx::EVT_CHAR} and {Wx::EVT_CHAR_HOOK}. # @param keyEventType [Wx::Notebook::EventType] # @return [Wx::KeyEvent] def initialize(keyEventType=Wx::EVT_NULL) end # Returns the key code of the key that generated this event. # # ASCII symbols return normal ASCII values, while events from special keys such as "left cursor arrow" ({Wx::KeyCode::K_LEFT}) return values outside of the ASCII range. See {Wx::KeyCode} for a full list of the virtual key codes. # Note that this method returns a meaningful value only for special non-alphanumeric keys or if the user entered a Latin-1 character (this includes ASCII and the accented letters found in Western European languages but not letters of other alphabets such as e.g. Cyrillic). Otherwise it simply method returns {Wx::KeyCode::K_NONE} and {Wx::KeyEvent#get_unicode_key} should be used to obtain the corresponding Unicode character. # Using {Wx::KeyEvent#get_unicode_key} is in general the right thing to do if you are interested in the characters typed by the user, {Wx::KeyEvent#get_key_code} should be only used for special keys (for which {Wx::KeyEvent#get_unicode_key} returns {Wx::KeyCode::K_NONE}). To handle both kinds of keys you might write: # ```ruby # def on_char(event) # uc = event.get_unicode_key # if uc # # It's a "normal" character. Notice that this includes # # control characters in 1..31 range, e.g. Wx::K_RETURN or # # Wx::K_BACK, so check for them explicitly. # if uc.ord >= 32 # Wx.log_message("You pressed '#{uc}'") # else # # It's a control character # ... # end # else # No Unicode equivalent. # # It's a special key, deal with all the known ones: # case event.get_key_code # when Wx::K_LEFT, Wx::K_RIGHT # ... move cursor ... # # when Wx::K_F1: # ... give help ... # end # end # end # ``` # @return [Integer] def get_key_code; end alias_method :key_code, :get_key_code # Returns true if the key is in the given key category. # @param category [Integer] A bitwise combination of named {Wx::KeyCategoryFlags} constants. # @return [Boolean] def is_key_in_category(category) end alias_method :key_in_category?, :is_key_in_category # Returns true if this event is an auto-repeat of the key, false if this is the initial key press. # @return [Boolean] def is_auto_repeat; end alias_method :auto_repeat?, :is_auto_repeat # Returns the raw key code for this event. # # The flags are platform-dependent and should only be used if the functionality provided by other {Wx::KeyEvent} methods is insufficient. # Under MSW, the raw key code is the value of wParam parameter of the corresponding message. # Under GTK, the raw key code is the keyval field of the corresponding GDK event. # Under macOS, the raw key code is the keyCode field of the corresponding NSEvent. # #
# Note: #

Currently the raw key codes are not supported by all ports, use \#ifdef {Wx::HAS_RAW_KEY_CODES} to determine if this feature is available. #

#
# @return [Integer] def get_raw_key_code; end alias_method :raw_key_code, :get_raw_key_code # Returns the low level key flags for this event. # # The flags are platform-dependent and should only be used if the functionality provided by other {Wx::KeyEvent} methods is insufficient. # Under MSW, the raw flags are just the value of lParam parameter of the corresponding message. # Under GTK, the raw flags contain the hardware_keycode field of the corresponding GDK event. # Under macOS, the raw flags contain the modifiers state. # #
# Note: #

Currently the raw key flags are not supported by all ports, use \#ifdef {Wx::HAS_RAW_KEY_CODES} to determine if this feature is available. #

#
# @return [Integer] def get_raw_key_flags; end alias_method :raw_key_flags, :get_raw_key_flags # Returns the Unicode character corresponding to this key event. # # If the key pressed doesn't have any character value (e.g. a cursor key) this method will return {Wx::KeyCode::K_NONE}. In this case you should use {Wx::KeyEvent#get_key_code} to retrieve the value of the key. # This function is only available in Unicode build, i.e. when {Wx::Setup::USE_UNICODE} is 1. # @return [String] def get_unicode_key; end alias_method :unicode_key, :get_unicode_key # Returns the X position (in client coordinates) of the event. # # # @see Wx::KeyEvent#get_position # @return [Integer] def get_x; end alias_method :x, :get_x # Returns the Y position (in client coordinates) of the event. # # # @see Wx::KeyEvent#get_position # @return [Integer] def get_y; end alias_method :y, :get_y # Allow normal key events generation. # # Can be called from {Wx::EVT_CHAR_HOOK} handler to indicate that the generation of normal events should not be suppressed, as it happens by default when this event is handled. # The intended use of this method is to allow some window object to prevent {Wx::EVT_CHAR_HOOK} handler in its parent window from running by defining its own handler for this event. Without calling this method, this would result in not generating {Wx::EVT_KEY_DOWN} nor {Wx::EVT_CHAR} events at all but by calling it you can ensure that these events would still be generated, even if {Wx::EVT_CHAR_HOOK} event was handled. # @return [void] def do_allow_next_event; end # Returns true if {Wx::KeyEvent#do_allow_next_event} had been called, false by default. # # This method is used by wxWidgets itself to determine whether the normal key events should be generated after {Wx::EVT_CHAR_HOOK} processing. # @return [Boolean] def is_next_event_allowed; end alias_method :next_event_allowed?, :is_next_event_allowed # Return the bit mask of all pressed modifier keys. # # The return value is a combination of {Wx::KeyModifier::MOD_ALT}, {Wx::KeyModifier::MOD_CONTROL}, {Wx::KeyModifier::MOD_SHIFT} and {Wx::KeyModifier::MOD_META} bit masks. Additionally, {Wx::KeyModifier::MOD_NONE} is defined as 0, i.e. corresponds to no modifiers (see {Wx::KeyEvent#has_any_modifiers}) and {Wx::KeyModifier::MOD_CMD} is either {Wx::KeyModifier::MOD_CONTROL} (MSW and Unix) or {Wx::KeyModifier::MOD_META} (Mac), see {Wx::KeyEvent#cmd_down}. See {Wx::KeyModifier} for the full list of modifiers. # Notice that this function is easier to use correctly than, for example, {Wx::KeyEvent#control_down} because when using the latter you also have to remember to test that none of the other modifiers is pressed: # # ```ruby # if event.control_down && !event.alt_down && !event.shift_down && !event.meta_down # # ... handle Ctrl-XXX ... # ``` # # and forgetting to do it can result in serious program bugs (e.g. program not working with European keyboard layout where AltGr key which is seen by the program as combination of CTRL and ALT is used). On the other hand, you can simply write: # # ```ruby # if event.get_modifiers == Wx::KeyModifier::MOD_CONTROL # # ... handle Ctrl-XXX ... # ``` # # with this function. # @return [Integer] def get_modifiers; end alias_method :modifiers, :get_modifiers # Returns true if any modifiers at all are pressed. # # This is equivalent to Wx::KeyEvent#get_modifiers != {Wx::KeyModifier::MOD_NONE}. # Notice that this is different from {Wx::KeyEvent#has_modifiers} method which doesn't take e.g. Shift modifier into account. This method is most suitable for mouse events when any modifier, including Shift, can change the interpretation of the event. # @return [Boolean] def has_any_modifiers; end alias_method :has_any_modifiers?, :has_any_modifiers # Returns true if Control or Alt are pressed. # # Checks if Control, Alt or, under macOS only, Command key are pressed (notice that the real Control key is still taken into account under OS X too). # This method returns false if only Shift is pressed for compatibility reasons and also because pressing Shift usually doesn't change the interpretation of key events, see {Wx::KeyEvent#has_any_modifiers} if you want to take Shift into account as well. # @return [Boolean] def has_modifiers; end alias_method :has_modifiers?, :has_modifiers # Returns true if the Control key or Apple/Command key under macOS is pressed. # # This function doesn't distinguish between right and left control keys. # Notice that {Wx::KeyEvent#get_modifiers} should usually be used instead of this one. # @return [Boolean] def control_down; end # Returns true if the Control key (also under macOS). # # This function doesn't distinguish between right and left control keys. # Notice that {Wx::KeyEvent#get_modifiers} should usually be used instead of this one. # @return [Boolean] def raw_control_down; end # Returns true if the Shift key is pressed. # # This function doesn't distinguish between right and left shift keys. # Notice that {Wx::KeyEvent#get_modifiers} should usually be used instead of this one. # @return [Boolean] def shift_down; end # Returns true if the Meta/Windows/Apple key is pressed. # # This function tests the state of the key traditionally called Meta under Unix systems, Windows keys under MSW Notice that {Wx::KeyEvent#get_modifiers} should usually be used instead of this one. # @see Wx::KeyEvent#cmd_down # @return [Boolean] def meta_down; end # Returns true if the Alt key is pressed. # # Notice that {Wx::KeyEvent#get_modifiers} should usually be used instead of this one. # @return [Boolean] def alt_down; end # Returns true if the key used for command accelerators is pressed. # # Same as {Wx::KeyEvent#control_down}. Deprecated. # Notice that {Wx::KeyEvent#get_modifiers} should usually be used instead of this one. # @return [Boolean] def cmd_down; end # @param down [Boolean] # @return [void] def set_control_down(down) end alias_method :control_down=, :set_control_down # @param down [Boolean] # @return [void] def set_raw_control_down(down) end alias_method :raw_control_down=, :set_raw_control_down # @param down [Boolean] # @return [void] def set_shift_down(down) end alias_method :shift_down=, :set_shift_down # @param down [Boolean] # @return [void] def set_alt_down(down) end alias_method :alt_down=, :set_alt_down # @param down [Boolean] # @return [void] def set_meta_down(down) end alias_method :meta_down=, :set_meta_down end # KeyEvent # A size event holds information about size change events of {Wx::Window}. # # The EVT_SIZE handler function will be called when the window has been resized. # You may wish to use this for frames to resize their child windows as appropriate. # Note that the size passed is of the whole window: call {Wx::Window#get_client_size} for the area which may be used by the application. # When a window is resized, usually only a small part of the window is damaged and you may only need to repaint that area. However, if your drawing depends on the size of the window, you may need to clear the DC explicitly and repaint the whole window. In which case, you may need to call {Wx::Window#refresh} to invalidate the entire window. # Important : Sizers ( see Sizers Overview ) rely on size events to function correctly. Therefore, in a sizer-based layout, do not forget to call Skip on all size events you catch (and don't catch size events at all when you don't need to). # ### Events using this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::SizeEvent} events. # Event handler methods: # # - {Wx::EvtHandler#evt_size}(meth = nil, &block): Process a {Wx::EVT_SIZE} event. # # Category: {Wx::Events} # @see Wx::Size # @see Events and Event Handling # # class SizeEvent < Event # Constructor. # @param sz [Array(Integer, Integer), Wx::Size] # @param id [Integer] # @return [Wx::SizeEvent] def initialize(sz, id=0) end # Returns the entire size of the window generating the size change event. # # This is the new total size of the window, i.e. the same size as would be returned by {Wx::Window#get_size} if it were called now. Use {Wx::Window#get_client_size} if you catch this event in a top level window such as {Wx::Frame} to find the size available for the window contents. # @return [Wx::Size] def get_size; end alias_method :size, :get_size # @param size [Wx::Size] # @return [void] def set_size(size) end alias_method :size=, :set_size # @return [Wx::Rect] def get_rect; end alias_method :rect, :get_rect # @param rect [Wx::Rect] # @return [void] def set_rect(rect) end alias_method :rect=, :set_rect end # SizeEvent # A move event holds information about window position change. # # These events are currently generated for top level (see {Wx::TopLevelWindow}) windows in all ports, but are not generated for the child windows in WXGTK. # ### Events using this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::MoveEvent} events. # Event handler methods: # # - {Wx::EvtHandler#evt_move}(meth = nil, &block): Process a {Wx::EVT_MOVE} event, which is generated when a window is moved. # # - {Wx::EvtHandler#evt_move_start}(meth = nil, &block): Process a {Wx::EVT_MOVE_START} event, which is generated when the user starts to move or size a window. WXMSW only. # # - {Wx::EvtHandler#evt_moving}(meth = nil, &block): Process a {Wx::EVT_MOVING} event, which is generated while the user is moving the window. WXMSW only. # # - {Wx::EvtHandler#evt_move_end}(meth = nil, &block): Process a {Wx::EVT_MOVE_END} event, which is generated when the user stops moving or sizing a window. WXMSW only. # # Category: {Wx::Events} # @see Wx::Point # @see Events and Event Handling # # class MoveEvent < Event # Constructor. # @param pt [Array(Integer, Integer), Wx::Point] # @param id [Integer] # @return [Wx::MoveEvent] def initialize(pt, id=0) end # Returns the position of the window generating the move change event. # @return [Wx::Point] def get_position; end alias_method :position, :get_position # @return [Wx::Rect] def get_rect; end alias_method :rect, :get_rect # @param rect [Wx::Rect] # @return [void] def set_rect(rect) end alias_method :rect=, :set_rect # @param pos [Array(Integer, Integer), Wx::Point] # @return [void] def set_position(pos) end alias_method :position=, :set_position end # MoveEvent # A paint event is sent when a window's contents needs to be repainted. # # The handler of this event must create a {Wx::PaintDC} object and use it for painting the window contents. For example: # ```ruby # def on_paint(event) # self.pain do |dc| # draw_my_document(dc) # end # end # ``` # # Notice that you must not create other kinds of {Wx::DC} (e.g. {Wx::ClientDC} or {Wx::WindowDC}) in EVT_PAINT handlers and also don't create {Wx::PaintDC} outside of this event handlers. # You can optimize painting by retrieving the rectangles that have been damaged and only repainting these. The rectangles are in terms of the client area, and are unscrolled, so you will need to do some calculations using the current view position to obtain logical, scrolled units. Here is an example of using the {Wx::RegionIterator} class: # ```ruby # # Called when window needs to be repainted. # def on_paint(event) # self.paint do |dc| # # Find Out where the window has scrolled to # vb_pt = get_view_start # Top left corner of client # # Wx::RegionIterator.for_region(get_update_region) do |region_it| # region_it.each do |rct| # # rct == Dimensions of client area to repaint in pixels # # # Repaint this rectangle # ...some code... # end # end # end # end # ``` # #
# Remark: #

Please notice that in general it is impossible to change the drawing of a standard control (such as {Wx::Button}) and so you shouldn't attempt to handle paint events for them as even if it might work on some platforms, this is inherently not portable and won't work everywhere. #

#
# # ### Events using this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::PaintEvent} events. # Event handler methods: # # - {Wx::EvtHandler#evt_paint}(meth = nil, &block): Process a {Wx::EVT_PAINT} event. # # Category: {Wx::Events} # @see Events and Event Handling # # class PaintEvent < Event # Constructor for exclusive use of wxWidgets itself. # # Note that the objects of this class can not be created from application code, they're only created by the library itself. If you need a window to be repainted, use {Wx::Window#refresh} instead of trying to manually create an event of this class. # @param window [Wx::Window] # @return [Wx::PaintEvent] def initialize(window) end end # PaintEvent # An erase event is sent when a window's background needs to be repainted. # # On some platforms, such as GTK+, this event is simulated (simply generated just before the paint event) and may cause flicker. It is therefore recommended that you set the text background colour explicitly in order to prevent flicker. The default background colour under GTK+ is grey. # To intercept this event, use the EVT_ERASE_BACKGROUND macro in an event table definition. # You must use the device context returned by {Wx::EraseEvent#get_dc} to draw on, don't create a {Wx::PaintDC} in the event handler. # ### Events using this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::EraseEvent} events. # Event handler methods: # # - {Wx::EvtHandler#evt_erase_background}(meth = nil, &block): Process a {Wx::EVT_ERASE_BACKGROUND} event. # # Category: {Wx::Events} # @see Events and Event Handling # # class EraseEvent < Event # Constructor. # @param id [Integer] # @param dc [Wx::DC] # @return [Wx::EraseEvent] def initialize(id=0, dc=nil) end # Returns the device context associated with the erase event to draw on. # # The returned pointer is never NULL. # @return [Wx::DC] def get_dc; end alias_method :dc, :get_dc end # EraseEvent # A focus event is sent when a window's focus changes. # # The window losing focus receives a "kill focus" event while the window gaining it gets a "set focus" one. # Notice that the set focus event happens both when the user gives focus to the window (whether using the mouse or keyboard) and when it is done from the program itself using {Wx::Window#set_focus}. # The focus event handlers should almost invariably call {Wx::Event#skip} on their event argument to allow the default handling to take place. Failure to do this may result in incorrect behaviour of the native controls. Also note that {Wx::EVT_KILL_FOCUS} handler must not call {Wx::Window#set_focus} as this, again, is not supported by all native controls. If you need to do this, consider using the Delayed Action Mechanism described in {Wx::IdleEvent} documentation. # ### Events using this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::FocusEvent} events. # Event handler methods: # # - {Wx::EvtHandler#evt_set_focus}(meth = nil, &block): Process a {Wx::EVT_SET_FOCUS} event. # # - {Wx::EvtHandler#evt_kill_focus}(meth = nil, &block): Process a {Wx::EVT_KILL_FOCUS} event. # # Category: {Wx::Events} # @see Events and Event Handling # # class FocusEvent < Event # Constructor. # @param eventType [Wx::Notebook::EventType] # @param id [Integer] # @return [Wx::FocusEvent] def initialize(eventType=Wx::EVT_NULL, id=0) end # Returns the window associated with this event, that is the window which had the focus before for the {Wx::EVT_SET_FOCUS} event and the window which is going to receive focus for the {Wx::EVT_KILL_FOCUS} one. # # Warning: the window pointer may be NULL! # @return [Wx::Window] def get_window; end alias_method :window, :get_window # @param win [Wx::Window] # @return [void] def set_window(win) end alias_method :window=, :set_window end # FocusEvent # An activate event is sent when a window or application is being activated or deactivated. # # ### Events using this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::ActivateEvent} events. # Event handler methods: # # - {Wx::EvtHandler#evt_activate}(meth = nil, &block): Process a {Wx::EVT_ACTIVATE} event. # # - {Wx::EvtHandler#evt_activate_app}(meth = nil, &block): Process a {Wx::EVT_ACTIVATE_APP} event. This event is received by the {Wx::App}-derived instance only. # # - {Wx::EvtHandler#evt_hibernate}(meth = nil, &block): Process a hibernate event, supplying the member function. This event applies to {Wx::App} only, and only on Windows SmartPhone and PocketPC. It is generated when the system is low on memory; the application should free up as much memory as possible, and restore full working state when it receives a {Wx::EVT_ACTIVATE} or {Wx::EVT_ACTIVATE_APP} event. # #
# Note: #

Until wxWidgets 3.1.0 activation events could be sent by WXMSW when the window was minimized. This reflected the native MSW behaviour but was often surprising and unexpected, so starting from 3.1.0 such events are not sent any more when the window is in the minimized state. #

#
# # Category: {Wx::Events} # @see Events and Event Handling # @see Wx::App#is_active # # class ActivateEvent < Event # Specifies the reason for the generation of this event. # # See {Wx::ActivateEvent#get_activation_reason}. # class Reason < Wx::Enum # Window activated by mouse click. # Reason_Mouse = Wx::ActivateEvent::Reason.new(0) # Window was activated with some other method than mouse click. # Reason_Unknown = Wx::ActivateEvent::Reason.new(1) end # Reason # Constructor. # @param eventType [Wx::Notebook::EventType] # @param active [Boolean] # @param id [Integer] # @param activationReason [Wx::ActivateEvent::Reason] # @return [Wx::ActivateEvent] def initialize(eventType=Wx::EVT_NULL, active=true, id=0, activationReason=Wx::ActivateEvent::Reason::Reason_Unknown) end # Returns true if the application or window is being activated, false otherwise. # @return [Boolean] def get_active; end alias_method :active, :get_active # Allows checking if the window was activated by clicking it with the mouse or in some other way. # # This method is currently only implemented in WXMSW and returns Reason_Mouse there if the window was activated by a mouse click and Reason_Unknown if it was activated in any other way (e.g. from keyboard or programmatically). # Under all the other platforms, Reason_Unknown is always returned. # @return [Wx::ActivateEvent::Reason] def get_activation_reason; end alias_method :activation_reason, :get_activation_reason end # ActivateEvent # A {Wx::InitDialogEvent} is sent as a dialog or panel is being initialised. # # Handlers for this event can transfer data to the window. # The default handler calls {Wx::Window#transfer_data_to_window}. # ### Events using this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::InitDialogEvent} events. # Event handler methods: # # - {Wx::EvtHandler#evt_init_dialog}(meth = nil, &block): Process a {Wx::EVT_INIT_DIALOG} event. # # Category: {Wx::Events} # @see Events and Event Handling # # class InitDialogEvent < Event # Constructor. # @param id [Integer] # @return [Wx::InitDialogEvent] def initialize(id=0) end end # InitDialogEvent # This class is used for a variety of menu-related events. # # Note that these do not include menu command events, which are handled using {Wx::CommandEvent} objects. # Events of this class are generated by both menus that are part of a {Wx::MenuBar}, attached to {Wx::Frame}, and popup menus shown by {Wx::Window#popup_menu}. They are sent to the following objects until one of them handles the event: # # - The menu object itself, as returned by {Wx::MenuEvent#get_menu}, if any. # - The {Wx::MenuBar} to which this menu is attached, if any. # - The window associated with the menu, e.g. the one calling PopupMenu() for the popup menus. # - The top level parent of that window if it's different from the window itself. # # This is similar to command events generated by the menu items, but, unlike them, {Wx::MenuEvent} are only sent to the window itself and its top level parent but not any intermediate windows in the hierarchy. # The default handler for {Wx::EVT_MENU_HIGHLIGHT} in {Wx::Frame} displays help text in the status bar, see {Wx::Frame#set_status_bar_pane}. # ### Events using this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::MenuEvent} events. # Event handler methods: # # - {Wx::EvtHandler#evt_menu_open}(meth = nil, &block): A menu is about to be opened. On Windows, this is only sent once for each navigation of the menubar (up until all menus have closed). # # - {Wx::EvtHandler#evt_menu_close}(meth = nil, &block): A menu has been just closed. Notice that this event is currently being sent before the menu selection ({Wx::EVT_MENU}) event, if any. # # - {Wx::EvtHandler#evt_menu_highlight}(id, meth = nil, &block): The menu item with the specified id has been highlighted: used to show help prompts in the status bar by {Wx::Frame} # # - {Wx::EvtHandler#evt_menu_highlight_all}(meth = nil, &block): A menu item has been highlighted, i.e. the currently selected menu item has changed. # # Category: {Wx::Events} # @see Wx::CommandEvent # @see Events and Event Handling # # class MenuEvent < Event # Constructor. # @param type [Wx::Notebook::EventType] # @param id [Integer] # @param menu [Wx::Menu] # @return [Wx::MenuEvent] def initialize(type=Wx::EVT_NULL, id=0, menu=nil) end # Returns the menu which is being opened or closed, or the menu containing the highlighted item. # # Note that the returned value can be NULL if the menu being opened doesn't have a corresponding {Wx::Menu}, e.g. this happens when opening the system menu in WXMSW port. # #
# Remark: #

Since 3.1.3 this function can be used with OPEN, CLOSE and HIGHLIGHT events. Before 3.1.3, this method can only be used with the OPEN and CLOSE events. #

#
# @return [Wx::Menu] def get_menu; end alias_method :menu, :get_menu # Returns the menu identifier associated with the event. # # This method should be only used with the HIGHLIGHT events. # @return [Integer] def get_menu_id; end alias_method :menu_id, :get_menu_id # Returns true if the menu which is being opened or closed is a popup menu, false if it is a normal one. # # This method should only be used with the OPEN and CLOSE events. # @return [Boolean] def is_popup; end alias_method :popup?, :is_popup end # MenuEvent # This event class contains information about window and session close events. # # The handler function for EVT_CLOSE is called when the user has tried to close a a frame or dialog box using the window manager (X) or system menu (Windows). It can also be invoked by the application itself programmatically, for example by calling the {Wx::Window#close} function. # You should check whether the application is forcing the deletion of the window using {Wx::CloseEvent#can_veto}. If this is false, you must destroy the window using {Wx::Window#destroy}. # If the return value is true, it is up to you whether you respond by destroying the window. # If you don't destroy the window, you should call {Wx::CloseEvent#veto} to let the calling code know that you did not destroy the window. This allows the {Wx::Window#close} function to return true or false depending on whether the close instruction was honoured or not. # Example of a {Wx::CloseEvent} handler: # # ```ruby # def on_close(event) # if event.can_veto? && @file_not_saved # if Wx.message_box("The file has not been saved... continue closing?", # "Please confirm", # Wx::ICON_QUESTION | Wx::YES_NO) != Wx::YES) # event.veto # return # end # end # # destroy # you may also do: event.skip # # since the default event handler does call #destroy too # end # ``` # # See also samples/dialogs for a full example of interrupting closing an application when there are e.g. unsaved files. # The EVT_END_SESSION event is slightly different as it is sent by the system when the user session is ending (e.g. because of log out or shutdown) and so all windows are being forcefully closed. At least under MSW, after the handler for this event is executed the program is simply killed by the system. Because of this, the default handler for this event provided by wxWidgets calls all the usual cleanup code (including {Wx::App#on_exit}) so that it could still be executed and exit()s the process itself, without waiting for being killed. If this behaviour is for some reason undesirable, make sure that you define a handler for this event in your {Wx::App}-derived class and do not call event.Skip() in it (but be aware that the system will still kill your application). # ### Events using this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::CloseEvent} events. # Event handler methods: # # - {Wx::EvtHandler#evt_close}(meth = nil, &block): Process a {Wx::EVT_CLOSE_WINDOW} command event, supplying the member function. This event applies to {Wx::Frame} and {Wx::Dialog} classes. # # - {Wx::EvtHandler#evt_query_end_session}(meth = nil, &block): Process a {Wx::EVT_QUERY_END_SESSION} session event, supplying the member function. This event can be handled in {Wx::App}-derived class only. # # - {Wx::EvtHandler#evt_end_session}(meth = nil, &block): Process a {Wx::EVT_END_SESSION} session event, supplying the member function. This event can be handled in {Wx::App}-derived class only. # # Category: {Wx::Events} # @see Wx::Window#close # @see Window Deletion # # class CloseEvent < Event # Constructor. # @param commandEventType [Wx::Notebook::EventType] # @param id [Integer] # @return [Wx::CloseEvent] def initialize(commandEventType=Wx::EVT_NULL, id=0) end # Returns true if you can veto a system shutdown or a window close event. # # Vetoing a window close event is not possible if the calling code wishes to force the application to exit, and so this function must be called to check this. # @return [Boolean] def can_veto; end alias_method :can_veto?, :can_veto # Returns true if the user is just logging off or false if the system is shutting down. # # This method can only be called for end session and query end session events, it doesn't make sense for close window event. # @return [Boolean] def get_logging_off; end alias_method :logging_off, :get_logging_off # Sets the 'can veto' flag. # @param canVeto [Boolean] # @return [void] def set_can_veto(canVeto) end alias_method :can_veto=, :set_can_veto # Sets the 'logging off' flag. # @param loggingOff [Boolean] # @return [void] def set_logging_off(loggingOff) end alias_method :logging_off=, :set_logging_off # Call this from your event handler to veto a system shutdown or to signal to the calling application that a window close did not happen. # # You can only veto a shutdown if {Wx::CloseEvent#can_veto} returns true. # @param veto [Boolean] # @return [void] def veto(veto=true) end # Returns whether the Veto flag was set. # @return [Boolean] def get_veto; end end # CloseEvent # An event being sent when the window is shown or hidden. # # The event is triggered by calls to {Wx::Window#show}, and any user action showing a previously hidden window or vice versa (if allowed by the current platform and/or window manager). Notice that the event is not triggered when the application is iconized (minimized) or restored under WXMSW. # ### Events using this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::ShowEvent} events. # Event handler methods: # # - {Wx::EvtHandler#evt_show}(meth = nil, &block): Process a {Wx::EVT_SHOW} event. # # Category: {Wx::Events} # @see Events and Event Handling # @see Wx::Window#show # @see Wx::Window#is_shown # # class ShowEvent < Event # Constructor. # @param winid [Integer] # @param show [Boolean] # @return [Wx::ShowEvent] def initialize(winid=0, show=false) end # Set whether the windows was shown or hidden. # @param show [Boolean] # @return [void] def set_show(show) end alias_method :show=, :set_show # Return true if the window has been shown, false if it has been hidden. # @return [Boolean] def is_shown; end alias_method :shown?, :is_shown end # ShowEvent # An event being sent when the frame is iconized (minimized) or restored. # # ### Events using this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::IconizeEvent} events. # Event handler methods: # # - {Wx::EvtHandler#evt_iconize}(meth = nil, &block): Process a {Wx::EVT_ICONIZE} event. # # Category: {Wx::Events} # @see Events and Event Handling # @see Wx::TopLevelWindow#iconize # @see Wx::TopLevelWindow#is_iconized # # class IconizeEvent < Event # Constructor. # @param id [Integer] # @param iconized [Boolean] # @return [Wx::IconizeEvent] def initialize(id=0, iconized=true) end # Returns true if the frame has been iconized, false if it has been restored. # @return [Boolean] def is_iconized; end alias_method :iconized?, :is_iconized end # IconizeEvent # An event being sent when a top level window is maximized. # # Notice that it is not sent when the window is restored to its original size after it had been maximized, only a normal {Wx::SizeEvent} is generated in this case. # Currently this event is only generated in WXMSW, WXGTK and WXOSX/Cocoa ports so portable programs should only rely on receiving {Wx::EVT_SIZE} and not necessarily this event when the window is maximized. # ### Events using this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::MaximizeEvent} events. # Event handler methods: # # - {Wx::EvtHandler#evt_maximize}(meth = nil, &block): Process a {Wx::EVT_MAXIMIZE} event. # # Category: {Wx::Events} # @see Events and Event Handling # @see Wx::TopLevelWindow#maximize # @see Wx::TopLevelWindow#is_maximized # # class MaximizeEvent < Event # Constructor. # # Only used by wxWidgets internally. # @param id [Integer] # @return [Wx::MaximizeEvent] def initialize(id=0) end end # MaximizeEvent # An event being sent when the user enters or exits full screen mode. # # Currently this event is only generated in the WXOSX/Cocoa port when {Wx::TopLevelWindow#enable_full_screen_view} is enabled and the user the user enters or exits full screen. Note that this event is not generated when {Wx::TopLevelWindow#show_full_screen}. # ### Events using this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::FullScreenEvent} events. # Event handler methods: # # - {Wx::EvtHandler#evt_fullscreen}(meth = nil, &block): Process a {Wx::EVT_FULLSCREEN} event. # # Category: {Wx::Events} # @see Events and Event Handling # @see Wx::TopLevelWindow#enable_full_screen_view # @see Wx::TopLevelWindow#is_full_screen # # class FullScreenEvent < Event # Constructor. # @param id [Integer] # @param fullscreen [Boolean] # @return [Wx::FullScreenEvent] def initialize(id=0, fullscreen=true) end # Returns true if the frame entered full screen, false if exited full screen. # @return [Boolean] def is_full_screen; end alias_method :full_screen?, :is_full_screen end # FullScreenEvent # This event class contains information about joystick events, particularly events received by windows. # # ### Events using this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::JoystickEvent} events. # Event handler methods: # # - {Wx::EvtHandler#evt_joy_button_down}(meth = nil, &block): Process a {Wx::EVT_JOY_BUTTON_DOWN} event. # # - {Wx::EvtHandler#evt_joy_button_up}(meth = nil, &block): Process a {Wx::EVT_JOY_BUTTON_UP} event. # # - {Wx::EvtHandler#evt_joy_move}(meth = nil, &block): Process a {Wx::EVT_JOY_MOVE} event. # # - {Wx::EvtHandler#evt_joy_zmove}(meth = nil, &block): Process a {Wx::EVT_JOY_ZMOVE} event. # # - {Wx::EvtHandler#evt_joystick_events}(meth = nil, &block): Processes all joystick events. # # Category: {Wx::Events} # @see Wx::Joystick # # class JoystickEvent < Event # Constructor. # @param eventType [Wx::Notebook::EventType] # @param state [Integer] # @param joystick [Integer] # @param change [Integer] # @return [Wx::JoystickEvent] def initialize(eventType=Wx::EVT_NULL, state=0, joystick=wxJOYSTICK1, change=0) end # Returns true if the event was a down event from the specified button (or any button). # @param button [Integer] Can be {Wx::JOY_BUTTONn} where n is 1, 2, 3 or 4; or {Wx::JOY_BUTTON_ANY} to indicate any button down event. # @return [Boolean] def button_down(button=Wx::JOY_BUTTON_ANY) end # Returns true if the specified button (or any button) was in a down state. # @param button [Integer] Can be {Wx::JOY_BUTTONn} where n is 1, 2, 3 or 4; or {Wx::JOY_BUTTON_ANY} to indicate any button down event. # @return [Boolean] def button_is_down(button=Wx::JOY_BUTTON_ANY) end # Returns true if the event was an up event from the specified button (or any button). # @param button [Integer] Can be {Wx::JOY_BUTTONn} where n is 1, 2, 3 or 4; or {Wx::JOY_BUTTON_ANY} to indicate any button down event. # @return [Boolean] def button_up(button=Wx::JOY_BUTTON_ANY) end # Returns the identifier of the button changing state. # # The return value is # ``` # 1 << n # ``` # where n is the index of the button changing state, which can also be retrieved using {Wx::JoystickEvent#get_button_ordinal}. # Note that for n equal to 1, 2, 3 or 4 there are predefined {Wx::JOY_BUTTONn} constants which can be used for more clarity, however these constants are not defined for the buttons beyond the first four. # @return [Integer] def get_button_change; end alias_method :button_change, :get_button_change # Returns the 0-indexed ordinal of the button changing state. # # # @see Wx::JoystickEvent#get_button_change # @return [Integer] def get_button_ordinal; end alias_method :button_ordinal, :get_button_ordinal # Returns the down state of the buttons. # # This is a {Wx::JOY_BUTTONn} identifier, where n is one of 1, 2, 3, 4. # @return [Integer] def get_button_state; end alias_method :button_state, :get_button_state # Returns the identifier of the joystick generating the event - one of {Wx::JOYSTICK1} and {Wx::JOYSTICK2}. # @return [Integer] def get_joystick; end alias_method :joystick, :get_joystick # Returns the x, y position of the joystick event. # # These coordinates are valid for all the events except {Wx::EVT_JOY_ZMOVE}. # @return [Wx::Point] def get_position; end alias_method :position, :get_position # Returns the z position of the joystick event. # # This method can only be used for {Wx::EVT_JOY_ZMOVE} events. # @return [Integer] def get_z_position; end alias_method :z_position, :get_z_position # Returns true if this was a button up or down event (not 'is any button down?'). # @return [Boolean] def is_button; end alias_method :button?, :is_button # Returns true if this was an x, y move event. # @return [Boolean] def is_move; end alias_method :move?, :is_move # Returns true if this was a z move event. # @return [Boolean] def is_z_move; end alias_method :z_move?, :is_z_move end # JoystickEvent # This class is used for drop files events, that is, when files have been dropped onto the window. # # The window must have previously been enabled for dropping by calling {Wx::Window#drag_accept_files}. # Important note: this is a separate implementation to the more general drag and drop implementation documented in the Drag and Drop Overview. It uses the older, Windows message-based approach of dropping files. # ### Events using this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::DropFilesEvent} events. # Event handler methods: # # - {Wx::EvtHandler#evt_drop_files}(meth = nil, &block): Process a {Wx::EVT_DROP_FILES} event. # #
# Remark: #

Windows only until version 2.8.9, available on all platforms since 2.8.10. #

#
# # Category: {Wx::Events} # @see Events and Event Handling # @see Wx::Window#drag_accept_files # # class DropFilesEvent < Event # Constructor. # @param id [Wx::Notebook::EventType] # @param noFiles [Integer] # @param files [String] # @return [Wx::DropFilesEvent] def initialize(id=0, noFiles=0, files=nil) end # Returns an array of filenames. # @return [String] def get_files; end alias_method :files, :get_files # Returns the number of files dropped. # @return [Integer] def get_number_of_files; end alias_method :number_of_files, :get_number_of_files # Returns the position at which the files were dropped. # # Returns an array of filenames. # @return [Wx::Point] def get_position; end alias_method :position, :get_position end # DropFilesEvent # This class is used for pseudo-events which are called by wxWidgets to give an application the chance to update various user interface elements. # # Without update UI events, an application has to work hard to check/uncheck, enable/disable, show/hide, and set the text for elements such as menu items and toolbar buttons. The code for doing this has to be mixed up with the code that is invoked when an action is invoked for a menu item or button. # With update UI events, you define an event handler to look at the state of the application and change UI elements accordingly. wxWidgets will call your member functions in idle time, so you don't have to worry where to call this code. # In addition to being a clearer and more declarative method, it also means you don't have to worry whether you're updating a toolbar or menubar identifier. The same handler can update a menu item and toolbar button, if the identifier is the same. Instead of directly manipulating the menu or button, you call functions in the event object, such as {Wx::UpdateUIEvent#check}. wxWidgets will determine whether such a call has been made, and which UI element to update. # These events will work for popup menus as well as menubars. Just before a menu is popped up, {Wx::Menu::UpdateUI} is called to process any UI events for the window that owns the menu. # If you find that the overhead of UI update processing is affecting your application, you can do one or both of the following: # # - Call {Wx::UpdateUIEvent.set_mode} with a value of {Wx::UpdateUIMode::UPDATE_UI_PROCESS_SPECIFIED}, and set the extra style {Wx::WS_EX_PROCESS_UI_UPDATES} for every window that should receive update events. No other windows will receive update events. # # - Call {Wx::UpdateUIEvent.set_update_interval} with a millisecond value to set the delay between updates. You may need to call {Wx::Window#update_window_ui} at critical points, for example when a dialog is about to be shown, in case the user sees a slight delay before windows are updated. # # Note that although events are sent in idle time, defining a {Wx::IdleEvent} handler for a window does not affect this because the events are sent from {Wx::Window#on_internal_idle} which is always called in idle time. # wxWidgets tries to optimize update events on some platforms. On Windows and GTK+, events for menubar items are only sent when the menu is about to be shown, and not in idle time. # ### Events using this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::UpdateUIEvent} events. # Event handler methods: # # - {Wx::EvtHandler#evt_update_ui}(id, meth = nil, &block): Process a {Wx::EVT_UPDATE_UI} event for the command with the given id. # # - {Wx::EvtHandler#evt_update_ui_range}(id1, id2, meth = nil, &block): Process a {Wx::EVT_UPDATE_UI} event for any command with id included in the given range. # # Category: {Wx::Events} # @see Events and Event Handling # # class UpdateUIEvent < CommandEvent # Constructor. # @param commandId [Integer] # @return [Wx::UpdateUIEvent] def initialize(commandId=0) end # Check or uncheck the UI element. # @param check [Boolean] # @return [void] def check(check) end # Enable or disable the UI element. # @param enable [Boolean] # @return [void] def enable(enable) end # Returns true if the UI element should be checked. # @return [Boolean] def get_checked; end alias_method :checked, :get_checked # Returns true if the UI element should be enabled. # @return [Boolean] def get_enabled; end alias_method :enabled, :get_enabled # Returns true if the UI element can be checked. # # For the event handlers that can be used for multiple items, not all of which can be checked, this method can be useful to determine whether to call {Wx::UpdateUIEvent#check} on the event object or not, i.e. the main use case for this method is: # ```ruby # def on_update_ui(event) # .... # if event.is_checkable # event.check(...some condition...) # end # ``` # @return [Boolean] def is_checkable; end alias_method :checkable?, :is_checkable # Returns true if the application has called {Wx::UpdateUIEvent#check}. # # For wxWidgets internal use only. # @return [Boolean] def get_set_checked; end alias_method :set_checked, :get_set_checked # Returns true if the application has called {Wx::UpdateUIEvent#enable}. # # For wxWidgets internal use only. # @return [Boolean] def get_set_enabled; end alias_method :set_enabled, :get_set_enabled # Returns true if the application has called {Wx::UpdateUIEvent#show}. # # For wxWidgets internal use only. # @return [Boolean] def get_set_shown; end alias_method :set_shown, :get_set_shown # Returns true if the application has called {Wx::UpdateUIEvent#set_text}. # # For wxWidgets internal use only. # @return [Boolean] def get_set_text; end # Returns true if the UI element should be shown. # @return [Boolean] def get_shown; end alias_method :shown, :get_shown # Returns the text that should be set for the UI element. # @return [String] def get_text; end alias_method :text, :get_text # Sets the text for this UI element. # @param text [String] # @return [void] def set_text(text) end alias_method :text=, :set_text # Show or hide the UI element. # @param show [Boolean] # @return [void] def show(show) end # Returns true if it is appropriate to update (send UI update events to) this window. # # This function looks at the mode used (see {Wx::UpdateUIEvent.set_mode}), the {Wx::WS_EX_PROCESS_UI_UPDATES} flag in window, the time update events were last sent in idle time, and the update interval, to determine whether events should be sent to this window now. By default this will always return true because the update mode is initially {Wx::UpdateUIMode::UPDATE_UI_PROCESS_ALL} and the interval is set to 0; so update events will be sent as often as possible. You can reduce the frequency that events are sent by changing the mode and/or setting an update interval. # @see Wx::UpdateUIEvent.reset_update_time # @see Wx::UpdateUIEvent.set_update_interval # @see Wx::UpdateUIEvent.set_mode # @param window [Wx::Window] # @return [Boolean] def self.can_update(window) end # Static function returning a value specifying how wxWidgets will send update events: to all windows, or only to those which specify that they will process the events. # # # @see Wx::UpdateUIEvent.set_mode # @return [Wx::UpdateUIMode] def self.get_mode; end # Returns the current interval between updates in milliseconds. # # The value -1 disables updates, 0 updates as frequently as possible. # @see Wx::UpdateUIEvent.set_update_interval. # @return [Integer] def self.get_update_interval; end # Used internally to reset the last-updated time to the current time. # # It is assumed that update events are normally sent in idle time, so this is called at the end of idle processing. # @see Wx::UpdateUIEvent.can_update # @see Wx::UpdateUIEvent.set_update_interval # @see Wx::UpdateUIEvent.set_mode # @return [void] def self.reset_update_time; end # Specify how wxWidgets will send update events: to all windows, or only to those which specify that they will process the events. # @param mode [Wx::UpdateUIMode] this parameter may be one of the {Wx::UpdateUIMode} enumeration values. The default mode is {Wx::UpdateUIMode::UPDATE_UI_PROCESS_ALL}. # @return [void] def self.set_mode(mode) end # Sets the interval between updates in milliseconds. # # Set to -1 to disable updates, or to 0 to update as frequently as possible. The default is 0. # Use this to reduce the overhead of UI update events if your application has a lot of windows. If you set the value to -1 or greater than 0, you may also need to call {Wx::Window#update_window_ui} at appropriate points in your application, such as when a dialog is about to be shown. # @param updateInterval [Integer] # @return [void] def self.set_update_interval(updateInterval) end end # UpdateUIEvent # This class is used for system colour change events, which are generated when the user changes the colour settings or when the system theme changes (e.g. automatic dark mode switching on macOS). # # Event handlers for this event can access the new system colour settings through {Wx::SystemSettings.get_colour}. # #
# Remark: #

The default event handler for this event propagates the event to child windows, since the system events are only sent to top-level windows. If intercepting this event for a top-level window, remember to either call {Wx::Event#skip} on the event, call the base class handler, or pass the event on to the window's children explicitly. #

#
# # ### Events using this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::SysColourChangedEvent} events. # Event handler methods: # # - {Wx::EvtHandler#evt_sys_colour_changed}(meth = nil, &block): Process a {Wx::EVT_SYS_COLOUR_CHANGED} event. # # Category: {Wx::Events} # @see Events and Event Handling # # class SysColourChangedEvent < Event # Constructor. # @return [Wx::SysColourChangedEvent] def initialize; end end # SysColourChangedEvent # A mouse capture changed event is sent to a window that loses its mouse capture. # # This is called even if {Wx::Window#release_mouse} was called by the application code. Handling this event allows an application to cater for unexpected capture releases which might otherwise confuse mouse handling code. # Availability: only available for the WXMSW port. # ### Events using this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::MouseCaptureChangedEvent} events. # Event handler methods: # # - {Wx::EvtHandler#evt_mouse_capture_changed}(meth = nil, &block): Process a {Wx::EVT_MOUSE_CAPTURE_CHANGED} event. # # Category: {Wx::Events} # @see Wx::MouseCaptureLostEvent # @see Events and Event Handling # @see Wx::Window#capture_mouse # @see Wx::Window#release_mouse # @see Wx::Window.get_capture # # class MouseCaptureChangedEvent < Event # Constructor. # @param windowId [Integer] # @param gainedCapture [Wx::Window] # @return [Wx::MouseCaptureChangedEvent] def initialize(windowId=0, gainedCapture=nil) end # Returns the window that gained the capture, or NULL if it was a non-wxWidgets window. # @return [Wx::Window] def get_captured_window; end alias_method :captured_window, :get_captured_window end # MouseCaptureChangedEvent # A mouse capture lost event is sent to a window that had obtained mouse capture, which was subsequently lost due to an "external" event (for example, when a dialog box is shown or if another application captures the mouse). # # If this happens, this event is sent to all windows that are on the capture stack (i.e. called CaptureMouse, but didn't call ReleaseMouse yet). The event is not sent if the capture changes because of a call to CaptureMouse or ReleaseMouse. # This event is currently emitted under Windows only. # ### Events using this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::MouseCaptureLostEvent} events. # Event handler methods: # # - {Wx::EvtHandler#evt_mouse_capture_lost}(meth = nil, &block): Process a {Wx::EVT_MOUSE_CAPTURE_LOST} event. # # Availability: only available for the WXMSW port. # # Category: {Wx::Events} # @see Wx::MouseCaptureChangedEvent # @see Events and Event Handling # @see Wx::Window#capture_mouse # @see Wx::Window#release_mouse # @see Wx::Window.get_capture # # class MouseCaptureLostEvent < Event # Constructor. # @param windowId [Integer] # @return [Wx::MouseCaptureLostEvent] def initialize(windowId=0) end end # MouseCaptureLostEvent # A display changed event is sent to top-level windows when the display resolution has changed. # # This event is currently emitted under Windows only. # ### Events using this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::DisplayChangedEvent} events. # Event handler methods: # # - {Wx::EvtHandler#evt_display_changed}(meth = nil, &block): Process a {Wx::EVT_DISPLAY_CHANGED} event. # # Availability: only available for the WXMSW port. # # Category: {Wx::Events} # @see Wx::Display # # class DisplayChangedEvent < Event # @return [Wx::DisplayChangedEvent] def initialize; end end # DisplayChangedEvent # Event sent when the display scale factor or pixel density (measured in dots-per-inch, or DPI) of the monitor a window is on changes. # # The event is sent to each {Wx::TopLevelWindow} affected by the change, and all its children recursively (post-order traversal). For example, this event is sent to the window when it is moved, by the user, from a display using some DPI value to another display using a different DPI value. It also sent to all program windows on the given display if its DPI changes due to a change in the system settings. # If you define an event handler for this event, you should almost always call event.Skip() in it in order to allow the base class handler to execute, as many controls rely on processing this event in order to update their appearance when the DPI changes. However the default handler for the top level window itself only sets the new window size, by scaling the current size by the DPI ratio e.g. doubling it if the DPI has changed from normal to "high", i.e. 200%, one and also ensuring that the window is still bigger than its best size, as returned by {Wx::Window#get_best_size}. Note that in some cases this may cause the window size to grow unexpectedly and you may prefer to call {Wx::Window#set_size} in your handler of this event for the top level window and not call event.Skip() to prevent the default handler from resizing the window. # Currently this event is generated by WXMSW port if only and only if the MSW application runs under Windows 10 Creators Update (v1703) or later and is marked as being "per-monitor DPI aware", i.e. contains a dpiAwareness tag with the value "PerMonitorV2" in its manifest (see Microsoft "Application Manifests" documentation for more details). # ### Events using this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::DPIChangedEvent} events. # Event handler methods: # # - {Wx::EvtHandler#evt_dpi_changed}(meth = nil, &block): Process a {Wx::EVT_DPI_CHANGED} event. # # Category: {Wx::Events} # @see Events and Event Handling # # class DPIChangedEvent < Event # Returns the old DPI. # @return [Wx::Size] def get_old_dpi; end alias_method :old_dpi, :get_old_dpi # Returns the new DPI. # @return [Wx::Size] def get_new_dpi; end alias_method :new_dpi, :get_new_dpi # Rescale a value in pixels to match the new DPI. # # This is a convenience function to use in {Wx::EVT_DPI_CHANGED} event handlers, as they often need to update some sizes to the new DPI. It simply calls {mul_div_int32} with new and old DPI values, but is more readable and less error-prone. # For example, the returned value will be twice bigger than the original one when switching from normal (96) DPI to high (2x, 192) DPI. # @param sz [Wx::Size] # @return [Wx::Size] def scale(sz) end # Rescale horizontal component to match the new DPI. # # This is the same as {Wx::DPIChangedEvent#scale}, but for the horizontal component only. # @param x [Integer] # @return [Integer] def scale_x(x) end # Rescale vertical component to match the new DPI. # # This is the same as {Wx::DPIChangedEvent#scale}, but for the vertical component only. # @param y [Integer] # @return [Integer] def scale_y(y) end end # DPIChangedEvent # # # # class PaletteChangedEvent < Event # @param winid [Integer] # @return [Wx::PaletteChangedEvent] def initialize(winid=0) end # @param win [Wx::Window] # @return [void] def set_changed_window(win) end alias_method :changed_window=, :set_changed_window # @return [Wx::Window] def get_changed_window; end alias_method :changed_window, :get_changed_window end # PaletteChangedEvent # # # # class QueryNewPaletteEvent < Event # @param winid [Integer] # @return [Wx::QueryNewPaletteEvent] def initialize(winid=0) end # @param realized [Boolean] # @return [void] def set_palette_realized(realized) end alias_method :palette_realized=, :set_palette_realized # @return [Boolean] def get_palette_realized; end alias_method :palette_realized, :get_palette_realized end # QueryNewPaletteEvent # This event class contains information about navigation events, generated by navigation keys such as tab and page down. # # This event is mainly used by wxWidgets implementations. A {Wx::NavigationKeyEvent} handler is automatically provided by wxWidgets when you enable keyboard navigation inside a window by inheriting it from {Wx::NavigationEnabled}<>. # ### Events using this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::NavigationKeyEvent} events. # Event handler methods: # # - {Wx::EvtHandler#evt_navigation_key}(meth = nil, &block): Process a navigation key event. # # Category: {Wx::Events} # @see Wx::Window#navigate # @see Wx::Window#navigate_in # # class NavigationKeyEvent < Event # Flags which can be used with {Wx::NavigationKeyEvent}. # # # class NavigationKeyEventFlags < Wx::Enum # # IsBackward = Wx::NavigationKeyEvent::NavigationKeyEventFlags.new(0) # # IsForward = Wx::NavigationKeyEvent::NavigationKeyEventFlags.new(1) # # WinChange = Wx::NavigationKeyEvent::NavigationKeyEventFlags.new(2) # # FromTab = Wx::NavigationKeyEvent::NavigationKeyEventFlags.new(4) end # NavigationKeyEventFlags # @overload initialize() # @return [Wx::NavigationKeyEvent] # @overload initialize(event) # @param event [Wx::NavigationKeyEvent] # @return [Wx::NavigationKeyEvent] def initialize(*args) end # Returns the child that has the focus, or NULL. # @return [Wx::Window] def get_current_focus; end alias_method :current_focus, :get_current_focus # Returns true if the navigation was in the forward direction. # @return [Boolean] def get_direction; end alias_method :direction, :get_direction # Returns true if the navigation event was from a tab key. # # This is required for proper navigation over radio buttons. # @return [Boolean] def is_from_tab; end alias_method :from_tab?, :is_from_tab # Returns true if the navigation event represents a window change (for example, from Ctrl-Page Down in a notebook). # @return [Boolean] def is_window_change; end alias_method :window_change?, :is_window_change # Sets the current focus window member. # @param currentFocus [Wx::Window] # @return [void] def set_current_focus(currentFocus) end alias_method :current_focus=, :set_current_focus # Sets the direction to forward if direction is true, or backward if false. # @param direction [Boolean] # @return [void] def set_direction(direction) end alias_method :direction=, :set_direction # Sets the flags for this event. # # The flags can be a combination of the {Wx::NavigationKeyEvent::NavigationKeyEventFlags} values. # @param flags [Integer] # @return [void] def set_flags(flags) end alias_method :flags=, :set_flags # Marks the navigation event as from a tab key. # @param fromTab [Boolean] # @return [void] def set_from_tab(fromTab) end alias_method :from_tab=, :set_from_tab # Marks the event as a window change event. # @param windowChange [Boolean] # @return [void] def set_window_change(windowChange) end alias_method :window_change=, :set_window_change end # NavigationKeyEvent # This event is sent just after the actual window associated with a {Wx::Window} object has been created. # # Since it is derived from {Wx::CommandEvent}, the event propagates up the window hierarchy. # ### Events using this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::WindowCreateEvent} events. # Event handler methods: # # - {Wx::EvtHandler#evt_window_create}(meth = nil, &block): Process a {Wx::EVT_CREATE} event. # # Category: {Wx::Events} # @see Events and Event Handling # @see Wx::WindowDestroyEvent # # class WindowCreateEvent < CommandEvent # Constructor. # @param win [Wx::Window] # @return [Wx::WindowCreateEvent] def initialize(win=nil) end # Return the window being created. # @return [Wx::Window] def get_window; end alias_method :window, :get_window end # WindowCreateEvent # This event is sent as early as possible during the window destruction process. # # For the top level windows, as early as possible means that this is done by {Wx::Frame} or {Wx::Dialog} destructor, i.e. after the destructor of the derived class was executed and so any methods specific to the derived class can't be called any more from this event handler. If you need to do this, you must call {Wx::Window#send_destroy_event} from your derived class destructor. # For the child windows, this event is generated just before deleting the window from {Wx::Window#destroy} (which is also called when the parent window is deleted) or from the window destructor if operator delete was used directly (which is not recommended for this very reason). # It is usually pointless to handle this event in the window itself but it ca be very useful to receive notifications about the window destruction in the parent window or in any other object interested in this window. # # Category: {Wx::Events} # @see Events and Event Handling # @see Wx::WindowCreateEvent # # class WindowDestroyEvent < CommandEvent # Constructor. # @param win [Wx::Window] # @return [Wx::WindowDestroyEvent] def initialize(win=nil) end # Return the window being destroyed. # @return [Wx::Window] def get_window; end alias_method :window, :get_window end # WindowDestroyEvent # A help event is sent when the user has requested context-sensitive help. # # This can either be caused by the application requesting context-sensitive help mode via {Wx::ContextHelp}, or (on MS Windows) by the system generating a WM_HELP message when the user pressed F1 or clicked on the query button in a dialog caption. # A help event is sent to the window that the user clicked on, and is propagated up the window hierarchy until the event is processed or there are no more event handlers. # The application should call {Wx::Event#get_id} to check the identity of the clicked-on window, and then either show some suitable help or call {Wx::Event#skip} if the identifier is unrecognised. # Calling Skip is important because it allows wxWidgets to generate further events for ancestors of the clicked-on window. Otherwise it would be impossible to show help for container windows, since processing would stop after the first window found. # ### Events using this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::HelpEvent} events. # Event handler methods: # # - {Wx::EvtHandler#evt_help}(id, meth = nil, &block): Process a {Wx::EVT_HELP} event. # # - {Wx::EvtHandler#evt_help_range}(id1, id2, meth = nil, &block): Process a {Wx::EVT_HELP} event for a range of ids. # # Category: {Wx::Events} # @see Wx::ContextHelp # @see Wx::Dialog # @see Events and Event Handling # # class HelpEvent < CommandEvent # Indicates how a {Wx::HelpEvent} was generated. # # # class Origin < Wx::Enum # unrecognized event source. # Origin_Unknown = Wx::HelpEvent::Origin.new(0) # event generated from F1 key press. # Origin_Keyboard = Wx::HelpEvent::Origin.new(1) # event generated by {Wx::ContextHelp} or from the [?] button on the title bar (Windows). # Origin_HelpButton = Wx::HelpEvent::Origin.new(2) end # Origin # Constructor. # @param type [Wx::Notebook::EventType] # @param winid [Integer] # @param pt [Array(Integer, Integer), Wx::Point] # @param origin [Wx::HelpEvent::Origin] # @return [Wx::HelpEvent] def initialize(type=Wx::EVT_NULL, winid=0, pt=Wx::DEFAULT_POSITION, origin=Wx::HelpEvent::Origin::Origin_Unknown) end # Returns the origin of the help event which is one of the {Wx::HelpEvent::Origin} values. # # The application may handle events generated using the keyboard or mouse differently, e.g. by using {get_mouse_position} for the mouse events. # @see Wx::HelpEvent#set_origin # @return [Wx::HelpEvent::Origin] def get_origin; end alias_method :origin, :get_origin # Returns the left-click position of the mouse, in screen coordinates. # # This allows the application to position the help appropriately. # @return [Wx::Point] def get_position; end alias_method :position, :get_position # Set the help event origin, only used internally by wxWidgets normally. # # # @see Wx::HelpEvent#get_origin # @param origin [Wx::HelpEvent::Origin] # @return [void] def set_origin(origin) end alias_method :origin=, :set_origin # Sets the left-click position of the mouse, in screen coordinates. # @param pt [Array(Integer, Integer), Wx::Point] # @return [void] def set_position(pt) end alias_method :position=, :set_position end # HelpEvent # This class represents the events generated by a control (typically a {Wx::TextCtrl} but other windows can generate these events as well) when its content gets copied or cut to, or pasted from the clipboard. # # There are three types of corresponding events {Wx::EVT_TEXT_COPY}, {Wx::EVT_TEXT_CUT} and {Wx::EVT_TEXT_PASTE}. # If any of these events is processed (without being skipped) by an event handler, the corresponding operation doesn't take place which allows preventing the text from being copied from or pasted to a control. It is also possible to examine the clipboard contents in the PASTE event handler and transform it in some way before inserting in a control for example, changing its case or removing invalid characters. # Finally notice that a CUT event is always preceded by the COPY event which makes it possible to only process the latter if it doesn't matter if the text was copied or cut. # #
# Note: #

These events are currently only generated by {Wx::TextCtrl} in WXGTK and WXOSX but are also generated by {Wx::ComboBox} without {Wx::CB_READONLY} style in WXMSW. #

#
# # ### Events using this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::ClipboardTextEvent} events. # Event handler methods: # # - {Wx::EvtHandler#evt_text_copy}(id, meth = nil, &block): Some or all of the controls content was copied to the clipboard. # # - {Wx::EvtHandler#evt_text_cut}(id, meth = nil, &block): Some or all of the controls content was cut (i.e. copied and deleted). # # - {Wx::EvtHandler#evt_text_paste}(id, meth = nil, &block): Clipboard content was pasted into the control. # # Category: {Wx::Events} # @see Wx::Clipboard # # class ClipboardTextEvent < CommandEvent # Constructor. # @param commandType [Wx::Notebook::EventType] # @param id [Integer] # @return [Wx::ClipboardTextEvent] def initialize(commandType=Wx::EVT_NULL, id=0) end end # ClipboardTextEvent # This class is used for context menu events, sent to give the application a chance to show a context (popup) menu for a {Wx::Window}. # # Note that if {Wx::ContextMenuEvent#get_position} returns {Wx::DEFAULT_POSITION}, this means that the event originated from a keyboard context button event, and you should compute a suitable position yourself, for example by calling {get_mouse_position}. # Notice that the exact sequence of mouse events is different across the platforms. For example, under MSW the context menu event is generated after EVT_RIGHT_UP event and only if it was not handled but under GTK the context menu event is generated after EVT_RIGHT_DOWN event. This is correct in the sense that it ensures that the context menu is shown according to the current platform UI conventions and also means that you must not handle (or call {Wx::Event#skip} in your handler if you do have one) neither right mouse down nor right mouse up event if you plan on handling EVT_CONTEXT_MENU event. # ### Events using this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::ContextMenuEvent} events. # Event handler methods: # # - {Wx::EvtHandler#evt_context_menu}(meth = nil, &block): A right click (or other context menu command depending on platform) has been detected. # # Category: {Wx::Events} # @see Wx::CommandEvent # @see Events and Event Handling # # class ContextMenuEvent < CommandEvent # Constructor. # @param type [Wx::Notebook::EventType] # @param id [Integer] # @param pos [Array(Integer, Integer), Wx::Point] # @return [Wx::ContextMenuEvent] def initialize(type=Wx::EVT_NULL, id=0, pos=Wx::DEFAULT_POSITION) end # Returns the position in screen coordinates at which the menu should be shown. # # Use {Wx::Window#screen_to_client} to convert to client coordinates. # You can also omit a position from {Wx::Window#popup_menu} in order to use the current mouse pointer position. # If the event originated from a keyboard event, the value returned from this function will be {Wx::DEFAULT_POSITION}. # @return [Wx::Point] def get_position; end alias_method :position, :get_position # Sets the position at which the menu should be shown. # @param point [Array(Integer, Integer), Wx::Point] # @return [void] def set_position(point) end alias_method :position=, :set_position end # ContextMenuEvent # A child focus event is sent to a (parent-)window when one of its child windows gains focus, so that the window could restore the focus back to its corresponding child if it loses it now and regains later. # # Notice that child window is the direct child of the window receiving event. Use {Wx::Window.find_focus} to retrieve the window which is actually getting focus. # ### Events using this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::ChildFocusEvent} events. # Event handler methods: # # - {Wx::EvtHandler#evt_child_focus}(meth = nil, &block): Process a {Wx::EVT_CHILD_FOCUS} event. # # Category: {Wx::Events} # @see Events and Event Handling # # class ChildFocusEvent < CommandEvent # Constructor. # @param win [Wx::Window] The direct child which is (or which contains the window which is) receiving the focus. # @return [Wx::ChildFocusEvent] def initialize(win=nil) end # Returns the direct child which receives the focus, or a (grand-)parent of the control receiving the focus. # # To get the actually focused control use {Wx::Window.find_focus}. # @return [Wx::Window] def get_window; end alias_method :window, :get_window end # ChildFocusEvent end