Class: Wx::FocusEvent
Overview
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 Window#set_focus. The focus event handlers should almost invariably call 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 EVT_KILL_FOCUS handler must not call 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 IdleEvent documentation.
Events using this class
The following event-handler methods redirect the events to member method or handler blocks for FocusEvent events. Event handler methods:
-
EvtHandler#evt_set_focus(meth = nil, &block): Process a EVT_SET_FOCUS event.
-
EvtHandler#evt_kill_focus(meth = nil, &block): Process a EVT_KILL_FOCUS event.
Category: Events
Instance Method Summary collapse
-
#get_window ⇒ Wx::Window
(also: #window)
Returns the window associated with this event, that is the window which had the focus before for the EVT_SET_FOCUS event and the window which is going to receive focus for the EVT_KILL_FOCUS one.
-
#initialize(eventType = Wx::EVT_NULL, id = 0) ⇒ Wx::FocusEvent
constructor
Constructor.
- #set_window(win) ⇒ void (also: #window=)
Methods inherited from Event
#clone, #get_event_category, #get_event_object, #get_event_type, #get_id, #get_skipped, #get_timestamp, #is_command_event, #resume_propagation, #set_event_object, #set_event_type, #set_id, #set_timestamp, #should_propagate, #skip, #stop_propagation
Methods inherited from Object
#clone, #dup, #is_same_as, #un_share
Constructor Details
#initialize(eventType = Wx::EVT_NULL, id = 0) ⇒ Wx::FocusEvent
Constructor.
1567 |
# File 'lib/wx/doc/gen/events.rb', line 1567 def initialize(eventType=Wx::EVT_NULL, id=0) end |
Instance Method Details
#get_window ⇒ Wx::Window Also known as: window
Returns the window associated with this event, that is the window which had the focus before for the EVT_SET_FOCUS event and the window which is going to receive focus for the EVT_KILL_FOCUS one.
Warning: the window pointer may be NULL!
1573 |
# File 'lib/wx/doc/gen/events.rb', line 1573 def get_window; end |
#set_window(win) ⇒ void Also known as: window=
This method returns an undefined value.
1578 |
# File 'lib/wx/doc/gen/events.rb', line 1578 def set_window(win) end |