class WXDLLIMPEXP_CORE wxSpinCtrl : public wxSpinButton
{
public:
- wxSpinCtrl() { }
+ wxSpinCtrl() { Init(); }
wxSpinCtrl(wxWindow *parent,
wxWindowID id = wxID_ANY,
int min = 0, int max = 100, int initial = 0,
const wxString& name = wxT("wxSpinCtrl"))
{
+ Init();
+
Create(parent, id, value, pos, size, style, min, max, initial, name);
}
bool m_blockEvent;
private:
+ // Common part of all ctors.
+ void Init();
+
DECLARE_DYNAMIC_CLASS(wxSpinCtrl)
DECLARE_EVENT_TABLE()
wxDECLARE_NO_COPY_CLASS(wxSpinCtrl);
// construction
// ----------------------------------------------------------------------------
+void wxSpinCtrl::Init()
+{
+ m_blockEvent = false;
+ m_hwndBuddy = NULL;
+ m_wndProcBuddy = NULL;
+ m_oldValue = INT_MIN;
+}
+
bool wxSpinCtrl::Create(wxWindow *parent,
wxWindowID id,
const wxString& value,
int min, int max, int initial,
const wxString& name)
{
- m_blockEvent = false;
-
- // this should be in ctor/init function but I don't want to add one to 2.8
- // to avoid problems with default ctor which can be inlined in the user
- // code and so might not get this fix without recompilation
- m_oldValue = INT_MIN;
-
// before using DoGetBestSize(), have to set style to let the base class
// know whether this is a horizontal or vertical control (we're always
// vertical)