Add wxSpinCtrl::GetTextValue()
This allows to retrieve the current contents of the text entry part of wxSpinCtrl. For now provide a stub in the base class, will be made pure virtual later. Co-Authored-By: Vadim Zeitlin <vadim@wxwidgets.org>
This commit is contained in:
@@ -60,6 +60,7 @@ public:
|
||||
virtual ~wxSpinCtrlGenericBase();
|
||||
|
||||
// accessors
|
||||
virtual wxString GetTextValue() const wxOVERRIDE;
|
||||
// T GetValue() const
|
||||
// T GetMin() const
|
||||
// T GetMax() const
|
||||
|
@@ -35,6 +35,7 @@ public:
|
||||
// wxSpinCtrl(Double) methods call DoXXX functions of the same name
|
||||
|
||||
// accessors
|
||||
virtual wxString GetTextValue() const wxOVERRIDE;
|
||||
// T GetValue() const
|
||||
// T GetMin() const
|
||||
// T GetMax() const
|
||||
|
@@ -62,6 +62,7 @@ public:
|
||||
void SetSelection(long from, long to);
|
||||
|
||||
// wxSpinCtrlBase methods
|
||||
virtual wxString GetTextValue() const;
|
||||
virtual int GetBase() const;
|
||||
virtual bool SetBase(int base);
|
||||
|
||||
|
@@ -35,6 +35,7 @@ public:
|
||||
wxSpinCtrlBase() {}
|
||||
|
||||
// accessor functions that derived classes are expected to have
|
||||
virtual wxString GetTextValue() const { return wxString(); }
|
||||
// T GetValue() const
|
||||
// T GetMin() const
|
||||
// T GetMax() const
|
||||
|
@@ -133,6 +133,13 @@ public:
|
||||
*/
|
||||
int GetMin() const;
|
||||
|
||||
/**
|
||||
Returns the text in the text entry part of the control.
|
||||
|
||||
@since 3.1.6
|
||||
*/
|
||||
wxString GetTextValue() const;
|
||||
|
||||
/**
|
||||
Gets the value of the spin control.
|
||||
*/
|
||||
@@ -315,6 +322,13 @@ public:
|
||||
*/
|
||||
double GetMin() const;
|
||||
|
||||
/**
|
||||
Returns the text in the text entry part of the control.
|
||||
|
||||
@since 3.1.6
|
||||
*/
|
||||
wxString GetTextValue() const;
|
||||
|
||||
/**
|
||||
Gets the value of the spin control.
|
||||
*/
|
||||
|
@@ -506,6 +506,11 @@ bool wxSpinCtrlGenericBase::SyncSpinToText(SendEvent sendEvent)
|
||||
// changing value and range
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxString wxSpinCtrlGenericBase::GetTextValue() const
|
||||
{
|
||||
return m_textCtrl ? m_textCtrl->GetValue() : wxString();
|
||||
}
|
||||
|
||||
void wxSpinCtrlGenericBase::SetValue(const wxString& text)
|
||||
{
|
||||
wxCHECK_RET( m_textCtrl, wxT("invalid call to wxSpinCtrl::SetValue") );
|
||||
|
@@ -214,6 +214,13 @@ double wxSpinCtrlGTKBase::DoGetIncrement() const
|
||||
return inc;
|
||||
}
|
||||
|
||||
wxString wxSpinCtrlGTKBase::GetTextValue() const
|
||||
{
|
||||
wxCHECK_MSG(m_widget, wxEmptyString, "invalid spin button");
|
||||
|
||||
return gtk_entry_get_text( GTK_ENTRY(m_widget) );
|
||||
}
|
||||
|
||||
bool wxSpinCtrlGTKBase::GetSnapToTicks() const
|
||||
{
|
||||
wxCHECK_MSG(m_widget, false, "invalid spin button");
|
||||
|
@@ -442,6 +442,11 @@ bool wxSpinCtrl::SetBase(int base)
|
||||
// wxTextCtrl-like methods
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxString wxSpinCtrl::GetTextValue() const
|
||||
{
|
||||
return wxGetWindowText(m_hwndBuddy);
|
||||
}
|
||||
|
||||
void wxSpinCtrl::SetValue(const wxString& text)
|
||||
{
|
||||
if ( !::SetWindowText(GetBuddyHwnd(), text.c_str()) )
|
||||
|
Reference in New Issue
Block a user