rename classes use by generic wxSpinCtrl implementation to have "Generic" suffix to avoid conflicts with the classes with the same names in wxMac

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52673 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-03-22 03:15:56 +00:00
parent 8907a7e2c0
commit 405f0fef4b
2 changed files with 21 additions and 21 deletions

View File

@@ -25,7 +25,7 @@
class WXDLLIMPEXP_FWD_CORE wxSpinButton; class WXDLLIMPEXP_FWD_CORE wxSpinButton;
class WXDLLIMPEXP_FWD_CORE wxTextCtrl; class WXDLLIMPEXP_FWD_CORE wxTextCtrl;
class wxSpinCtrlText; // wxTextCtrl used for the wxSpinCtrlGenericBase class wxSpinCtrlTextGeneric; // wxTextCtrl used for the wxSpinCtrlGenericBase
// The !wxUSE_SPINBTN version's GetValue() function conflicts with the // The !wxUSE_SPINBTN version's GetValue() function conflicts with the
// wxTextCtrl's GetValue() and so you have to input a dummy int value. // wxTextCtrl's GetValue() and so you have to input a dummy int value.
@@ -91,7 +91,7 @@ public:
void OnTextEnter(wxCommandEvent& event); void OnTextEnter(wxCommandEvent& event);
void OnTextChar(wxKeyEvent& event); void OnTextChar(wxKeyEvent& event);
friend class wxSpinCtrlText; friend class wxSpinCtrlTextGeneric;
protected: protected:
// override the base class virtuals involved into geometry calculations // override the base class virtuals involved into geometry calculations

View File

@@ -52,13 +52,13 @@ static const wxCoord MARGIN = 2;
#define SPINCTRLBUT_MAX 32000 // large to avoid wrap around trouble #define SPINCTRLBUT_MAX 32000 // large to avoid wrap around trouble
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxSpinCtrlText: text control used by spin control // wxSpinCtrlTextGeneric: text control used by spin control
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
class wxSpinCtrlText : public wxTextCtrl class wxSpinCtrlTextGeneric : public wxTextCtrl
{ {
public: public:
wxSpinCtrlText(wxSpinCtrlGenericBase *spin, const wxString& value) wxSpinCtrlTextGeneric(wxSpinCtrlGenericBase *spin, const wxString& value)
: wxTextCtrl(spin->GetParent(), wxID_ANY, value, wxDefaultPosition, : wxTextCtrl(spin->GetParent(), wxID_ANY, value, wxDefaultPosition,
wxDefaultSize, wxTE_NOHIDESEL|wxTE_PROCESS_ENTER) wxDefaultSize, wxTE_NOHIDESEL|wxTE_PROCESS_ENTER)
{ {
@@ -68,7 +68,7 @@ public:
SetSizeHints(wxDefaultCoord, wxDefaultCoord); SetSizeHints(wxDefaultCoord, wxDefaultCoord);
} }
virtual ~wxSpinCtrlText() virtual ~wxSpinCtrlTextGeneric()
{ {
// MSW sends extra kill focus event on destroy // MSW sends extra kill focus event on destroy
if (m_spin) if (m_spin)
@@ -106,22 +106,22 @@ private:
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
BEGIN_EVENT_TABLE(wxSpinCtrlText, wxTextCtrl) BEGIN_EVENT_TABLE(wxSpinCtrlTextGeneric, wxTextCtrl)
EVT_TEXT_ENTER(wxID_ANY, wxSpinCtrlText::OnTextEnter) EVT_TEXT_ENTER(wxID_ANY, wxSpinCtrlTextGeneric::OnTextEnter)
EVT_CHAR(wxSpinCtrlText::OnChar) EVT_CHAR(wxSpinCtrlTextGeneric::OnChar)
EVT_KILL_FOCUS(wxSpinCtrlText::OnKillFocus) EVT_KILL_FOCUS(wxSpinCtrlTextGeneric::OnKillFocus)
END_EVENT_TABLE() END_EVENT_TABLE()
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxSpinCtrlButton: spin button used by spin control // wxSpinCtrlButtonGeneric: spin button used by spin control
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
class wxSpinCtrlButton : public wxSpinButton class wxSpinCtrlButtonGeneric : public wxSpinButton
{ {
public: public:
wxSpinCtrlButton(wxSpinCtrlGenericBase *spin, int style) wxSpinCtrlButtonGeneric(wxSpinCtrlGenericBase *spin, int style)
: wxSpinButton(spin->GetParent(), wxID_ANY, wxDefaultPosition, : wxSpinButton(spin->GetParent(), wxID_ANY, wxDefaultPosition,
wxDefaultSize, style | wxSP_VERTICAL) wxDefaultSize, style | wxSP_VERTICAL)
{ {
@@ -145,9 +145,9 @@ private:
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
BEGIN_EVENT_TABLE(wxSpinCtrlButton, wxSpinButton) BEGIN_EVENT_TABLE(wxSpinCtrlButtonGeneric, wxSpinButton)
EVT_SPIN_UP( wxID_ANY, wxSpinCtrlButton::OnSpinButton) EVT_SPIN_UP( wxID_ANY, wxSpinCtrlButtonGeneric::OnSpinButton)
EVT_SPIN_DOWN(wxID_ANY, wxSpinCtrlButton::OnSpinButton) EVT_SPIN_DOWN(wxID_ANY, wxSpinCtrlButtonGeneric::OnSpinButton)
END_EVENT_TABLE() END_EVENT_TABLE()
// ============================================================================ // ============================================================================
@@ -196,8 +196,8 @@ bool wxSpinCtrlGenericBase::Create(wxWindow *parent,
m_max = max; m_max = max;
m_increment = increment; m_increment = increment;
m_textCtrl = new wxSpinCtrlText(this, value); m_textCtrl = new wxSpinCtrlTextGeneric(this, value);
m_spinButton = new wxSpinCtrlButton(this, style); m_spinButton = new wxSpinCtrlButtonGeneric(this, style);
m_spin_value = m_spinButton->GetValue(); m_spin_value = m_spinButton->GetValue();
@@ -239,10 +239,10 @@ wxSpinCtrlGenericBase::~wxSpinCtrlGenericBase()
if (m_textCtrl) if (m_textCtrl)
{ {
// null this since MSW sends KILL_FOCUS on deletion, see ~wxSpinCtrlText // null this since MSW sends KILL_FOCUS on deletion, see ~wxSpinCtrlTextGeneric
wxDynamicCast(m_textCtrl, wxSpinCtrlText)->m_spin = NULL; wxDynamicCast(m_textCtrl, wxSpinCtrlTextGeneric)->m_spin = NULL;
wxSpinCtrlText *text = (wxSpinCtrlText*)m_textCtrl; wxSpinCtrlTextGeneric *text = (wxSpinCtrlTextGeneric*)m_textCtrl;
m_textCtrl = NULL; m_textCtrl = NULL;
delete text; delete text;
} }