Class
Lspinner
Home
In: locana/l_spinner.rb
Parent: Ltextbox

This is a textbox with two small buttons on the right to increment/decrement the value in the textbox. This class is based on the Ltextbox class. This supports the optional :text attribute that contains an array of strings that is used during on_increment and on_decrement. The :text attribute is optional and if not provided on_increment/on_decrement calls succ! and decc! (decc! is new method added to String in l_others.rb) for Stings. The on_increment and on_decrement events are triggered using the up and down arrow keys and by clicking on one of the buttons.

Methods

clientW, close, include_objects, move, on_decrement, on_down_key, on_increment, on_up_key, open, pixel_width, prepare, state=, valid_attribute?,
Public Instance methods
include_objects() src

Creates the button for the spinner.

valid_attribute?(attribute, lvalue=nil) src

Supports the :otype attributes of :value, and :text.

open(parent) src

Opens the buttons.

close() src

Closes the buttons.

prepare(parent=nil, move_obj=nil) src

Make sure the buttons are positioned and sized correctly. The height of the button matches the height of the datebox.

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

Repositions the buttons based on the new size of the spinner.

pixel_width() src

The pixel width of the textbox + the width of the buttons.

clientW() src

The pixel width of the textbox less the width of the pixel buttons.

state=(new_value) src

Forward this to the button.

on_up_key(levent=nil, &block) src

Triggers the on_increment() event unless the shift/ctrl/alt/meta keys are pressed.

on_down_key(levent=nil, &block) src

Triggers the on_decrement() event unless the shift/ctrl/alt/meta keys are pressed.

on_increment(levent=nil, &block) src

Increments the spinner. The default action is as follows:

on_decrement(levent=nil, &block) src

Decrements the spinner. The default action is as follows:


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