Version: 2.9.4
Public Member Functions
wxSpinButton Class Reference

#include </home/zeitlin/src/wx/github/interface/wx/spinbutt.h>

Inheritance diagram for wxSpinButton:

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.

注:
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

This class supports the following styles:

Events emitted by this class

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

void handlerFuncName(wxSpinEvent& event)

Event macros for events emitted by this class:

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
参照:
wxSpinCtrl

Public Member Functions

 wxSpinButton ()
 Default constructor.
 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.
virtual ~wxSpinButton ()
 Destructor, destroys the spin button control.
bool 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.
virtual int GetMax () const
 Returns the maximum permissible value.
virtual int GetMin () const
 Returns the minimum permissible value.
virtual int GetValue () const
 Returns the current spin button value.
virtual void SetRange (int min, int max)
 Sets the range of the spin button.
virtual void SetValue (int value)
 Sets the value of the spin button.

List of all members.


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:
parentParent window. Must not be NULL.
idWindow identifier. The value wxID_ANY indicates a default value.
posWindow position. If wxDefaultPosition is specified then a default position is chosen.
sizeWindow size. If wxDefaultSize is specified then a default size is chosen.
styleWindow style. See wxSpinButton class description.
nameWindow name.
参照:
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.

Reimplemented from wxWindow.

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

Returns the maximum permissible value.

参照:
SetRange()
virtual int wxSpinButton::GetMin ( ) const [virtual]

Returns the minimum permissible value.

参照:
SetRange()
virtual int wxSpinButton::GetValue ( ) const [virtual]

Returns the current spin button value.

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

Sets the range of the spin button.

Parameters:
minThe minimum value for the spin button.
maxThe maximum value for the spin button.
参照:
GetMin(), GetMax()
virtual void wxSpinButton::SetValue ( int  value) [virtual]

Sets the value of the spin button.

Parameters:
valueThe value for the spin button.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines