// headers
// ----------------------------------------------------------------------------
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
- #pragma implementation "spinctlg.h"
-#endif
-
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
: wxTextCtrl(spin->GetParent(), wxID_ANY, value)
{
m_spin = spin;
-
+
// remove the default minsize, the spinctrl will have one instead
- SetSizeHints(wxDefaultSize.x,wxDefaultSize.y);
+ SetSizeHints(wxDefaultCoord,wxDefaultCoord);
}
protected:
SetWindowStyle(style | wxSP_VERTICAL);
// remove the default minsize, the spinctrl will have one instead
- SetSizeHints(wxDefaultSize.x,wxDefaultSize.y);
+ SetSizeHints(wxDefaultCoord,wxDefaultCoord);
}
protected:
bool wxSpinCtrl::Create(wxWindow *parent,
wxWindowID id,
const wxString& value,
- const wxPoint& WXUNUSED(pos),
+ const wxPoint& pos,
const wxSize& size,
long style,
int min,
m_text = new wxSpinCtrlText(this, value);
m_btn = new wxSpinCtrlButton(this, style);
-
+
m_btn->SetRange(min, max);
m_btn->SetValue(initial);
- SetBestSize(size);
-
+ SetInitialSize(size);
+ Move(pos);
+
// have to disable this window to avoid interfering it with message
// processing to the text and the button... but pretend it is enabled to
// make IsEnabled() return true
wxCoord wText = width - sizeBtn.x;
m_text->SetSize(x, y, wText, height);
- m_btn->SetSize(x + wText + MARGIN, y, wxDefaultSize.x, height);
+ m_btn->SetSize(x + wText + MARGIN, y, wxDefaultCoord, height);
}
// ----------------------------------------------------------------------------
return true;
}
+bool wxSpinCtrl::Reparent(wxWindow *newParent)
+{
+ if ( m_btn )
+ {
+ m_btn->Reparent(newParent);
+ m_text->Reparent(newParent);
+ }
+
+ return true;
+}
+
// ----------------------------------------------------------------------------
// value and range access
// ----------------------------------------------------------------------------