wxRuby Documentation Home

Wx::SpinButton

A SpinButton has two small up and down (or left and right) arrow buttons. It is often used next to a text control for increment and decrementing a value. Portable programs should try to use SpinCtrl instead as SpinButton is not implemented for all platforms but SpinCtrl is as it degenerates to a simple TextCtrl on such platforms.

NB: the range supported by this control (and SpinCtrl) depends on the platform but is at least -0x8000 to 0x7fff. Under GTK and Win32 with sufficiently new version of comctrl32.dll (at least 4.71 is required, 5.80 is recommended) the full 32 bit range is supported.

Derived from

Control

Window

EvtHandler

Object

See also

SpinCtrl

Window styles

SP_HORIZONTAL Specifies a horizontal spin button (note that this style is not supported in GTK).
SP_VERTICAL Specifies a vertical spin button.
SP_ARROW_KEYS The user can use arrow keys to change the value.
SP_WRAP The value wraps at the minimum and maximum.

See also window styles overview.

spinevt.inc

See also

Event handling overview

Methods

SpinButton.new

SpinButton.new(Window parent,  Integer id, 
               Point pos = DEFAULT_POSITION, 
               Size size = DEFAULT_SIZE, 
               Integer style = SP_HORIZONTAL, 
               String name = "spinButton")

Constructor, creating and showing a spin button.

Parameters

See also

SpinButton#create

destructor()

Destructor, destroys the spin button control.

SpinButton#create

Boolean create(Window parent,  Integer id, 
               Point pos = DEFAULT_POSITION, 
               Size size = DEFAULT_SIZE, 
               Integer style = SP_HORIZONTAL, 
               String name = "spinButton")

Scrollbar creation function called by the spin button constructor. See SpinButton.new for details.

SpinButton#get_max

Integer get_max()

Returns the maximum permissible value.

See also

SpinButton#set_range

SpinButton#get_min

Integer get_min()

Returns the minimum permissible value.

See also

SpinButton#set_range

SpinButton#get_value

Integer get_value()

Returns the current spin button value.

See also

SpinButton#set_value

SpinButton#set_range

set_range(Integer min,  Integer max)

Sets the range of the spin button.

Parameters

See also

SpinButton#get_min, SpinButton#get_max

SpinButton#set_value

set_value(Integer value)

Sets the value of the spin button.

Parameters

See also

SpinButton#get_value

[This page automatically generated from the Textile source at Wed Sep 09 02:21:23 +0100 2009]