Class
Levent
Home
In: locana/l_event.rb
Parent: Hash

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:

Methods

event_values_to_str, inspect, keychar, new, skip_events, skipping_events?, supported_events, supported_keycodes, to_s, trap_events, trap_events=,
Included modules

Levent_method
Public Class methods
trap_events=(proc_object) src

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.

trap_events() src

Returns the proc_object assigned to trap all events. This will return nil if events are not being trapped.

skip_events() {|| ...} src

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.

skipping_events?() src

Return true if we are in a state of skipping events.

supported_events() src

Allow Lobject to access the Hash of supported events, mostly for the Locana GUI Builder.

new(values=nil) src

The GUI binding should create this and make sure values (a Hash) has the following keys:

keychar(keycode) src

Converts keycode to the the actual character (‘a’, ‘A’, etc) or a symbol (such as :F1, :F3, :Up, :Down, :Left, :Right, etc.).

supported_keycodes() src

Returns a Hash of supported keycode translations.

Public Instance methods
event_values_to_str() src

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.

to_s() src

Calls event_values_to_str() to format the content of the event.

inspect() src

Alias for to_s.


Seva Software


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.

http://www.arunadb.org http://www.locana.org http://www.ruby-lang.org http://www.coolwell.org http://www.sevasoftware.com