2008-03-08 13:52:38 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: spinctrl.h
|
|
|
|
// Purpose: documentation for wxSpinCtrl class
|
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Licence: wxWindows license
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxSpinCtrl
|
|
|
|
@wxheader{spinctrl.h}
|
2008-03-08 14:43:31 +00:00
|
|
|
|
|
|
|
wxSpinCtrl combines wxTextCtrl and
|
2008-03-08 13:52:38 +00:00
|
|
|
wxSpinButton in one control.
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@beginStyleTable
|
|
|
|
@style{wxSP_ARROW_KEYS}:
|
|
|
|
The user can use arrow keys to change the value.
|
|
|
|
@style{wxSP_WRAP}:
|
|
|
|
The value wraps at the minimum and maximum.
|
|
|
|
@endStyleTable
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@library{wxcore}
|
|
|
|
@category{ctrl}
|
|
|
|
@appearance{spinctrl.png}
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@seealso
|
|
|
|
@ref overview_eventhandlingoverview "Event handling overview", wxSpinButton,
|
|
|
|
wxControl
|
|
|
|
*/
|
|
|
|
class wxSpinCtrl : public wxControl
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
//@{
|
|
|
|
/**
|
|
|
|
)
|
|
|
|
|
|
|
|
Constructor, creating and showing a spin control.
|
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param parent
|
2008-03-08 13:52:38 +00:00
|
|
|
Parent window. Must not be @NULL.
|
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param value
|
2008-03-08 13:52:38 +00:00
|
|
|
Default value.
|
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param id
|
2008-03-08 13:52:38 +00:00
|
|
|
Window identifier. The value wxID_ANY indicates a default value.
|
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param pos
|
2008-03-08 13:52:38 +00:00
|
|
|
Window position. If wxDefaultPosition is specified then a default position
|
|
|
|
is chosen.
|
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param size
|
2008-03-08 13:52:38 +00:00
|
|
|
Window size. If wxDefaultSize is specified then a default size is
|
|
|
|
chosen.
|
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param style
|
2008-03-08 13:52:38 +00:00
|
|
|
Window style. See wxSpinButton.
|
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param min
|
2008-03-08 13:52:38 +00:00
|
|
|
Minimal value.
|
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param max
|
2008-03-08 13:52:38 +00:00
|
|
|
Maximal value.
|
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param initial
|
2008-03-08 13:52:38 +00:00
|
|
|
Initial value.
|
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param name
|
2008-03-08 13:52:38 +00:00
|
|
|
Window name.
|
|
|
|
|
|
|
|
@sa Create()
|
|
|
|
*/
|
|
|
|
wxSpinCtrl();
|
2008-03-08 14:43:31 +00:00
|
|
|
wxSpinCtrl(wxWindow* parent, wxWindowID id = -1,
|
|
|
|
const wxString& value = wxEmptyString,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxSP_ARROW_KEYS,
|
|
|
|
int min = 0, int max = 100,
|
|
|
|
int initial = 0);
|
2008-03-08 13:52:38 +00:00
|
|
|
//@}
|
|
|
|
|
|
|
|
/**
|
|
|
|
)
|
|
|
|
|
|
|
|
Creation function called by the spin control constructor.
|
|
|
|
|
|
|
|
See wxSpinCtrl() for details.
|
|
|
|
*/
|
|
|
|
bool Create(wxWindow* parent, wxWindowID id = -1,
|
|
|
|
const wxString& value = wxEmptyString,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxSP_ARROW_KEYS,
|
|
|
|
int min = 0, int max = 100,
|
|
|
|
int initial = 0);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Gets maximal allowable value.
|
|
|
|
*/
|
|
|
|
int GetMax();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Gets minimal allowable value.
|
|
|
|
*/
|
|
|
|
int GetMin();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Gets the value of the spin control.
|
|
|
|
*/
|
|
|
|
int GetValue();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets range of allowable values.
|
|
|
|
*/
|
|
|
|
void SetRange(int minVal, int maxVal);
|
|
|
|
|
|
|
|
/**
|
2008-03-08 14:43:31 +00:00
|
|
|
Select the text in the text part of the control between positions
|
|
|
|
@e from (inclusive) and @e to (exclusive). This is similar to
|
2008-03-08 13:52:38 +00:00
|
|
|
wxTextCtrl::SetSelection.
|
|
|
|
|
|
|
|
@b NB: this is currently only implemented for Windows and generic versions
|
|
|
|
of the control.
|
|
|
|
*/
|
|
|
|
void SetSelection(long from, long to);
|
|
|
|
|
|
|
|
//@{
|
|
|
|
/**
|
|
|
|
Sets the value of the spin control.
|
|
|
|
*/
|
|
|
|
void SetValue(const wxString& text);
|
2008-03-08 14:43:31 +00:00
|
|
|
void SetValue(int value);
|
2008-03-08 13:52:38 +00:00
|
|
|
//@}
|
|
|
|
};
|