This contains other Locana objects and provides a
foundation for the Lframe object. It can have a
border but it can’t have scrollbars nor other objects in the border
(see the Lframe object). It is based on the Lobject class.
activate_popup,
add,
add_top,
button,
check_and_update_scrollbars,
checkbox,
children,
clear,
close,
combobox,
container,
datebox,
delete_child,
destroy,
destroy_child,
disable,
each_child,
editbox,
enable,
find_object_with_accelerator,
frame,
frameH,
frameW,
get,
get_child,
group,
has_child?,
has_children?,
has_hscroll?,
has_vscroll?,
image,
label,
line,
listbox,
lock,
menu,
menu_popup,
menu_separator,
menubar,
method_missing,
names_of_children,
nchildren,
needs_hscroll?,
needs_vscroll?,
new,
on_resize,
open,
paint_focus?,
password,
pixel_height_total,
pixel_width_total,
prepare,
radiobox,
reposition_child,
scrollbar,
set_focus,
spinner,
tabgroup,
tabpage,
textbox,
to_s,
unlock,
valid_attribute?,
window,
Creates an instance variable to store an Array of
children.
By default, containers don’t get a focus. Returns false.
Includes a count of children.
This will open the popup menubar associated with this object. If this
object does not have a popup menu, then all parent objects are checked for
a popup menu.
Adds object to self. Example: (see tst/tst_locana.rb for more
examples)
win = Lobject.new(:window, 'TestEditBox', :text=>'Test EditBox', :pos=>[60,60])
lbl = Lobject.new(:label, 'l_label1', :text=>'Type some text', :pos=>[10, 5])
txt = Lobject.new(:textbox, 't_text1', :pos=>[10, 30, 200])
# bind a print statement to the after_update event for the textbox object
txt.bind(:on_after_update, %q{print "after update, new value: '#{event.value}'\n"})
btn = Lobject.new(:button, 'b_ok', :text=>'Ok', :pos=>[260, 260])
btn.bind(:on_click, "close()" # this button will close the form
win.add_object(lbl)
win.add_object(txt)
win.add_object(btn)
win.save('locana.ls') # save this window object
You may need to call reprepare(true) to see the change fully reflected such
as getting the scrollbars to update correctly.
Adds object in front of all other children. You may need to call
reprepare(true) to see the change fully reflected such as getting the
scrollbars to update correctly.
Deletes object from caller (self), object and all of it’s children
can be reused.
object - can be a locana object or the name of an object
You may need to call reprepare(true) to see the change fully reflected such
as getting the scrollbars to update correctly.
- object - any Lobject object that is a child of
self or the name of a child object.
Destroy child object and all of it’s children from caller (self).
Call delete_child() to remove the child
then destroys the content of all attributes and instance variables. Calling
delete_child allows you to reuse the
object, while calling destroy_child
makes the object unusable.
- object - any Lobject object that is a child of
self or the name of a child object.
Changes the position of child_object relative to other siblings. Calling
this will negatively affect the :sticky and related attributes. Therefore,
this method is not recommended if any object relies on the position of
child_object or child_object relies on the position of other siblings. This
GUI builder uses this for bringing an object to the front or pushing an
object behind other objects. Supported positions are:
- :front - brings this object in front of all siblings
- :back - pushes this object behind all siblings
- :raise - brings this object above the previous object
- :lower - pushes this object below the next object
Clear the content this object (clears the :value attribute). If
include_children is true, this will clear the :value attribute of all
children.
Enables all children when include_children=true.
Disables all children (puts them in a :state of :disabled) when
include_children=true.
Locks all children (puts them in a :state of :locked) when
include_children=true.
Unlock all children when include_children=true.
Checks all children for laccelerator, returns the first object with an
accelerator matching laccelerator. Returns nil if no object has
laccelerator.
Returns an Array containing the names of all the
children. array_of_names - when provided, the names of all children are
added to the end of this Array
Returns true if object belongs to self, otherwise returns false.
- object - any Lobject object that is a child of
self or the name of a child object.
- include_children - when true all child objects are checked to see if they
contain object.
Returns the object within self whose name matches name. Returns nil if self
does not have any children that match name.
- name - the name of a child object.
- include_children - when true all child objects are checked to see if they
contain an object with a name matching the name parameter.
Returns true if this object has children.
Returns all children that are not internally created. The Lbutton_pixmap of the Lcombobox class is an example of an internally
created object.
Returns the number of children in this object.
Yields each child object.
Gives the keyboard focus to a child object in this container. If an object
already has the focus, then it tells the GUI Binding to give that object
the focus. If not, calls next_focus
to give this first object in the parent_window the focus.
Returns the pixel x + pixel width of the right most object. This is the
total amount of space needed by this object.
Returns the pixel y + pixel height of the bottom most object. This is the
total amount of space needed by this object.
Returns the pixel width of the client area of this object. This does not
include any internally padding (i.e. the :ipadx attribute is ignored).
Returns the pixel height of the client area of this object. This does not
include any internally padding (i.e. the :ipadx attribute is ignored).
When meth matches the name of a child object, a method is automatically
created for accessing the child object. Supports things
object_name.attr_name, object_name.object_name.method(), and
object_name.object_name.attr_name = ?. If you decide to use this technique,
name your objects or widgets carefully. If an object name matches an
existing method, you will get an error. As a result, I prefix my objects
with ‘b_’, ‘l_’, ‘g_’, etc. as needed.
Example: (see tst/tst_locana.rb for more
examples)
Lwindow.new('w_TestEditBox', :text=>'Test EditBox', :pos=>[60, 60]) {
label('l_label1', :text=>'Type some text', :pos=>[10, 5])
textbox('t_text1', :pos=>[10, 30, 200])
group('g_group', :pos=>[260, 260]) {
button('b_ok', :text=>'Ok', :pos=>[0, 0])
b_ok.on_mouse_rup = "close()" # one way to address the button
}
t_text1.on_after_update = %q{print "after update, new value: '#{event.value}'\n"}
g_group.b_ok.on_click = "Lobject.close()" # another way to address the button
g_group.b_ok.state = :disabled # we can also get or set attributes
}
Triggered when an object is resized (not during a reprepare) or a window is
resized. This does not actually resize the object, it expects that the
object is already in the new position.
Returns nil because containers can’t have scrollbars.
Returns nil because containers can’t have scrollbars.
Returns false because containers can’t have scrollbars.
Returns false because containers can’t have scrollbars.
This is only supported for Lframe objects and
provided here so Locana does not have to check
the class before calling this method.
A shortcut for add(Lbutton.new(name, …)).
A shortcut for add(Ldatebox.new(name,
…)).
A shortcut for add(Leditbox.new(name,
…)).
A shortcut for add(Lframe.new(name, …)).
A shortcut for add(Lgroup.new(name, …)).
A shortcut for add(Limage.new(name, …)).
A shortcut for add(Llabel.new(name, …)).
A shortcut for add(Lline.new(name, …)).
A shortcut for add(Llistbox.new(name,
…)).
A shortcut for add(Lmenu.new(name, …)).
A shortcut for add(Lmenubar.new(name,
…)).
A shortcut for add(Lspinner.new(name,
…)).
A shortcut for add(Ltabpage.new(name,
…)).
A shortcut for add(Ltextbox.new(name,
…)).
A shortcut for add(Lwindow.new(name, …)).
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.