Class
Lframe
Home
In: locana/l_frame.rb
Parent: Lcontainer

This class contains other Locana objects (except Lwindow and Ldisplay objects). This is Based on the Lcontainer class. It supports Lscrollbar objects (and other objects as well) on any border, and will soon support window dressing (title bar that looks and acts like a window). Scrollbars are automatic by default, you will see them only when they are needed. This class can also contain a Lmenubar object in the North border. This class also supports the following additional attributes:

Methods

activate_menubar, add, add_east, add_north, add_south, add_top, add_west, check_and_update_scrollbars, clientH, clientW, clientX, clientY, client_size, delete_child, delete_east, delete_north, delete_south, delete_west, each_child, find_object_with_accelerator, has_hscroll?, has_vscroll?, horizontal_scrollbar, hscroll, hscroll_position=, menubar, min_height, min_width, needs_hscroll?, needs_vscroll?, new, on_scroll, prepare, scroll_distance, scroll_distance_alignment, title_bar_height, total_size, update_horizontal_scrollbar, update_scrollbars, update_vertical_scrollbar, valid_attribute?, vertical_scrollbar, vscroll, vscroll_position=,
Public Class methods
new(name, attr=nil, &block) src

Create an instance variable indicating if this object has any borders.

Public Instance methods
valid_attribute?(attribute, lvalue=nil) src
activate_menubar() src

Activates the menubar associated with this Lframe object. If this object does not have a menubar, then the parent objects are checked for a menubar. This first menubar found is activated.

add(object) src

Checks for Lmenubar and Lmenu_popup objects because they require special action. If object is a Lmenubar, it must be added to the top border rather than becoming a child object. If object is a Lmenu_pop, this object must point to it rather than becoming a child object.

add_top(object) src

Checks for Lmenubar and Lmenu_popup objects because they require special action. If object is a Lmenubar, it must be added to the top border rather than becoming a child object. If object is a Lmenu_pop, this object must point to it rather than becoming a child object.

add_north(object) src

Adds object to the north (top) border of the frame. The add(Lmenubar object) method uses this to add the menubar to the north border.

add_south(object) src

Adds object to the south (bottom) border of the frame.

add_west(object) src

Adds object to the west (left) border of the frame.

add_east(object) src

Adds object to the east (right) border of the frame.

delete_child(object) src

Checks for Lmenubar and Lmenu_popup objects because they require special action. If object is a Lmenubar, it is removed from the north border, if the north border is empty it is removed. If object is a Lmenu_pop, eliminate the pointer to the popup menu.

delete_north(object) src

Deletes object from the north border of the frame.

delete_south(object) src

Deletes object from the south border of the frame.

delete_east(object) src

Deletes object from the east border of the frame.

delete_west(object) src

Deletes object from the west border of the frame.

each_child(include_internal=nil) {|self[:_border_n]| ...} src

Yields each child. When include_internal == true, also yields the north, south, east, and west border objects if they exist.

clientX() src

Returns the x pixel position of the client area of the object relative to the object’s upper left corner.

clientY() src

Returns the y pixel position of the client area of the object relative to the object’s upper left corner.

clientH() src

Returns the pixel height of the client area of the object.

clientW() src

Returns the pixel width of the client area of the object.

min_width() src

Returns the min_width of this object. Only used for Lwindow objects or when the :allow_size attribute is turned on to keep the object from getting too small. If there can be a scrollbar, the default adds 40 to the min_width.

min_height() src

Returns the min_height of this object. Only used for Lwindow objects or when the :allow_size attribute is turned on to keep the object from getting too small. If there can be a scrollbar, the default adds 40 to the min_height.

title_bar_height() src

Returns 0.

vscroll() src

Returns :auto when there is no :vscroll attribute.

hscroll() src

Returns :auto when there is no :hscroll attribute.

has_vscroll?() src

Returns true if this object has a vertical scroll bar.

has_hscroll?() src

Returns true if this object has a horizontal scroll bar.

needs_vscroll?() src

Returns true if this object needs a vertical scroll bar.

needs_hscroll?() src

Returns true if this object needs a horizontal scroll bar.

vertical_scrollbar() src

If this object has a vertical scrollbar it is returned, otherwise returns nil.

horizontal_scrollbar() src

If this object has a horizontal scrollbar it is returned, otherwise returns nil.

scroll_distance_alignment(is_horizontal) src

The scrollbars use this value for determining the alignment when dragging the scroller button. The default is 1.

scroll_distance(is_horizontal) src

The scrollbars use this value for determining the scrolling distance when pushing one of the buttons in the scrollbar. The default is 20.

total_size(is_horizontal) src

The scrollbars use this value for determining the size of the scroller button. Return the pixel_height for horizontal scrollbars and pixel_width for vertical scrollbars.

client_size(is_horizontal) src

The scrollbars use this value for determining how the scroller works. Returns the pixel width or pixel height of the object depending on is_horizontal. Returns clientW() when is_horizontal is true (horizontal scrollbar) and clientH() when is_horizontal is false or nil (vertical scrollbars). The return value is rounded down to the size of scroll_distance so the scroller is always aligned properly.

on_scroll(levent=nil, &block) src

Triggered every time the scroller button is moved. It means the content inside the frame is moving. This moves every child to reflect the new scroller button position.

hscroll_position=(new_value) src

Sets the horizontal scroller position for this object. This does not move the scroller button in the horizontal scrollbar but it does move all children to reflect the new scroller position. The on_scroll method calls this. It scrolls the children of object left or right to match new_value.

vscroll_position=(new_value) src

Sets the vertical scroller position for this object. This does not move the scroller button in the vertical scrollbar but it does move all children to reflect the new scroller position. The on_scroll method calls this. It scrolls the children of object up or down to match new_value.

update_scrollbars() src

Resizes the scroller button in the horizontal and vertical scrollbars when needed and scrollbars exist. This is called when the objects size or content is changed. It calls update_horizontal_scrollbar() and update_vertical_scrollbar().

update_horizontal_scrollbar() src

Resizes the scroller button in the horizontal scrollbar. Tells the horizontal scrollbar to check and update the scrollber button if needed and the horizontal scollbar exists.

update_vertical_scrollbar() src

Resizes the scroller button in the vertical scrollbar. Tells the vertical scrollbar to check and update the scrollber button if needed and the vertical scollbar exists.

check_and_update_scrollbars() src

Adds scrollbars if needed, removes scrollbars if no longer needed, and updates the scroller buttons in the scrollbars if they exist.

find_object_with_accelerator(laccelerator) src

If menubar exists, it needs to be checked for the accelerator before checking any children for the accelerator.

menubar(name, attr=nil, &block) src

A shortcut for add(Lmenubar.new(name, …)).

prepare(parent=nil, move_obj=nil) src

Creates and/or updates the north, south, east, and west border objects including any scrollbars as needed.


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