long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
double min = 0, double max = 100, double initial = 0,
double inc = 1,
long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
double min = 0, double max = 100, double initial = 0,
double inc = 1,
// forward these functions to all subcontrols
virtual bool Enable(bool enable = true);
virtual bool Show(bool show = true);
// forward these functions to all subcontrols
virtual bool Enable(bool enable = true);
virtual bool Show(bool show = true);
+ // this window itself is used only as a container for its sub windows so it
+ // shouldn't accept the focus at all and any attempts to explicitly set
+ // focus to it should give focus to its text constol part
+ virtual bool AcceptsFocus() const { return false; }
+ virtual void SetFocus();
+
friend class wxSpinCtrlTextGeneric;
protected:
// override the base class virtuals involved into geometry calculations
virtual wxSize DoGetBestSize() const;
friend class wxSpinCtrlTextGeneric;
protected:
// override the base class virtuals involved into geometry calculations
virtual wxSize DoGetBestSize() const;
virtual void DoMoveWindow(int x, int y, int width, int height);
virtual void DoMoveWindow(int x, int y, int width, int height);
// generic double valued functions
double DoGetValue() const { return m_value; }
bool DoSetValue(double val);
void DoSetRange(double min_val, double max_val);
void DoSetIncrement(double inc);
// generic double valued functions
double DoGetValue() const { return m_value; }
bool DoSetValue(double val);
void DoSetRange(double min_val, double max_val);
void DoSetIncrement(double inc);
- // Ensure that the textctrl shows correct value
- void SyncSpinToText();
+ // update our value to reflect the text control contents (if it has been
+ // modified by user, do nothing otherwise)
+ //
+ // can also change the text control if its value is invalid
+ //
+ // return true if our value has changed
+ bool SyncSpinToText();
// check if the value is in range
bool InRange(double n) const { return (n >= m_min) && (n <= m_max); }
// check if the value is in range
bool InRange(double n) const { return (n >= m_min) && (n <= m_max); }
long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
double min = 0, double max = 100, double initial = 0,
double inc = 1,
long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
double min = 0, double max = 100, double initial = 0,
double inc = 1,
wxSpinCtrl(wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxString& value = wxEmptyString,
wxSpinCtrl(wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxString& value = wxEmptyString,
const wxSize& size = wxDefaultSize,
long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
int min = 0, int max = 100, int initial = 0,
const wxSize& size = wxDefaultSize,
long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
int min = 0, int max = 100, int initial = 0,
Create(parent, id, value, pos, size, style, min, max, initial, name);
}
Create(parent, id, value, pos, size, style, min, max, initial, name);
}
const wxSize& size = wxDefaultSize,
long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
int min = 0, int max = 100, int initial = 0,
const wxSize& size = wxDefaultSize,
long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
int min = 0, int max = 100, int initial = 0,
{
return wxSpinCtrlGenericBase::Create(parent, id, value, pos, size,
style, min, max, initial, 1, name);
}
// accessors
{
return wxSpinCtrlGenericBase::Create(parent, id, value, pos, size,
style, min, max, initial, 1, name);
}
// accessors
- int GetValue(wxSPINCTRL_GETVALUE_FIX) const
- { return wxRound( DoGetValue() ); }
- int GetMin() const { return wxRound( m_min ); }
- int GetMax() const { return wxRound( m_max ); }
- int GetIncrement() const { return wxRound( m_increment ); }
+ int GetValue(wxSPINCTRL_GETVALUE_FIX) const { return int(DoGetValue()); }
+ int GetMin() const { return int(m_min); }
+ int GetMax() const { return int(m_max); }
+ int GetIncrement() const { return int(m_increment); }
// operations
void SetValue(const wxString& value)
{ wxSpinCtrlGenericBase::SetValue(value); }
void SetValue( int value ) { DoSetValue(value); }
void SetRange( int minVal, int maxVal ) { DoSetRange(minVal, maxVal); }
// operations
void SetValue(const wxString& value)
{ wxSpinCtrlGenericBase::SetValue(value); }
void SetValue( int value ) { DoSetValue(value); }
void SetRange( int minVal, int maxVal ) { DoSetRange(minVal, maxVal); }
wxSpinCtrlDouble(wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxString& value = wxEmptyString,
wxSpinCtrlDouble(wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxString& value = wxEmptyString,
long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
double min = 0, double max = 100, double initial = 0,
double inc = 1,
long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
double min = 0, double max = 100, double initial = 0,
double inc = 1,
Create(parent, id, value, pos, size, style,
min, max, initial, inc, name);
}
Create(parent, id, value, pos, size, style,
min, max, initial, inc, name);
}
long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
double min = 0, double max = 100, double initial = 0,
double inc = 1,
long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
double min = 0, double max = 100, double initial = 0,
double inc = 1,
{
return wxSpinCtrlGenericBase::Create(parent, id, value, pos, size,
style, min, max, initial,
{
return wxSpinCtrlGenericBase::Create(parent, id, value, pos, size,
style, min, max, initial,
+ // We don't implement bases support for floating point numbers, this is not
+ // very useful in practice.
+ virtual int GetBase() const { return 10; }
+ virtual bool SetBase(int WXUNUSED(base)) { return 0; }
+