wxSpinButton Class Reference
[Controls]

#include <wx/spinbutt.h>

Inheritance diagram for wxSpinButton:

wxControl wxWindow wxEvtHandler wxObject

List of all members.


Detailed Description

A wxSpinButton 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 wxSpinCtrl instead as wxSpinButton is not implemented for all platforms but wxSpinCtrl is as it degenerates to a simple wxTextCtrl on such platforms.

Note:
the range supported by this control (and wxSpinCtrl) 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.
Styles:
Events:

The following event handler macros redirect the events to member function handlers 'func' with prototypes like:

void handlerFuncName(wxSpinEvent& event)
Event macros:
Note that if you handle both SPIN and UP or DOWN events, you will be notified about each of them twice: first the UP/DOWN event will be received and then, if it wasn't vetoed, the SPIN event will be sent.

Library:  wxCore

Category:  Controls

Appearance:
wxMSW appearancewxGTK appearancewxMac appearance
wxMSW appearancewxGTK appearancewxMac appearance

See also:
wxSpinCtrl

Public Member Functions

 wxSpinButton ()
 wxSpinButton (wxWindow *parent, wxWindowID id=-1, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxSP_VERTICAL, const wxString &name="spinButton")
virtual ~wxSpinButton ()
bool Create (wxWindow *parent, wxWindowID id=-1, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxSP_VERTICAL, const wxString &name="wxSpinButton")
virtual int GetMax () const
virtual int GetMin () const
virtual int GetValue () const
virtual void SetRange (int min, int max)
virtual void SetValue (int value)

Constructor & Destructor Documentation

wxSpinButton::wxSpinButton (  ) 

Default constructor.

wxSpinButton::wxSpinButton ( wxWindow parent,
wxWindowID  id = -1,
const wxPoint pos = wxDefaultPosition,
const wxSize size = wxDefaultSize,
long  style = wxSP_VERTICAL,
const wxString name = "spinButton" 
)

Constructor, creating and showing a spin button.

Parameters:
parent Parent window. Must not be NULL.
id Window identifier. The value wxID_ANY indicates a default value.
pos Window position. If wxDefaultPosition is specified then a default position is chosen.
size Window size. If wxDefaultSize is specified then a default size is chosen.
style Window style. See wxSpinButton class description.
name Window name.
See also:
Create()

virtual wxSpinButton::~wxSpinButton (  )  [virtual]

Destructor, destroys the spin button control.


Member Function Documentation

bool wxSpinButton::Create ( wxWindow parent,
wxWindowID  id = -1,
const wxPoint pos = wxDefaultPosition,
const wxSize size = wxDefaultSize,
long  style = wxSP_VERTICAL,
const wxString name = "wxSpinButton" 
)

Scrollbar creation function called by the spin button constructor. See wxSpinButton() for details.

virtual int wxSpinButton::GetMax (  )  const [virtual]

Returns the maximum permissible value.

See also:
SetRange()

virtual int wxSpinButton::GetMin (  )  const [virtual]

Returns the minimum permissible value.

See also:
SetRange()

virtual int wxSpinButton::GetValue (  )  const [virtual]

Returns the current spin button value.

See also:
SetValue()

virtual void wxSpinButton::SetRange ( int  min,
int  max 
) [virtual]

Sets the range of the spin button.

Parameters:
min The minimum value for the spin button.
max The maximum value for the spin button.
See also:
GetMin(), GetMax()

virtual void wxSpinButton::SetValue ( int  value  )  [virtual]

Sets the value of the spin button.

Parameters:
value The value for the spin button.



wxWidgets logo

[ top ]