Ensure that wxSpinCtrl::SetValue() doesn't generate any events as documented
This is already the case for the other overloads, but not for the one taking wxString.
This commit is contained in:
parent
1d3d0ae496
commit
9c8c70891e
2 changed files with 11 additions and 7 deletions
|
|
@ -55,6 +55,8 @@ protected:
|
|||
|
||||
class WXDLLIMPEXP_CORE wxSpinCtrl : public wxSpinCtrlQt< int, QSpinBox >
|
||||
{
|
||||
using BaseType = wxSpinCtrlQt< int, QSpinBox >;
|
||||
|
||||
public:
|
||||
wxSpinCtrl();
|
||||
wxSpinCtrl(wxWindow *parent,
|
||||
|
|
@ -77,7 +79,7 @@ public:
|
|||
virtual int GetBase() const override { return m_base; }
|
||||
virtual bool SetBase(int base) override;
|
||||
virtual void SetValue(const wxString & val) override;
|
||||
virtual void SetValue(int val) override { wxSpinCtrlQt<int,QSpinBox>::SetValue(val); }
|
||||
virtual void SetValue(int val) override { BaseType::SetValue(val); }
|
||||
|
||||
private:
|
||||
// Common part of all ctors.
|
||||
|
|
@ -91,6 +93,8 @@ private:
|
|||
|
||||
class WXDLLIMPEXP_CORE wxSpinCtrlDouble : public wxSpinCtrlQt< double, QDoubleSpinBox >
|
||||
{
|
||||
using BaseType = wxSpinCtrlQt< double, QDoubleSpinBox >;
|
||||
|
||||
public:
|
||||
wxSpinCtrlDouble();
|
||||
wxSpinCtrlDouble(wxWindow *parent,
|
||||
|
|
@ -119,7 +123,7 @@ public:
|
|||
virtual int GetBase() const override { return 10; }
|
||||
virtual bool SetBase(int WXUNUSED(base)) override { return false; }
|
||||
virtual void SetValue(const wxString & val) override;
|
||||
virtual void SetValue(double val) override { wxSpinCtrlQt<double,QDoubleSpinBox>::SetValue(val); }
|
||||
virtual void SetValue(double val) override { BaseType::SetValue(val); }
|
||||
|
||||
private:
|
||||
wxDECLARE_DYNAMIC_CLASS( wxSpinCtrlDouble );
|
||||
|
|
|
|||
|
|
@ -24,9 +24,9 @@ wxSpinCtrlQt< T, Widget >::wxSpinCtrlQt() :
|
|||
}
|
||||
|
||||
template< typename T, typename Widget >
|
||||
wxSpinCtrlQt< T, Widget >::wxSpinCtrlQt( wxWindow *WXUNUSED(WXUNUSED(parent)), wxWindowID WXUNUSED(WXUNUSED(id)),
|
||||
const wxString& WXUNUSED(WXUNUSED(value)), const wxPoint& WXUNUSED(WXUNUSED(pos)), const wxSize& WXUNUSED(WXUNUSED(size)), long WXUNUSED(WXUNUSED(style)),
|
||||
T WXUNUSED(WXUNUSED(min)), T WXUNUSED(WXUNUSED(max)), T WXUNUSED(WXUNUSED(initial)), T WXUNUSED(WXUNUSED(inc)), const wxString& WXUNUSED(WXUNUSED(name)) )
|
||||
wxSpinCtrlQt< T, Widget >::wxSpinCtrlQt( wxWindow *WXUNUSED(parent), wxWindowID WXUNUSED(id),
|
||||
const wxString& WXUNUSED(value), const wxPoint& WXUNUSED(pos), const wxSize& WXUNUSED(size), long WXUNUSED(style),
|
||||
T WXUNUSED(min), T WXUNUSED(max), T WXUNUSED(initial), T WXUNUSED(inc), const wxString& WXUNUSED(name) )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -247,7 +247,7 @@ void wxSpinCtrl::SetValue( const wxString &value )
|
|||
// valueFromText can be called if m_qtSpinBox is an instance of the helper class
|
||||
wxQtSpinBox * qtSpinBox = dynamic_cast<wxQtSpinBox *> ((QSpinBox *) m_qtSpinBox);
|
||||
if (qtSpinBox != nullptr)
|
||||
qtSpinBox->setValue( qtSpinBox->valueFromText( wxQtConvertString( value )));
|
||||
BaseType::SetValue( qtSpinBox->valueFromText( wxQtConvertString( value )));
|
||||
}
|
||||
|
||||
//##############################################################################
|
||||
|
|
@ -296,7 +296,7 @@ void wxSpinCtrlDouble::SetValue( const wxString &value )
|
|||
// valueFromText can be called if m_qtSpinBox is an instance of the helper class
|
||||
wxQtDoubleSpinBox * qtSpinBox = dynamic_cast<wxQtDoubleSpinBox *> ((QDoubleSpinBox *) m_qtSpinBox);
|
||||
if (qtSpinBox != nullptr)
|
||||
qtSpinBox->setValue( qtSpinBox->valueFromText( wxQtConvertString( value )));
|
||||
BaseType::SetValue( qtSpinBox->valueFromText( wxQtConvertString( value )));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue