Every event method takes exactly one parameter called levent. This can be
nil, Hash, or an Levent
object. Most events triggered by the GUI binding will automatically create
one of these for the event, see Locana_gui.trigger_gui_event for more
details. These two event calls are equivalent:
on_key_press(:keycode=>32) is the same as
on_key_press(Levent.new(:keycode=>32))
While this can contain any key/value pair you want to use, here are the
standard key/value pairs used by Locana:
- :keycode - :on_key_press and :on_key_release
- :x, :y - the screen relative pixel position of the mouse for all mouse
related events, also the new x,y position of the window during an on_move event
- :new_w, :new_h - the new width and height during :on_resize events
- :shift_key - true when the shift
key is pressed during the event, this will not exist if the shift key was
not pressed during the event
- :ctrl_key - true when the ctrl key
is pressed during the event, this will not exist if the ctrl key was not
pressed during the event
- :alt_key - true when the alt key
is pressed during the event, this will not exist if the alt key was not
pressed during the event
- :meta_key - true when the alt key
is pressed during the event, this will not exist if the meta key was not
pressed during the event
- :value - the value associated with this event in the on_after_update, on_before_update, and on_change events.
- :object - the object associated with this event, this could be nil or
non-existent for some events. For example, the on_mouse_lup will clear this when
mouse is not over the same object during the up as the down. This allows
you to tell when the on_mouse_up has occurred but the mouse has actually
moved over another object.
- :ievent - the symbol representing the event
event_values_to_str,
inspect,
keychar,
new,
skip_events,
skipping_events?,
supported_events,
supported_keycodes,
to_s,
trap_events,
trap_events=,
Included modules
This allows you forward all events (via process_event) to proc_object before Locana process them. This is great for monitoring
events taking place. The Locana GUI Builder uses
this to put event in the monitor events window. If proc_object does not
cancel the event (raise CancelEvent), Locana will still process it.
Returns the proc_object assigned to trap all events. This will return nil
if events are not being trapped.
This allows you to process actions that will not fire Locana events. For example:
Levent.skip_events do
do stuff
end
Opening the combobox list boxes and Lmenu objects
use this to ignore unwanted on_exit and on_enter events from the GUI. This
also tells the GUI to stop sending events.
Return true if we are in a state of skipping events.
Allow Lobject to access the Hash of supported events, mostly for the Locana GUI Builder.
The GUI binding should create this and make sure values (a Hash) has the following keys:
- :keycode - :on_key_press and :on_key_release
- :x, :y - the screen relative pixel position of the mouse for all mouse
related events and on_move events
- :new_w, :new_h - the new width and height of the window, only for :on_resize events
- :shift_key - true with the shift
key is pressed during the event, or nil if not pressed
- :ctrl_key - true with the ctrl key
is pressed during the event, or nil if not pressed
- :alt_key - true with the alt key
is pressed during the event, or nil if not pressed
- :meta_key - true with the alt key
is pressed during the event, or nil if not pressed
- :value - the value associated with this event for the on_change, on_after_update, and on_before_update events
- :object - the object associated with this event
- :ievent - the symbol representing the event
Converts keycode to the the actual character (‘a’,
‘A’, etc) or a symbol (such as :F1, :F3, :Up, :Down, :Left,
:Right, etc.).
Returns a Hash of supported keycode translations.
This will return a string of event values nicely formatted for printing and
displaying in an event monitoring window. The Locana GUI Builder calls this when putting values
into the event monitor’s listbox.
Thank you for taking the time to visit this web page. I trust you found the information contained in this page useful.
Please email any questions, concerns, or issues with this web site to webmaster@sevasoftware.com.
Please remember Seva Software when your company would benefit from an experienced database architect and software engineer.