Class
Lbutton
Home
In: locana/l_button.rb
Parent: Lobject

This class creates a push button. It is based on the Lobject class. Buttons trigger an :on_click event when the user clicks (:on_mouse_lup) the mouse over the button. This class also supports the following additional attributes:

Methods

align, default_bg, default_bg_highlight, default_border, default_border_highlight, default_fg, default_fg_highlight, inherit_color_from_parent?, ipadx, ipady, justify, on_enter_key, on_mouse_ldn, on_mouse_lup, on_mouse_out, on_mouse_over, paint_normal, pixel_height, pixel_width, skip_object_theme, text=, toggle_highlight, valid_attribute?,
Public Instance methods
valid_attribute?(attribute, lvalue=nil) src

Support the :bitmap attribute.

inherit_color_from_parent?() src

Buttons don’t inherit color from it’s parent like other objects. Returns false.

skip_object_theme() src

Returns True. Buttons don’t pull from the :object portion of the any theme.

default_border() src

Returns :raised.

default_border_highlight() src

Returns :sunken. This is the default border highlight used when the button is clicked on.

default_fg() src

Returns :sys_button_fg.

default_bg() src

Returns :sys_button_bg.

default_fg_highlight() src

Returns default_fg(). Highlighting a button (by clicking on it) does not change it’s color.

default_bg_highlight() src

Returns default_bg(). Highlighting a button (by clicking on it) does not change it’s color.

toggle_highlight(new_value=nil) src

Buttons are highlighted by changing the border. This calls toggle_highlight_border.

ipadx() src

The default is 6 to make the button look a little cleaner.

ipady() src

The default is 2 to make the button look a little cleaner.

align() src

The default is :middle.

justify() src

The default is :center.

text=(new_value) src

Converts the ’&’ character (except ’& ’) to an accelerator.

paint_normal() src

Paints the button in a normal state (not disabled, not highlighted, etc.)

on_mouse_ldn(levent=nil, &block) src

Calls toggle_highlight to support toggling the border when the left mouse button pressed over the button.

on_mouse_lup(levent=nil, &block) src

Triggers the :on_click event and calls toggle_highlight to support toggling the border when the left mouse button is released.

on_mouse_out(levent=nil, &block) src

Calls toggle_highlight to support toggling the border when the mouse moves outside the button and left mouse button is pressed.

on_mouse_over(levent=nil, &block) src

Calls toggle_highlight to support toggling the border when the mouse moves over the button and left mouse button is pressed.

on_enter_key(levent=nil, &block) src

Triggers the on_click event.

pixel_width() src

Returns the pixel width of the text in the object. This should take into consideration the font, size, and style of the object and its parents. This is used to calculate width of the object when needed.

pixel_height() src

Returns the pixel height of the text in the object. This should take into consideration the font, size, and style of the object and its parents. This is used to calculate height of the object when 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