From 033508e1b112feb0b89d0adee0c47268ce12e7e0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Wed, 1 Oct 2008 19:54:57 +0000 Subject: [PATCH] get rid of public constants for various XRC defaults, there's no need for them outside of XRC loader git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56023 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/doxygen/overviews/xrc_format.h | 14 +++++++------- include/wx/xrc/xh_gauge.h | 8 ++------ include/wx/xrc/xh_scrol.h | 10 ++-------- include/wx/xrc/xh_slidr.h | 10 ++-------- include/wx/xrc/xh_spin.h | 20 ++++---------------- src/xrc/xh_gauge.cpp | 4 +++- src/xrc/xh_slidr.cpp | 11 ++++++++--- src/xrc/xh_spin.cpp | 18 +++++++++++------- 8 files changed, 39 insertions(+), 56 deletions(-) diff --git a/docs/doxygen/overviews/xrc_format.h b/docs/doxygen/overviews/xrc_format.h index 5152171ac3..0c258a5dba 100644 --- a/docs/doxygen/overviews/xrc_format.h +++ b/docs/doxygen/overviews/xrc_format.h @@ -813,7 +813,7 @@ objects. If sizer child is used, it sets @beginTable @hdr3col{property, type, description} @row3col{range, integer, - Maximum value of the gauge (default: wxGAUGE_DEFAULT_RANGE).} + Maximum value of the gauge (default: 100).} @row3col{value, integer, Initial value of the control (default: 0).} @row3col{shadow, @ref xrc_format_type_dimension, @@ -1258,11 +1258,11 @@ HTML markup. Note that the markup has to be escaped: @beginTable @hdr3col{property, type, description} @row3col{value, integer, - Initial value of the control (default: wxSL_DEFAULT_VALUE).} + Initial value of the control (default: 0).} @row3col{min, integer, - Minimum allowed value (default: wxSL_DEFAULT_MIN).} + Minimum allowed value (default: 0).} @row3col{max, integer, - Maximum allowed value (default: wxSL_DEFAULT_MAX).} + Maximum allowed value (default: 100).} @row3col{pagesize, integer, Line size; number of steps the slider moves when the user moves pages up or down (default: unset).} @@ -1287,11 +1287,11 @@ HTML markup. Note that the markup has to be escaped: @beginTable @hdr3col{property, type, description} @row3col{value, integer, - Initial value of the control (default: wxSP_DEFAULT_VALUE).} + Initial value of the control (default: 0).} @row3col{min, integer, - Minimum allowed value (default: wxSP_DEFAULT_MIN).} + Minimum allowed value (default: 0).} @row3col{max, integer, - Maximum allowed value (default: wxSP_DEFAULT_MAX).} + Maximum allowed value (default: 100).} @endTable diff --git a/include/wx/xrc/xh_gauge.h b/include/wx/xrc/xh_gauge.h index 9aa45d921a..afdb3da89d 100644 --- a/include/wx/xrc/xh_gauge.h +++ b/include/wx/xrc/xh_gauge.h @@ -17,16 +17,12 @@ class WXDLLIMPEXP_XRC wxGaugeXmlHandler : public wxXmlResourceHandler { - DECLARE_DYNAMIC_CLASS(wxGaugeXmlHandler) - enum - { - wxGAUGE_DEFAULT_RANGE = 100 - }; - public: wxGaugeXmlHandler(); virtual wxObject *DoCreateResource(); virtual bool CanHandle(wxXmlNode *node); + + DECLARE_DYNAMIC_CLASS(wxGaugeXmlHandler) }; #endif // wxUSE_XRC && wxUSE_GAUGE diff --git a/include/wx/xrc/xh_scrol.h b/include/wx/xrc/xh_scrol.h index 3f2899045e..64f4230842 100644 --- a/include/wx/xrc/xh_scrol.h +++ b/include/wx/xrc/xh_scrol.h @@ -17,18 +17,12 @@ class WXDLLIMPEXP_XRC wxScrollBarXmlHandler : public wxXmlResourceHandler { - DECLARE_DYNAMIC_CLASS(wxScrollBarXmlHandler) - enum - { - wxSL_DEFAULT_VALUE = 0, - wxSL_DEFAULT_MIN = 0, - wxSL_DEFAULT_MAX = 100 - }; - public: wxScrollBarXmlHandler(); virtual wxObject *DoCreateResource(); virtual bool CanHandle(wxXmlNode *node); + + DECLARE_DYNAMIC_CLASS(wxScrollBarXmlHandler) }; #endif // wxUSE_XRC && wxUSE_SCROLLBAR diff --git a/include/wx/xrc/xh_slidr.h b/include/wx/xrc/xh_slidr.h index 345c03b6a5..fc2066798a 100644 --- a/include/wx/xrc/xh_slidr.h +++ b/include/wx/xrc/xh_slidr.h @@ -17,18 +17,12 @@ class WXDLLIMPEXP_XRC wxSliderXmlHandler : public wxXmlResourceHandler { - DECLARE_DYNAMIC_CLASS(wxSliderXmlHandler) - enum - { - wxSL_DEFAULT_VALUE = 0, - wxSL_DEFAULT_MIN = 0, - wxSL_DEFAULT_MAX = 100 - }; - public: wxSliderXmlHandler(); virtual wxObject *DoCreateResource(); virtual bool CanHandle(wxXmlNode *node); + + DECLARE_DYNAMIC_CLASS(wxSliderXmlHandler) }; #endif // wxUSE_XRC && wxUSE_SLIDER diff --git a/include/wx/xrc/xh_spin.h b/include/wx/xrc/xh_spin.h index c2b23b1b50..1182a33f03 100644 --- a/include/wx/xrc/xh_spin.h +++ b/include/wx/xrc/xh_spin.h @@ -19,18 +19,12 @@ class WXDLLIMPEXP_XRC wxSpinButtonXmlHandler : public wxXmlResourceHandler { - DECLARE_DYNAMIC_CLASS(wxSpinButtonXmlHandler) - enum - { - wxSP_DEFAULT_VALUE = 0, - wxSP_DEFAULT_MIN = 0, - wxSP_DEFAULT_MAX = 100 - }; - public: wxSpinButtonXmlHandler(); virtual wxObject *DoCreateResource(); virtual bool CanHandle(wxXmlNode *node); + + DECLARE_DYNAMIC_CLASS(wxSpinButtonXmlHandler) }; #endif // wxUSE_SPINBTN @@ -40,18 +34,12 @@ public: class WXDLLIMPEXP_XRC wxSpinCtrlXmlHandler : public wxXmlResourceHandler { - DECLARE_DYNAMIC_CLASS(wxSpinCtrlXmlHandler) - enum - { - wxSP_DEFAULT_VALUE = 0, - wxSP_DEFAULT_MIN = 0, - wxSP_DEFAULT_MAX = 100 - }; - public: wxSpinCtrlXmlHandler(); virtual wxObject *DoCreateResource(); virtual bool CanHandle(wxXmlNode *node); + + DECLARE_DYNAMIC_CLASS(wxSpinCtrlXmlHandler) }; #endif // wxUSE_SPINCTRL diff --git a/src/xrc/xh_gauge.cpp b/src/xrc/xh_gauge.cpp index 9d63af74d0..99ce99a363 100644 --- a/src/xrc/xh_gauge.cpp +++ b/src/xrc/xh_gauge.cpp @@ -23,6 +23,8 @@ #include "wx/gauge.h" #endif +static const long DEFAULT_RANGE = 100; + IMPLEMENT_DYNAMIC_CLASS(wxGaugeXmlHandler, wxXmlResourceHandler) wxGaugeXmlHandler::wxGaugeXmlHandler() @@ -43,7 +45,7 @@ wxObject *wxGaugeXmlHandler::DoCreateResource() control->Create(m_parentAsWindow, GetID(), - GetLong(wxT("range"), wxGAUGE_DEFAULT_RANGE), + GetLong(wxT("range"), DEFAULT_RANGE), GetPosition(), GetSize(), GetStyle(), wxDefaultValidator, diff --git a/src/xrc/xh_slidr.cpp b/src/xrc/xh_slidr.cpp index c34926df31..9f6e07cf31 100644 --- a/src/xrc/xh_slidr.cpp +++ b/src/xrc/xh_slidr.cpp @@ -23,6 +23,11 @@ #include "wx/slider.h" #endif +static const long DEFAULT_VALUE = 0; +static const long DEFAULT_MIN = 0; +static const long DEFAULT_MAX = 100; + + IMPLEMENT_DYNAMIC_CLASS(wxSliderXmlHandler, wxXmlResourceHandler) wxSliderXmlHandler::wxSliderXmlHandler() @@ -48,9 +53,9 @@ wxObject *wxSliderXmlHandler::DoCreateResource() control->Create(m_parentAsWindow, GetID(), - GetLong(wxT("value"), wxSL_DEFAULT_VALUE), - GetLong(wxT("min"), wxSL_DEFAULT_MIN), - GetLong(wxT("max"), wxSL_DEFAULT_MAX), + GetLong(wxT("value"), DEFAULT_VALUE), + GetLong(wxT("min"), DEFAULT_MIN), + GetLong(wxT("max"), DEFAULT_MAX), GetPosition(), GetSize(), GetStyle(), wxDefaultValidator, diff --git a/src/xrc/xh_spin.cpp b/src/xrc/xh_spin.cpp index 15e878c3d3..7ac87fe3ab 100644 --- a/src/xrc/xh_spin.cpp +++ b/src/xrc/xh_spin.cpp @@ -15,7 +15,7 @@ #pragma hdrstop #endif -#if wxUSE_XRC +#if wxUSE_XRC #include "wx/xrc/xh_spin.h" @@ -23,6 +23,10 @@ #include "wx/spinbutt.h" +static const long DEFAULT_VALUE = 0; +static const long DEFAULT_MIN = 0; +static const long DEFAULT_MAX = 100; + IMPLEMENT_DYNAMIC_CLASS(wxSpinButtonXmlHandler, wxXmlResourceHandler) wxSpinButtonXmlHandler::wxSpinButtonXmlHandler() @@ -45,9 +49,9 @@ wxObject *wxSpinButtonXmlHandler::DoCreateResource() GetStyle(wxT("style"), wxSP_VERTICAL | wxSP_ARROW_KEYS), GetName()); - control->SetValue(GetLong( wxT("value"), wxSP_DEFAULT_VALUE)); - control->SetRange(GetLong( wxT("min"), wxSP_DEFAULT_MIN), - GetLong(wxT("max"), wxSP_DEFAULT_MAX)); + control->SetValue(GetLong( wxT("value"), DEFAULT_VALUE)); + control->SetRange(GetLong( wxT("min"), DEFAULT_MIN), + GetLong(wxT("max"), DEFAULT_MAX)); SetupWindow(control); return control; @@ -84,9 +88,9 @@ wxObject *wxSpinCtrlXmlHandler::DoCreateResource() GetText(wxT("value")), GetPosition(), GetSize(), GetStyle(wxT("style"), wxSP_ARROW_KEYS), - GetLong(wxT("min"), wxSP_DEFAULT_MIN), - GetLong(wxT("max"), wxSP_DEFAULT_MAX), - GetLong(wxT("value"), wxSP_DEFAULT_VALUE), + GetLong(wxT("min"), DEFAULT_MIN), + GetLong(wxT("max"), DEFAULT_MAX), + GetLong(wxT("value"), DEFAULT_VALUE), GetName()); SetupWindow(control); -- 2.47.2