Lobject is the base class for all Locana objects. It is based on the Hash class because an object is a collection of
working attributes that are stored in the Hash.
Basically, the object is a collection of working attributes including
attributes gathered from themes and inherited from parent objects. All
objects have two set of attributes, the first is the working attribute
described above. It contains all stored attributes and all inherited
attributes from themes and parent objects. The second set is called stored
attributes. These are attributes directly specified for this object and are
saved. These are stored in an instance variable called @oattr. Supported
object attributes:
- :pos => "The position [x,y,w,h] in pixels of the object within its
parent. w and h are optional.",
- :sticky => "Allows you to ‘stick’ the object to one or
more of it’s parents borders. Any combination of nsew can be used. :n
is the top border, :s is the bottom border, :w is the left border, :e is
the right border. The default is :nw. This attribute is ignored when using
the :pos(x,y,w,h) attribute.",
- :above => ":above=>:object_name will place the object directly
above :object_name. Basically, object.x = :object_name.x and object.y =
:object_name.y - object.h. Use :above=>:prev to place the object
directly above the previously added object. :prev is ignored for the first
object in a group or window. This attribute is ignored when using the
:pos(x,y,w,h) attribute.",
- :below => ":below=>:object_name will place the object directly
below :object_name. Basically, object.x = :object_name.x and object.y =
:object_name.y + object_name.h. Use :below=>:prev to place the object
directly below the previously added object. :prev is ignored for the first
object in a group or window. This attribute is ignored when using the
:pos(x,y,w,h) attribute.",
- :before => ":before=>:object_name will place the object directly
before :object_name. Basically, object.x = :object_name.x - object.w and
object.y = :object_name.y. Use :before=>:prev to place the object
directly before the previously added object. :prev is ignored for the first
object in a group or window. This attribute is ignored when using the
:pos(x,y,w,h) attribute.",
- :after => ":after=>:object_name will place the object directly
after :object_name. Basically object.y = :object_name.y + :object_name.w
and object.y = :object_name.y. Use :after=>:prev to place the object
directly after the previously added object. :prev is ignored for the first
object in a group or window. This attribute is ignored when using the
:pos(x,y,w,h) attribute.",
- :spanw => ":spanw=>:object_name will cause this objects width to
match :object_name.x + :object_name.w. This attribute is ignored when using
the :pos(x,y,w,h) attribute.",
- :spanh => ":spanh=>:object_name will cause this objects height
to match :object_name.y + :object_name.h. This attribute is ignored when
using the :pos(x,y,w,h) attribute.",
- :startx => ":startx=>:object_name will cause this objects x to
match :object_name.x. This attribute is ignored when using the
:pos(x,y,w,h) attribute.",
- :starty => ":starty=>:object_name will cause this objects y to
match :object_name.y. This attribute is ignored when using the
:pos(x,y,w,h) attribute.",
- :padx => "Allows you specify the number of pixels to add (or pad)
to the left and right of the object, this is ignored when using the
:pos(x,y,w,h) attribute.",
- :pady => "Allows you specify the number of pixels to add (or pad)
to the top and bottom of the object, this is ignored when using the
:pos(x,y,w,h) attribute.",
- :ipadx => "Allows you specify the number of pixels to add (or pad)
to the inside edge of the left/right border of group and window objects,
this allows you to introduce a little extra padding around the inside edge
of the border of objects. :ipadx is short for internal padx.",
- :ipady => "Allows you specify the number of pixels to add (or pad)
to the inside edge of the top/bottom border of group and window objects,
this allows you to introduce a little extra padding around the inside edge
of the border of objects. :ipady is short for internal pady.",
- :width => "The width in pixels of the object within its parent. You
can use :width=>’75%’ (quotes are required) to tell object
to use 75% of the parents width.",
- :height => "The height in pixels of the object within its parent.
You can use :height=>’50%’ (quotes are required) to tell
object to use 50% of the parents height.",
- :text => "The text, label, or title for this object, this is a
string for most objects, this is an array of strings for listbox and
combobox objects.",
- :state => "The state of this object. The values are: nil(seen and
enabled), :not_visible(object is not seen), :disabled(grayed out and not
editable), or :locked(not editable).",
- :otype => "This is used to provide additional characteristics for
the object.
- Lwindow supports :modal (the window becomes a
modal dialog box) and :topmost (the window will always be on top of the
display).
- Llistbox supports :single (the default, a
single item can be selected), :multiple(many items can be selected),
:extended(many items can be selected when using the control/shift key).
- Lcombobox supports :allow_any_value (any value
can be typed into the combobox), the default is that only value in the
:text attribute (listbox) can be typed into the combobox.
- Ldatebox support :include_time, when true, the
time will be included with the date.
- :border => "The type of the border to use. Values are: :none for no
border, :groove, :raised, :ridge, :solid, or :sunken. Lborder.supported_borders will return a Hash of supported borders.",
- :bwidth => "The number representing the thickness of the border.
The default is the default thickness of the border when :border is
set.",
- :vscroll => "Values are nil, :off, :on, :auto. :on turns a vertical
scroll bar on; :off turns the scroll bar off; :auto turns the scroll bar
only when needed. nil uses the default setting for objects (:auto in most
cases). The scroll bar sits on the right edge of the object. Lframe, Llistbox, and Leditbox objects currently support this
attribute.",
- :hscroll => "Values are nil, :off, :on, :auto. :on turns a
horizontal scroll bar on; :off turns the scroll bar off; :auto turns the
scroll bar only when needed. nil uses the default setting for objects
(:auto in most cases). The scroll bar sits on the bottom edge of the
object. Lframe, Llistbox, and Leditbox
objects currently support this attribute.",
- :justify => "Specify how text is justified horizontally inside this
object. Valid values are :left, :center, or :right.",
- :align => "Specify how text is justified vertically inside this
object. Valid values are :top, :middle, or :bottom.",
- :mouse_cursor => "This allows you to set the cursor you would like
to see when the mouse is over this object. The value is a symbol of the one
of the supported mouse cursors. The default is :arrow.",
- :allow_sizing => "When true, the user can click on the border of
this object and re-size it. Locana will track
mouse movements over the border of the object, automatically change the
mouse cursor, and allow you to resize while clicking and dragging in the
border. The object can’t be larger than it’s parent.",
- :allow_dragging =>
"When true, the user can click on this object and drag it around in
it’s parent. The object can’t leave it’s parent.",
- :allow_dragging_parent => "When true, the user can click on this
object and drag it’s parent around in it’s parent window/group.
The parent object can’t leave it’s parent.",
- :min_width => "The minimum width
in pixels of the object. This is only used when resizing the object to keep
it from getting too small.",
- :min_height => "The minimum
height in pixels of the object. This is only used when resizing the object
to keep it from getting too small.",
- :tab_order => "A number specifying the tab order, use a symbol such
as :none to keep this object out of the tab order, if two objects have the
same tab order, they will work in the order the objects are added. The
default is 1 for most objects.",
- :value => "The data in the object. This is a string for textbox,
editbox, password, and combobox. This is true if a checkbox is checked,
false if not checked. This is true if radiobox is selected, false if not
selected. This is the index or array of indexes (number starting from 0) of
the selected item(s) in a listbox.",
- :dirty => "True when this object has been updated or changed. This
can be used to tell if the user has changed anything. This is automatically
set in the on_change event is used to
trigger the on_before_update and on_after_update events.",
- :help => "Balloon help if supported by the GUI Binding. Pressing
the F1 key will open the help if the user has not trapped the on_key_release or on_f1_key event. This will popup in the
parent window after 3 seconds. You can change the duration or disable
balloon help using Locana::balloon_help().",
- :owner => "this is used by the Lcombobox, Ldatebox,
and Lmenu to hold the owning object if this object
was created to support another Locana object. Locana uses this for internally added objects to
track when objects are owned by another object. In many cases this will
match the parent.",
- :has_popup => "This points to the popup menu for this window or
frame, if there is one. The Lmenu object will
automatically set this when adding a popup menu to a window or frame.
Clicking the right mouse button will automatically activate the first
existing popup menu.",
- :has_menubar=> "This Points to the menubar in this window or frame,
if there is one.",
- :bcolor => "The color of the border. Children inherent this
attribute from their parent.",
- :fg => "Text or foreground or text color. Children inherent this
attribute from their parent. A list of supported color names can be found
at www.sevasoftware.com/screen_shots/supported_colors1.html.",
- :bg => "Background color. Children inherent this attribute from
their parent. A list of supported color names can be found at www.sevasoftware.com/screen_shots/supported_colors1.html.",
- :fg_disabled => "Text or Foreground color when the object is
disabled.",
- :bg_disabled => "Background color when the object is disabled. The
default is the objects background color (:bg attribute).",
- :fg_highlight => "Text or foreground color when the object is
highlighted.",
- :bg_highlight => "Background color when the object is
highlighted.",
- :font => "This is either a symbol referencing an Lfont object or an array of font attributes for this
object defined as [font_name, font_size, font_style]. Children inherent
this attribute from their parent. This is an alias for :font_name=>name,
:font_size=>10, :font_style=>nil.",
- :font_name => "The name of the font. Children inherent this
attribute from their parent.",
- :font_size => "The point size of the font (8, 10, 12, etc.).
Children inherent this attribute from their parent.",
- :font_style => "The style of the font. Possible values are an array
of :bold, :italic, :normal (the default), :underline. Children inherent
this attribute from their parent.",
- :focus => "This is the name of a child object that will get the
focus when the window opens, only used by Lcontainer objects.",
- :accelerator=> "This is a character representing the first
character in the :text attribute associated with a keyboard accelerator.
Pressing Alt-character will activate the accelerator. Characters prefixed
with ’&’ are automatically converted to
accelerators.",
- :user => "This used for attaching your own user defined data to an
object.",
- :inherited_attributes => "This allows each object to define a
list(Hash) of attributes that are inherited by
it’s parent. The default (when this attribute is not specified) is to
inherit all color and font attributes. The combobox and datebox use this
for their internal objects to make sure the internal objects are properly
updated when an attribute changes in the combobox or datebox."
There are two ways to put or place widgets or objects into a window or
group:
- Use the :pos attribute and put the object at a specific location in the
window. It uses an array of four points [x,y,w,h]. The w and h are optional
and will default to size of the object.
- You can provide a combination of the following (similar to Tk’s
pack):
- :sticky - is any combination of ‘news’. Here are some basic
rules:
- :n binds to the top border and centers left to right
- :e binds to the right border and centers top to bottom
- :w binds to the left border and centers top to bottom
- :s binds to the bottom border and centers left to right
- :nw binds to the top left border
- :ew will span the width of the parent and centers top to bottom
- :ns will span the height of the parent and centers left to right
- :news will span the width and height of the parent
- :c will center the object in it’s parent, unless another sticky
setting is used with the :c
- if :above, :below, :before, :after are used with centering then centering
is done with remaining space
- :padx - the number of horizontal pixels to add before and after the object
- :pady - the number of vertical pixels to add above and below the object
- :ipadx - the number of pixels to add (or pad) to the inside edge of the
left/right border of the object
- :ipady - the number of pixels to add (or pad) to the inside edge of the
top/bottom border of the object
- :above=>:object_name - position above another object with a name of
:object_name. The x of the two objects will be the same (before the padx
attribute is applied).
- :below=>:object_name - position above below object with a name of
:object_name. The x of the two objects will be the same (before the padx
attribute is applied).
- :before=>:object_name - position before another object with a name of
:object_name. The y of the two objects will be the same (before the pady
attribute is applied).
- :after=>:object_name - position before another object with a name of
:object_name. The y of the two objects will be the same (before the pady
attribute is applied).
- :startx=>:object_name - set the x of this object to :object_name.x.
- :starty=>:object_name - set the y of this object to :object_name.y.
- :spanw=>:object_name - set the w of this object to :object_name.x +
:object_name.w.
- :spanh=>:object_name - set the h of this object to :object_name.y +
:object_name.h.
The :above, :below, :before, :after attributes allow you to position or
arrange an object relative to another object. These attributes will
override the :sticky attribute in most situations. There is a window called
:TestPacking in tst_locana.rb that shows many combinations of :sticky and
these attributes. You can place a object :after=>:object1 and
:below=>:object2. In this case, your object will use the x of :object2
and the y of :object1. You can set :above, :below, :before, :after =>
:prev to arrange the object relative to the previously added object.
:spanw, :spanh, :startx, :starty allow you to position or arrange an object
relative to other objects. These settings will override the :sticky :above,
:below, :before, and :after attributes.
Here are the rules for w/h in order of precedence: :pos[2/3]>0,
:width/:height>0, :spanw/:spanh>0, :sticky=>:ew, pixel size of
object. Here are the rules for x/y in order of precedence: :pos[0/1],
:startx, :starty, :before, :after, :above, :below, :sticky, sticky=>:nw
in parent.
- If you don’t provide :pos or :sticky, the default is :sticky=>:nw
using the objects default pixel size.
activate_menubar,
activate_popup,
bind,
determine_mouse_cursor_for_sizing,
event,
fire,
get_binding,
get_bindings,
is_position_inside_object?,
is_prepared?,
new,
on_after_update,
on_alt_key,
on_backspace_key,
on_before_update,
on_change,
on_click,
on_close,
on_copy,
on_cut,
on_delete_key,
on_down_key,
on_end_key,
on_enter,
on_enter_key,
on_error,
on_error_print_error,
on_escape_key,
on_exit,
on_f10_key,
on_f11_key,
on_f12_key,
on_f1_key,
on_f2_key,
on_f3_key,
on_f4_key,
on_f5_key,
on_f6_key,
on_f7_key,
on_f8_key,
on_f9_key,
on_help,
on_hide,
on_home_key,
on_insert_key,
on_key_press,
on_key_release,
on_left_key,
on_load,
on_mouse_ldbl,
on_mouse_ldn,
on_mouse_lup,
on_mouse_mdbl,
on_mouse_mdn,
on_mouse_move,
on_mouse_move_object,
on_mouse_mup,
on_mouse_out,
on_mouse_out_border,
on_mouse_over,
on_mouse_over_border,
on_mouse_rdbl,
on_mouse_rdn,
on_mouse_resize_object,
on_mouse_rup,
on_move,
on_next_object,
on_open,
on_pagedown_key,
on_pageup_key,
on_paste,
on_prev_object,
on_resize,
on_right_key,
on_scroll,
on_show,
on_tab_key,
on_timer,
on_undo,
on_unload,
on_up_key,
prepare,
prepare_internal_lobject,
prepare_lobject,
prepare_object,
process_event,
reprepare,
reprepare_all,
trigger,
trigger_on_mouse_move,
Included modules
Prints the content of levent to $stderr.
Creates a new object. FYI, @oattr is the original attribute supplied by the
caller, self is a collection of working attributes for the object including
inherited attributes, internal Locana attributes,
attributes gathered from themes, and the object attributes (@oattr) are
also added.
- name - the name of this object. Objects names don’t need to be unique
but several methods will work better if the object names are unique.
- attr - this is a Hash of attributes such as
:attr=>value, :attr2=>value2. Attributes can be set using this
argument and/or by supplying a block. Supported attributes are described
above.
- block - you can provided a block to set attributes, create bindings, add
children, etc.
Example: (see tst/tst_locana.rb for more
examples)
win = Lwindow.new('TestEditBox', :pos=>[60, 60, 0, 0], :text=>'Test EditBox') {
label('label1', :pos=>[10, 5, 0, 0], :label=>'Type some text')
textbox('t_text1', :pos=>[10, 30, 200, 0])
button('b_ok', :pos=>[260, 260, 0, 0], :text => 'Ok')
# bind a print statement to the after_update event for the textbox object
t_text1.bind(:on_after_update, %q{print "after update, new value: '#{event.value}'\n"})
b_ok.on_click = "close()" # this button will close the form
save('locana.ls') # save this window object
}
Example2:
win = Locana::window('TestEditBox', :pos=>[60, 60, 0, 0], :text=>'Test EditBox') {
label('label1', :pos=>[10, 5, 0, 0], :label=>'Type some text')
}
Returns the mouse cursor used for sizing based on the location of the mouse
when it is over a border. The on_mouse_move and on_mouse_over_border calls this to
determine which mouse cursor to use based on the border involved with the
event when :allow_sizing is turned on.
Returns true if lx and ly are inside the objects border or client area.
- lx and ly are the screen relative pixel position of the mouse from
levent[:x] and levent[:y].
This binds Ruby code to an event. The Ruby code is executed when the event
occurs. The following three examples are different ways to accomplish this
(they are all exactly the same):
b_obj.bind(:on_click, proc{|levent| puts levent})
b_obj.on_click = proc{|levent| puts levent}
b_obj.on_click{|levent| puts levent}
def b_obj.on_click(levent)
super
#puts levent
end
FYI: Some unix keyboards don’t report Shift Tab such that Tk will
interpret it. Use xev to show how keys are interpreted. Here is a possible
fix for this issue:
xmodmap -e "keysym KP_Tab = Tab"
Returns a Hash containing the event bindings for
the object.
- only_event_bindings - when nil returns @oattr (which contains all event
bindings), when true returns a new Hash containing
only event bindings for the object.
Returns the event binding assigned to ievent or nil if there is no binding.
For example: get_binding(:on_key_press).
- ievent - the symbol of a support event.
Searches through parents until an menubar is found and activates it.
Searches through parents until a popup menu is found and activates the
first one it finds.
This is called by trigger_gui_event during an on_mouse_move event. All on_mouse_move events from the GUI are
directed here. This looks at the position of the mouse, adds the :border
element to the event, and generates the on_mouse_over, on_mouse_out, on_mouse_over_border, on_mouse_out_border and on_mouse_move events as needed. Here is the
order as the mouse move into an object and then out of an object:
- on_mouse_over as the mouse enters
the object
- on_mouse_over_border if (object has a
border and mouse is over the border)
- on_mouse_move with levent[:border] = the
border (:n, :s, :e, :w, etc.) the mouse is currently over.
- on_mouse_out_border as the mouse enters
the client area of the object
- on_mouse_move as you move around in the
client area of the object (levent[:border] = nil).
- on_mouse_over_border as the mouse is
moving out of the objects client area if (object has a border and mouse is
over the border)
- on_mouse_move with levent[:border] = the
border (:n, :s, :e, :w, etc.) the mouse is currently over.
- on_mouse_out_border as the mouse leaves
the border area of the object
- on_mouse_out as the mouse leaves
the object
All of these events are forwarded to trigger() for processing. This returns
the border the mouse is currently over.
This invokes or triggers ievent. 1) redirects all events to
self[:_trap_events] if self[:_trap_events] is defined, the GUI binding uses
this 2) eats events for disabled or locked objects 3) calls the method
created for this event which should call process_event in turn All GUI Binding
events eventually pass through here.
- ievent - the symbol of a supported event
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object
All event methods should call this just before the each event is processed.
This calls Levent.trap_events, if defined, and allows you to
easily trap/monitor any/all events and raise an error if needed. You can
raise the CancelEvent error (defined in Locana.rb) to cancel any event before it is
processed. The event monitor process in the GUI builder uses Levent.trap_events
to report all events. If a Proc object or String
has been assigned to an object, see bind(), it is called here. All GUI
Binding events call trigger_event which forwards the event here.
- ievent - the symbol of a supported event
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object
This returns the event current being process by the event handler. This
allows event bindings that are strings to reference the event when they are
triggered.
Triggered by the on_exit event of
an object when it is dirty (the content of the object has changed). Removes
the :dirty attribute for self, sets the :dirty attribute for the parent
window, and clears the undo variable.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by on_key_press of the
alt key. The default action is to activate the menubar (calls activate_menubar). This event is triggered
from the trigger() method rather than the on_key_press method to make sure it
gets priority over the on_key_press
methods.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by on_key_press of the
backspace key.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered just before the content of an object is changed and the object is
not yet dirty (has not changed yet). Saves the current :value in the :_undo
attribute in case the on_undo event is
triggered.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered when the user interactively changes the content of an object such
as a textbox, checkbox, listbox, etc.. Triggers the on_before_update event when the object is
not dirty and sets the :dirty attribute in self. The self[:value] attribute
should report the value of the object before the on_change event and levent[:value] should
contain the newly changed value.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by pressing the enter key on a button or menu, the space bar key
on a checkbox or radiobox, or on_mlb_down for many of the objects. Not
supported by all objects.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by pressing ctrl-c (on_key_press event) and pressing
ctrl-insert (on_insert_key event with
the control key pressed). Copies the selected text from :value attribute
into the clipboard. Only supported by a few objects such as Ltextbox and Leditbox.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by pressing ctrl-x (on_key_press event) and pressing
ctrl-delete or shift-delete (on_delete_key event with the control key
pressed). Cuts the selected text from :value attribute of the object and
places it in the clipboard. Only supported by a few objects such as Ltextbox and Leditbox.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by the on_key_press event
of the delete key. This triggers the on_cut event during ctrl-delete key or
shift-delete key.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by the on_key_press event
of the down arrow key.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by the on_key_press event
of the end key.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered when the keyboard focus enters this object. This calls
Locana_gui::set_focus to let the GUI Binding we have the focus. If :auto_select is enabled, the text in the
object will be automatically highlighted or selected, only for Ltextbox and Leditbox
objects. Also lets the parent window know we have the focus and calls paint_focus to render the focus in the
object.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by the on_key_press event
of the enter or return key.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
This is triggered whenever an error occurs in Locana. The default action is to call Lobject.on_error_print_error() which prints the
error to stderr and opens a msgbox containing the error.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values. This should contain the following additional values:
- :ievent - the event being processed during the error
- :error - the error ($!) as reported by Ruby
- :error_message - an addition information about the error
- :call_stack - the call stack when the error occurred
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by the on_key_press event
of the escape key. This allows you to assign a common task to the escape
key. Here is the default action:
- If you have assigned a proc object to this event or created this method for
a specific object, that proc object or method is called first.
- If the content of the object (:value attribute) has changed
- Otherwise
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered when the keyboard focus is leaving the object. Triggers the on_after_update event if the object is
dirty (its content or :value attribute has been changed). Calls paint_focus_remove to remove or undo
the focus for this object.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by the on_key_release event of
the F1 key. The default is to open a message box containing the :help
attribute when releasing the F1 key.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by the on_key_press event
of the home key.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by the on_key_press event
of the insert key. This triggers the on_copy event during ctrl-insert key and on_paste during shift-insert key.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
This triggers the following events:
We also need to check for and call accelerators and cancel the balloon help
timer and close the balloon help if it is open.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
This triggers the following events:
All functions key events are forwarded to the parent_window.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by the on_key_release event of
the F1 key. Triggers the on_help event.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by the on_key_release event of
the F2 key.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by the on_key_release event of
the F3 key.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by the on_key_release event of
the F4 key.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by the on_key_release event of
the F5 key.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by the on_key_release event of
the F6 key.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by the on_key_release event of
the F7 key.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by the on_key_release event of
the F8 key.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by the on_key_release event of
the F9 key.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by the on_key_release event of
the F10 key.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by the on_key_release event of
the F11 key.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by the on_key_release event of
the F12 key.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by the on_key_press event
of the left arrow key.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by double clicking on the left mouse button.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by clicking on the left mouse button. Check for and supports :allow_dragging and
allow_dragging_parent and prepare for dragging when needed. check for and
supports the :allow_sizing attribute when the mouse is over the border.
Give this object the focus, calls set_focus().
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by releasing the left mouse button. Cancels the balloon help
timer and closes the balloon help it is open.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by double clicking on the middle mouse button.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by clicking on the middle mouse button. Cancel the balloon help
timer and close the balloon help it is open.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by releasing the middle mouse button. Cancel the balloon help
timer and close the balloon help it is open.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by double clicking on the right mouse button.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by clicking on the right mouse button. Calls activate_popup if there is a popup style
menu assigned to this object of one of this objects parents. Also remembers
the object under the mouse so the popup menu can use it.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by releasing the middle mouse button. Cancel the balloon help
timer and close the balloon help it is open.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by moving the mouse. Closes the balloon help, if open. Supports
dragging objects if the user has clicked on an object that can be dragged
(see the :allow_dragging
attribute). Supports resizing objects if the user has clicked in the border
area of an object than can be sized (see the :allow_sizing attribute).
Automatically sets the mouse cursor to one of the mouse sizing cursors when
:allow_sizing is turned on and the mouse is over one of the objects
borders. Needed when the mouse is over one of the borders and is moved to
another border without leaving the border area.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by on_mouse_move when :allow_dragging is turned on and
the left mouse button is down. Moves the object based on the new mouse
coordinates. Triggers the :on_move
event for the object being dragged.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered when the mouse is moved over the border or client area of the
object. Starts the balloon help timer. Automatically changes the mouse
cursor to match the :mouse_cursor attribute. Here is the order of events:
- on_mouse_over as the mouse enters
the object
- on_mouse_over_border if (object has a
border and mouse is over the border)
- on_mouse_move with levent[:border] = the
border (:n, :s, :e, :w, etc.) the mouse is currently over.
- on_mouse_out_border as the mouse enters
the client area of the object
- on_mouse_move as you move around in the
client area of the object (levent[:border] = nil).
- on_mouse_over_border as the mouse is
moving out of the objects client area if (object has a border and mouse is
over the border)
- on_mouse_move with levent[:border] = the
border (:n, :s, :e, :w, etc.) the mouse is currently over.
- on_mouse_out_border as the mouse leaves
the border area of the object
- on_mouse_out as the mouse leaves
the object
Triggered when the mouse is moved over the border area of the object.
Automatically changes the mouse cursor to appropriate cursor when
:allow_sizing is on to indicate that sizing is allowed. Order of events:
- on_mouse_over as the mouse enters
the object
- on_mouse_over_border if (object has a
border and mouse is over the border)
- on_mouse_move with levent[:border] = the
border (:n, :s, :e, :w, etc.) the mouse is currently over.
- on_mouse_out_border as the mouse enters
the client area of the object
- on_mouse_move as you move around in the
client area of the object (levent[:border] = nil).
- on_mouse_over_border as the mouse is
moving out of the objects client area if (object has a border and mouse is
over the border)
- on_mouse_move with levent[:border] = the
border (:n, :s, :e, :w, etc.) the mouse is currently over.
- on_mouse_out_border as the mouse leaves
the border area of the object
- on_mouse_out as the mouse leaves
the object
Triggered when the mouse is moved outside the object border and client
area. Cancels the balloon help timer and close the balloon help if it is
open. Clears the mouse cursor. Here is the order of events:
- on_mouse_over as the mouse enters
the object
- on_mouse_over_border if (object has a
border and mouse is over the border)
- on_mouse_move with levent[:border] = the
border (:n, :s, :e, :w, etc.) the mouse is currently over.
- on_mouse_out_border as the mouse enters
the client area of the object
- on_mouse_move as you move around in the
client area of the object (levent[:border] = nil).
- on_mouse_over_border as the mouse is
moving out of the objects client area if (object has a border and mouse is
over the border)
- on_mouse_move with levent[:border] = the
border (:n, :s, :e, :w, etc.) the mouse is currently over.
- on_mouse_out_border as the mouse leaves
the border area of the object
- on_mouse_out as the mouse leaves
the object
Triggered when the mouse cursor is no longer over the border area of the
object. Automatically reverts the cursor back to the :mouse_cursor
attribute. Here is the order of events:
- on_mouse_over as the mouse enters
the object
- on_mouse_over_border if (object has a
border and mouse is over the border)
- on_mouse_move with levent[:border] = the
border (:n, :s, :e, :w, etc.) the mouse is currently over.
- on_mouse_out_border as the mouse enters
the client area of the object
- on_mouse_move as you move around in the
client area of the object (levent[:border] = nil).
- on_mouse_over_border as the mouse is
moving out of the objects client area if (object has a border and mouse is
over the border)
- on_mouse_move with levent[:border] = the
border (:n, :s, :e, :w, etc.) the mouse is currently over.
- on_mouse_out_border as the mouse leaves
the border area of the object
- on_mouse_out as the mouse leaves
the object
Triggered during the on_mouse_move event
when the :allow_dragging
attribute is turned on and the left mouse button is pressed. Resized the
object based on the new mouse coordinates. When resizing the east or north
borders, triggers the :on_move
event for the object being resized. Otherwise, triggers the on_resize event for the object being
resized.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered when an object is dragged or a window is moved. It records the
new position of the object if needed. This does not actually move the
object, it expects that the object is already in the new position.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by the on_tab_key event. Calls
next_focus() to give the next
object the focus.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by the on_key_press event
of the page down key.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by the on_key_press event
of the page up key.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by pressing ctrl-v (on_key_press event) and pressing
shift-insert (on_insert_key event).
Pastes the content of the clipboard into the objects :value attribute. Only
supported by a few objects such as Ltextbox and
Leditbox.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by the on_tab_key event when
the shift key is pressed. Calls prev_focus to give the focus to the
previous object.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered when an object is resized (not during a reprepare) or a window is
resized. Records the new position of the object if needed. This does not
actually resize the object, it expects that the object is already in the
new position.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by the on_key_press event
of the right arrow key.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by the Lscrollbar object when the
scroller button in the scrollbar has changed position. Allows you to
customize the action to take when the scroller moves.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by the on_key_press event
of the tab key. Triggers on_next_object
or on_prev_object when the shift key is
pressed.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered when a timer has matured and the Ltimer.start method was not supplied a block.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered during the on_escape_key
event. Resets the :value attribute back to it’s original value using
the :_undo attribute (the undo variable).
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered by the on_key_press event
of the up arrow key.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered when the object is first opening up before it is prepared,
displayed or opened. This event is only supported for Lwindow objects.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered when the object is first opening up after it has been prepared
and before it is displayed or opened. This event is only supported for Lwindow objects.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered just after the object is opened and displayed. The show() method
also triggers this. This event is only supported for Lwindow objects.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered just before the object removed from the display. Called by the
close() and hide(). This event is only supported for Lwindow objects.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggers as the object closes just before the window is removed from the
display. It is safe to cancel this event and the closing of the window by
calling raise CancelEvent. This event is
only supported for Lwindow objects.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Triggered after the object and all of its children are closed and removed
from the display. This event is only supported for Lwindow objects.
- levent - contains attributes associated with the event, this can be nil, a
Hash, or Levent object.
See the Levent class for a description of
supported values.
- block - if you associate a block with the event, it will be called when the
event is triggered.
Returns true if this object has been prepared.
This will reprepare all objects.
This will reprepare all objects only when needed. This is called during the
:on_resize event. This cleared the
prepared flag and calls prepare()
This determines the x,y,w,h position of the object based on the objects
attributes. For example, you can leave the ‘w’ and
‘h’ attributes empty for a window, this method will calculate
them based on the sizes and positions of it’s children. Open()
automatically calls this method.
- Here are the rules for x/y in order of precedence:
- :pos[0], :pos[1] - if the :pos attribute is supplied it is used
- :startx, starty
- :before, :after, :above, :below
- :sticky - if there is no :sticky attribute, :nw is used
- Here are the rules for w/h in order of precedence:
- :pos[2], :pos[3] - if the :pos attribute is supplied it is used
- :width>0, height>0 - only if it is greater than 0
- :spanw>0, :spanh>0 - only if it is greater than 0
- pixel size of the object.
Here is the order of processing:
- l_x(), l_y(), l_w(), l_h() are called to get the initial position and size.
These return the :pos, :width, :height attributes if they are defined.
- l_prepare_apply_span_parentW() and l_prepare_apply_span_parentH() are
called if the parents width and height are known and our :sticky or
:height/:width attributes indicate we should span our parent.
- prepare_internal() - allows objects a chance do any need preparation, most
object that support accelerators use this to determine the accelerator.
- prepare_object() -
- l_estimate_width() and l_estimate_height() will calculate the width and
height if they are not known yet
- l_determine_x()and l_determine_y() will determine the x and y if they are
not know yet
- l_prepare_apply_span_parentW() and l_prepare_apply_span_parentH() will
determine the width and height if they are not know yet and the parent w/h
are known and we are spanning our parent
- l_prepare_apply_spanW() and l_prepare_apply_spanH() applies the
:spanw/:spanh attributes if the width/height still aren’t known
- l_prepare_check_dependancies(ox, oy, ow, oh) reprepares any other sibling
that are dependant on our position or size
- move the object to it’s position.
- Lcontainer objects need to check to see if
any children need to be reprepared resulting from a height or width change.
Alias for prepare_internal
Fills in any empty values (x,y,w,h) for the object. Calls the following in
order:
- l_estimate_width() and l_estimate_height() will calculate the width and
height if they are not known yet
- l_determine_x()and l_determine_y() will determine the x and y if they are
not know yet
- l_prepare_apply_span_parentW() and l_prepare_apply_span_parentH() will
determine the width and height if they are not know yet and the parent w/h
are known and we are spanning our parent
- l_prepare_apply_spanW() and l_prepare_apply_spanH() applies the
:spanw/:spanh attributes if the width/height still aren’t known
- l_prepare_check_dependancies(ox, oy, ow, oh) reprepares any other sibling
that are dependant on our position or size
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.