Class
Lwindow
Home
In: locana/l_window.rb
Parent: Lframe

This class creates a top level window. Based on the Lframe class. The Lframe class allows the window to support borders, scrollbars, and menubars. Supports the following attributes:

Methods

border, bwidth, bwidth_window, clientH, clientX, clientY, close, hide, min_height=, min_width=, move, on_close, on_enter, on_escape_key, on_exit, on_f1_key, on_hide, on_load, on_move, on_open, on_resize, on_show, on_unload, open, paint_focus?, parent_window, prepare, save, screenX, screenY, show, text, text=, title, title=, title_bar_height, valid_attribute?, windowX, windowY,
Public Instance methods
valid_attribute?(attribute, lvalue=nil) src

Support the :auto_save, :title, and :otype attributes.

open(parent=nil) src

Opens the window. Example:

    win = Lwindow.new('TestWindow', :width=>200, :height=>100], :text=>'Test popup Window').open
    Locana::event_loop    # process events until all windows are closes
close() src

Closes the window.

min_width=(new_value) src

Sets the minimum width for this object. Forwards the new min_width to the GUI binding.

min_height=(new_value) src

Sets the minimum height for this object. Forwards the new min_height to the GUI bindings.

title() src

Returns the title of the window. If there is a :title attribute, it is returned. If there is no :title and there is a :text attribute, the :text attribute is returned. Returns nil if there is no title. Alias for text()

title=(new_value) src

Sets the title of the window. Alias for text=.

text() src

Alias for title.

text=(new_title) src

Alias for title=.

save(store_name='locana.ls') src

Saves the window and all it’s children to the LStore. If store_name does not exist, it will be created.

show() src

Show the object or makes it visible. This is equivalent to :object_name.state=nil. Triggers the on_show event.

hide() src

Hides the object. This is equivalent to :object_name.state=:not_visible. Triggers the on_hide event.

parent_window() src

Returns self. The parent_window of a window is self. This always needs to returns something because other methods don’t check for nil.

paint_focus?() src

Returns false because this object does not paint a focus.

windowX() src

Returns the x pixel location of the window relative to the windows left edge (non-client area).

windowY() src

Returns the y pixel location of the window relative to the windows top edge (non-client area).

screenX() src

Returns the x pixel location of the window client area relative to the screens top left edge. This is not the windows x position but the windows client area x value relative to the screen.

screenY() src

Returns the y pixel location of the windows client area relative to the screens top left edge. This is not the windows y value but the windows client area y value relative to the screen.

clientX() src

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

clientY() src

Returns the y pixel position of the client area of the object relative to the window’s upper left corner. Includes the height of the north border when it exists.

clientH() src

Returns the pixel height of the client area of the object. Takes the height of the title bar into consideration.

border() src

Returns nil because windows don’t support borders.

bwidth() src

Returns border width of the native GUI window.

bwidth_window() src

Returns 0. This is used when placing the objects in the one of the four borders.

title_bar_height() src

The height of the title bar as reported by the GUI Binding.

move(x, y, w=nil, h=nil, remember_position=nil) src

The outer frame has special needs.

on_load(levent=nil, &block) src

Triggers just as the Lwindow begins the process of opening. This is called before any attributes are gathered from parents and themes and before any missing data has been filled in. This event is only supported for Lwindow objects. Here is the order of events:

on_open(levent=nil, &block) src

Triggers just after the Lwindow and all it’s children are fully prepared and ready to open and just before the Lwindow is opened and displayed. This event is only supported for Lwindow objects. Here is the order of events:

on_show(levent=nil, &block) src

Triggers just after the Lwindow and all it’s children are opened and displayed. Also triggered when show() is called and when setting :state=nil. This event is only supported for Lwindow objects. Here is the order of events:

on_hide(levent=nil, &block) src

Triggers just before the window starts the closing process. Also triggered when hide() is called and when setting :state = :not_visible. This event is only supported for Lwindow objects. Here is the order of events:

on_close(levent=nil, &block) src

Triggers just as the Lwindow begins the process of closing. You can safely cancel this event by calling raise CancelEvent. This event is only supported for Lwindow objects. Here is the order of events:

on_unload(levent=nil, &block) src

Triggers after the Lwindow and it’s children have been closed. This event is only supported for Lwindow objects. Here is the order of events:

on_enter(levent=nil, &block) src

Cancels the balloon help timer. Triggers the on_enter event for any child object that needs to get the focus.

on_exit(levent=nil, &block) src

Cancels the balloon help timer. Triggers the on_exit event of any child object with the focus is called first. Also closes any open popup windows.

on_f1_key(levent=nil, &block) src

Don‘t trigger the on_help event.

on_move(levent=nil, &block) src

Track when the window is moved in an internal attribute so the new position can be saved when the window closes. This is triggered by the GUI when a window is moved.

on_resize(levent=nil, &block) src

Track if the window is resized in an internal attribute so the new size can be saved when the window closes. This is triggered by the GUI when a window is resized.

on_escape_key(levent=nil, &block) src

For window objects, the default action is to do nothing.

prepare(parent=nil, move_obj=nil) src

Retrieves the window’s position from the config file first then prepares the object. By default, the size and position of windows are stored in the config file and the window is always reopened where you last left it. Use :auto_save attribute to disable this feature.


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