From 11b6a93b1e078fea5bf49ed9e6628a19849c11b3 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 6 Jan 2000 18:23:59 +0000 Subject: [PATCH] MSW compilation fixes for !wxUSE_VALIDATORS git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5279 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/bmpbuttn.cpp | 3 +++ src/msw/checkbox.cpp | 20 +++++++++++++------- src/msw/combobox.cpp | 2 ++ src/msw/fontenum.cpp | 6 +----- src/msw/gauge95.cpp | 2 ++ src/msw/gaugemsw.cpp | 2 ++ src/msw/listbox.cpp | 2 ++ src/msw/listctrl.cpp | 3 +++ src/msw/radiobut.cpp | 2 ++ src/msw/scrolbar.cpp | 2 ++ src/msw/slider95.cpp | 2 ++ src/msw/slidrmsw.cpp | 2 ++ src/msw/statbox.cpp | 2 +- src/msw/tbar95.cpp | 2 +- 14 files changed, 38 insertions(+), 14 deletions(-) diff --git a/src/msw/bmpbuttn.cpp b/src/msw/bmpbuttn.cpp index 1d0e976dc3..2cee20c982 100644 --- a/src/msw/bmpbuttn.cpp +++ b/src/msw/bmpbuttn.cpp @@ -39,7 +39,10 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, const wxBitmap& bit { m_buttonBitmap = bitmap; SetName(name); + +#if wxUSE_VALIDATORS SetValidator(validator); +#endif // wxUSE_VALIDATORS parent->AddChild(this); diff --git a/src/msw/checkbox.cpp b/src/msw/checkbox.cpp index fec4da27fc..3e8f804185 100644 --- a/src/msw/checkbox.cpp +++ b/src/msw/checkbox.cpp @@ -39,8 +39,8 @@ // macros // ---------------------------------------------------------------------------- - IMPLEMENT_DYNAMIC_CLASS(wxCheckBox, wxControl) - IMPLEMENT_DYNAMIC_CLASS(wxBitmapCheckBox, wxCheckBox) +IMPLEMENT_DYNAMIC_CLASS(wxCheckBox, wxControl) +IMPLEMENT_DYNAMIC_CLASS(wxBitmapCheckBox, wxCheckBox) // ============================================================================ // implementation @@ -60,14 +60,18 @@ bool wxCheckBox::MSWCommand(WXUINT WXUNUSED(param), WXWORD WXUNUSED(id)) } // Single check box item -bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label, - const wxPoint& pos, - const wxSize& size, long style, - const wxValidator& validator, - const wxString& name) +bool wxCheckBox::Create(wxWindow *parent, + wxWindowID id, + const wxString& label, + const wxPoint& pos, + const wxSize& size, long style, + const wxValidator& validator, + const wxString& name) { SetName(name); +#if wxUSE_VALIDATORS SetValidator(validator); +#endif // wxUSE_VALIDATORS if (parent) parent->AddChild(this); SetBackgroundColour(parent->GetBackgroundColour()) ; @@ -194,7 +198,9 @@ bool wxBitmapCheckBox::Create(wxWindow *parent, wxWindowID id, const wxBitmap *l const wxString& name) { SetName(name); +#if wxUSE_VALIDATORS SetValidator(validator); +#endif // wxUSE_VALIDATORS if (parent) parent->AddChild(this); SetBackgroundColour(parent->GetBackgroundColour()) ; diff --git a/src/msw/combobox.cpp b/src/msw/combobox.cpp index 9bab1a0cdb..8d6d7eada7 100644 --- a/src/msw/combobox.cpp +++ b/src/msw/combobox.cpp @@ -72,7 +72,9 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id, const wxString& name) { SetName(name); +#if wxUSE_VALIDATORS SetValidator(validator); +#endif // wxUSE_VALIDATORS if (parent) parent->AddChild(this); // SetBackgroundColour(parent->GetBackgroundColour()) ; diff --git a/src/msw/fontenum.cpp b/src/msw/fontenum.cpp index d8faa72bb0..f21279e182 100644 --- a/src/msw/fontenum.cpp +++ b/src/msw/fontenum.cpp @@ -111,11 +111,7 @@ bool wxFontEnumeratorHelper::SetEncoding(wxFontEncoding encoding) } #if defined(__GNUWIN32__) - #if defined(__MINGW32__) - #define wxFONTENUMPROC FONTENUMPROC - #else - #define wxFONTENUMPROC int(*)(ENUMLOGFONTEX *, NEWTEXTMETRICEX*, int, LPARAM) - #endif + #define wxFONTENUMPROC int(*)(ENUMLOGFONTEX *, NEWTEXTMETRICEX*, int, LPARAM) #else #define wxFONTENUMPROC FONTENUMPROC #endif diff --git a/src/msw/gauge95.cpp b/src/msw/gauge95.cpp index 0805a02f98..38b99d60dc 100644 --- a/src/msw/gauge95.cpp +++ b/src/msw/gauge95.cpp @@ -44,7 +44,9 @@ bool wxGauge95::Create(wxWindow *parent, wxWindowID id, const wxString& name) { SetName(name); +#if wxUSE_VALIDATORS SetValidator(validator); +#endif // wxUSE_VALIDATORS if (parent) parent->AddChild(this); m_rangeMax = range; diff --git a/src/msw/gaugemsw.cpp b/src/msw/gaugemsw.cpp index 542c123163..cb8c2b91d5 100644 --- a/src/msw/gaugemsw.cpp +++ b/src/msw/gaugemsw.cpp @@ -80,7 +80,9 @@ bool wxGaugeMSW::Create(wxWindow *parent, wxWindowID id, } SetName(name); +#if wxUSE_VALIDATORS SetValidator(validator); +#endif // wxUSE_VALIDATORS if (parent) parent->AddChild(this); m_rangeMax = range; diff --git a/src/msw/listbox.cpp b/src/msw/listbox.cpp index 3b42780fcb..128111853e 100644 --- a/src/msw/listbox.cpp +++ b/src/msw/listbox.cpp @@ -138,7 +138,9 @@ bool wxListBox::Create(wxWindow *parent, m_selected = 0; SetName(name); +#if wxUSE_VALIDATORS SetValidator(validator); +#endif // wxUSE_VALIDATORS if (parent) parent->AddChild(this); diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index 8f09f1fcb3..b74816ce5b 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -126,7 +126,10 @@ bool wxListCtrl::Create(wxWindow *parent, const wxValidator& validator, const wxString& name) { +#if wxUSE_VALIDATORS SetValidator(validator); +#endif // wxUSE_VALIDATORS + SetName(name); int x = pos.x; diff --git a/src/msw/radiobut.cpp b/src/msw/radiobut.cpp index 67653ecc5d..0f7b1dc92e 100644 --- a/src/msw/radiobut.cpp +++ b/src/msw/radiobut.cpp @@ -52,7 +52,9 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id, const wxString& name) { SetName(name); +#if wxUSE_VALIDATORS SetValidator(validator); +#endif // wxUSE_VALIDATORS if (parent) parent->AddChild(this); diff --git a/src/msw/scrolbar.cpp b/src/msw/scrolbar.cpp index 2072573681..f5c9a867dd 100644 --- a/src/msw/scrolbar.cpp +++ b/src/msw/scrolbar.cpp @@ -48,7 +48,9 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id, return FALSE; parent->AddChild(this); SetName(name); +#if wxUSE_VALIDATORS SetValidator(validator); +#endif // wxUSE_VALIDATORS SetBackgroundColour(parent->GetBackgroundColour()) ; SetForegroundColour(parent->GetForegroundColour()) ; diff --git a/src/msw/slider95.cpp b/src/msw/slider95.cpp index ef1e073fbf..69af911269 100644 --- a/src/msw/slider95.cpp +++ b/src/msw/slider95.cpp @@ -58,7 +58,9 @@ bool wxSlider95::Create(wxWindow *parent, wxWindowID id, const wxString& name) { SetName(name); +#if wxUSE_VALIDATORS SetValidator(validator); +#endif // wxUSE_VALIDATORS if (parent) parent->AddChild(this); SetBackgroundColour(parent->GetBackgroundColour()) ; diff --git a/src/msw/slidrmsw.cpp b/src/msw/slidrmsw.cpp index 1bb9b0876d..7aa2ccfe03 100644 --- a/src/msw/slidrmsw.cpp +++ b/src/msw/slidrmsw.cpp @@ -52,7 +52,9 @@ bool wxSliderMSW::Create(wxWindow *parent, wxWindowID id, const wxString& name) { SetName(name); +#if wxUSE_VALIDATORS SetValidator(validator); +#endif // wxUSE_VALIDATORS if (parent) parent->AddChild(this); SetBackgroundColour(parent->GetBackgroundColour()) ; diff --git a/src/msw/statbox.cpp b/src/msw/statbox.cpp index f08e16db70..da2eac0ecc 100644 --- a/src/msw/statbox.cpp +++ b/src/msw/statbox.cpp @@ -59,7 +59,7 @@ bool wxStaticBox::Create(wxWindow *parent, long style, const wxString& name) { - if ( !CreateControl(parent, id, pos, size, style, name) ) + if ( !CreateControl(parent, id, pos, size, style, wxDefaultValidator, name) ) return FALSE; if ( !MSWCreateControl(wxT("BUTTON"), BS_GROUPBOX, pos, size, label, 0) ) diff --git a/src/msw/tbar95.cpp b/src/msw/tbar95.cpp index 6a84b47a6b..bce6f60039 100644 --- a/src/msw/tbar95.cpp +++ b/src/msw/tbar95.cpp @@ -192,7 +192,7 @@ bool wxToolBar::Create(wxWindow *parent, const wxString& name) { // common initialisation - if ( !CreateControl(parent, id, pos, size, style, name) ) + if ( !CreateControl(parent, id, pos, size, style, wxDefaultValidator, name) ) return FALSE; // prepare flags -- 2.47.2