]> git.saurik.com Git - wxWidgets.git/commitdiff
use wxALIGN_LEFT/CENTRE/RIGHT instead of wxTE_XXX to avoid problems with the latter...
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 22 Mar 2009 10:55:55 +0000 (10:55 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 22 Mar 2009 10:55:55 +0000 (10:55 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59722 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
include/wx/generic/spinctlg.h
include/wx/msw/spinctrl.h
include/wx/osx/spinctrl.h
interface/wx/spinctrl.h
src/gtk/spinctrl.cpp
src/msw/spinctrl.cpp
src/osx/spinctrl_osx.cpp
src/xrc/xh_spin.cpp

index e088b7ed12b7c6f201cd40aa93b7f7f102f9471f..532d531ab2c11cd0b3436f56d3495c4948302ecd 100644 (file)
@@ -503,6 +503,7 @@ All (GUI):
 - Render <th> element contents in bold in wxHTML.
 - Added wxGrid::{Set,Get}{Row,Col}Sizes() methods (Andrey Putrin).
 - Add support for wxSP_WRAP in the generic version of wxSpinCtrlDouble.
 - Render <th> element contents in bold in wxHTML.
 - Added wxGrid::{Set,Get}{Row,Col}Sizes() methods (Andrey Putrin).
 - Add support for wxSP_WRAP in the generic version of wxSpinCtrlDouble.
+- Add alignment flags support to wxSpinCtrl[Double] (Andrew Radke).
 - Added wxGetSelectedChoices() replacing wxGetMultipleChoices() (Kolya Kosenko).
 
 wxGTK:
 - Added wxGetSelectedChoices() replacing wxGetMultipleChoices() (Kolya Kosenko).
 
 wxGTK:
index 0cc65d090de90cd4a57f15e5aec0b13b4e754151..1fe9c2b9845aeb09aa9253cc8d256685deee81be 100644 (file)
@@ -50,7 +50,7 @@ public:
                 const wxString& value = wxEmptyString,
                 const wxPoint& pos = wxDefaultPosition,
                 const wxSize& size = wxDefaultSize,
                 const wxString& value = wxEmptyString,
                 const wxPoint& pos = wxDefaultPosition,
                 const wxSize& size = wxDefaultSize,
-                long style = wxSP_ARROW_KEYS | wxTE_RIGHT,
+                long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
                 double min = 0, double max = 100, double initial = 0,
                 double inc = 1,
                 const wxString& name = _T("wxSpinCtrl"));
                 double min = 0, double max = 100, double initial = 0,
                 double inc = 1,
                 const wxString& name = _T("wxSpinCtrl"));
@@ -158,7 +158,7 @@ public:
                 const wxString& value = wxEmptyString,
                 const wxPoint& pos = wxDefaultPosition,
                 const wxSize& size = wxDefaultSize,
                 const wxString& value = wxEmptyString,
                 const wxPoint& pos = wxDefaultPosition,
                 const wxSize& size = wxDefaultSize,
-                long style = wxSP_ARROW_KEYS | wxTE_RIGHT,
+                long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
                 double min = 0, double max = 100, double initial = 0,
                 double inc = 1,
                 const wxString& name = _T("wxSpinCtrl"))
                 double min = 0, double max = 100, double initial = 0,
                 double inc = 1,
                 const wxString& name = _T("wxSpinCtrl"))
@@ -243,7 +243,7 @@ public:
                const wxString& value = wxEmptyString,
                const wxPoint& pos = wxDefaultPosition,
                const wxSize& size = wxDefaultSize,
                const wxString& value = wxEmptyString,
                const wxPoint& pos = wxDefaultPosition,
                const wxSize& size = wxDefaultSize,
-               long style = wxSP_ARROW_KEYS | wxTE_RIGHT,
+               long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
                int min = 0, int max = 100, int initial = 0,
                const wxString& name = _T("wxSpinCtrl"))
     {
                int min = 0, int max = 100, int initial = 0,
                const wxString& name = _T("wxSpinCtrl"))
     {
@@ -255,7 +255,7 @@ public:
                 const wxString& value = wxEmptyString,
                 const wxPoint& pos = wxDefaultPosition,
                 const wxSize& size = wxDefaultSize,
                 const wxString& value = wxEmptyString,
                 const wxPoint& pos = wxDefaultPosition,
                 const wxSize& size = wxDefaultSize,
-                long style = wxSP_ARROW_KEYS | wxTE_RIGHT,
+                long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
                 int min = 0, int max = 100, int initial = 0,
                 const wxString& name = _T("wxSpinCtrl"))
     {
                 int min = 0, int max = 100, int initial = 0,
                 const wxString& name = _T("wxSpinCtrl"))
     {
@@ -299,7 +299,7 @@ public:
                      const wxString& value = wxEmptyString,
                      const wxPoint& pos = wxDefaultPosition,
                      const wxSize& size = wxDefaultSize,
                      const wxString& value = wxEmptyString,
                      const wxPoint& pos = wxDefaultPosition,
                      const wxSize& size = wxDefaultSize,
-                     long style = wxSP_ARROW_KEYS | wxTE_RIGHT,
+                     long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
                      double min = 0, double max = 100, double initial = 0,
                      double inc = 1,
                      const wxString& name = _T("wxSpinCtrlDouble"))
                      double min = 0, double max = 100, double initial = 0,
                      double inc = 1,
                      const wxString& name = _T("wxSpinCtrlDouble"))
@@ -314,7 +314,7 @@ public:
                 const wxString& value = wxEmptyString,
                 const wxPoint& pos = wxDefaultPosition,
                 const wxSize& size = wxDefaultSize,
                 const wxString& value = wxEmptyString,
                 const wxPoint& pos = wxDefaultPosition,
                 const wxSize& size = wxDefaultSize,
-                long style = wxSP_ARROW_KEYS | wxTE_RIGHT,
+                long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
                 double min = 0, double max = 100, double initial = 0,
                 double inc = 1,
                 const wxString& name = _T("wxSpinCtrlDouble"))
                 double min = 0, double max = 100, double initial = 0,
                 double inc = 1,
                 const wxString& name = _T("wxSpinCtrlDouble"))
index cedd0601e54b71e4effa4457b89b1a8202736532..3e533ed0914335f3cf4e72e3a76f6915c69e1559 100644 (file)
@@ -37,7 +37,7 @@ public:
                const wxString& value = wxEmptyString,
                const wxPoint& pos = wxDefaultPosition,
                const wxSize& size = wxDefaultSize,
                const wxString& value = wxEmptyString,
                const wxPoint& pos = wxDefaultPosition,
                const wxSize& size = wxDefaultSize,
-               long style = wxSP_ARROW_KEYS | wxTE_RIGHT,
+               long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
                int min = 0, int max = 100, int initial = 0,
                const wxString& name = _T("wxSpinCtrl"))
     {
                int min = 0, int max = 100, int initial = 0,
                const wxString& name = _T("wxSpinCtrl"))
     {
@@ -49,7 +49,7 @@ public:
                 const wxString& value = wxEmptyString,
                 const wxPoint& pos = wxDefaultPosition,
                 const wxSize& size = wxDefaultSize,
                 const wxString& value = wxEmptyString,
                 const wxPoint& pos = wxDefaultPosition,
                 const wxSize& size = wxDefaultSize,
-                long style = wxSP_ARROW_KEYS | wxTE_RIGHT,
+                long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
                 int min = 0, int max = 100, int initial = 0,
                 const wxString& name = _T("wxSpinCtrl"));
 
                 int min = 0, int max = 100, int initial = 0,
                 const wxString& name = _T("wxSpinCtrl"));
 
index a2f0c6223a54edf61c3fa40221cc6604a2a3ffe2..efc6f7f554726cf2e1fb84012c4eecad8dd7227e 100644 (file)
@@ -20,7 +20,7 @@
 // without tons of #ifdefs.
 // ----------------------------------------------------------------------------
 
 // without tons of #ifdefs.
 // ----------------------------------------------------------------------------
 
-#if wxUSE_SPINBTN 
+#if wxUSE_SPINBTN
 
 #include "wx/containr.h"
 
 
 #include "wx/containr.h"
 
@@ -43,7 +43,7 @@ public:
                const wxString& value = wxEmptyString,
                const wxPoint& pos = wxDefaultPosition,
                const wxSize& size = wxDefaultSize,
                const wxString& value = wxEmptyString,
                const wxPoint& pos = wxDefaultPosition,
                const wxSize& size = wxDefaultSize,
-               long style = wxSP_ARROW_KEYS | wxTE_RIGHT,
+               long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
                int min = 0, int max = 100, int initial = 0,
                const wxString& name = _T("wxSpinCtrl"))
     {
                int min = 0, int max = 100, int initial = 0,
                const wxString& name = _T("wxSpinCtrl"))
     {
@@ -56,7 +56,7 @@ public:
                 const wxString& value = wxEmptyString,
                 const wxPoint& pos = wxDefaultPosition,
                 const wxSize& size = wxDefaultSize,
                 const wxString& value = wxEmptyString,
                 const wxPoint& pos = wxDefaultPosition,
                 const wxSize& size = wxDefaultSize,
-                long style = wxSP_ARROW_KEYS | wxTE_RIGHT,
+                long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
                 int min = 0, int max = 100, int initial = 0,
                 const wxString& name = _T("wxSpinCtrl"));
 
                 int min = 0, int max = 100, int initial = 0,
                 const wxString& name = _T("wxSpinCtrl"));
 
@@ -107,10 +107,10 @@ private:
     // the subcontrols
     wxTextCtrl *m_text;
     wxSpinButton *m_btn;
     // the subcontrols
     wxTextCtrl *m_text;
     wxSpinButton *m_btn;
-    
+
     friend class wxSpinCtrlText;
     friend class wxSpinCtrlButton;
     friend class wxSpinCtrlText;
     friend class wxSpinCtrlButton;
-    
+
     int            m_oldValue;
 private:
     DECLARE_EVENT_TABLE()
     int            m_oldValue;
 private:
     DECLARE_EVENT_TABLE()
@@ -135,7 +135,7 @@ public:
                const wxString& value = wxEmptyString,
                const wxPoint& pos = wxDefaultPosition,
                const wxSize& size = wxDefaultSize,
                const wxString& value = wxEmptyString,
                const wxPoint& pos = wxDefaultPosition,
                const wxSize& size = wxDefaultSize,
-               long style = wxSP_ARROW_KEYS | wxTE_RIGHT,
+               long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
                int min = 0, int max = 100, int initial = 0,
                const wxString& name = _T("wxSpinCtrl"))
     {
                int min = 0, int max = 100, int initial = 0,
                const wxString& name = _T("wxSpinCtrl"))
     {
@@ -147,7 +147,7 @@ public:
                 const wxString& value = wxEmptyString,
                 const wxPoint& pos = wxDefaultPosition,
                 const wxSize& size = wxDefaultSize,
                 const wxString& value = wxEmptyString,
                 const wxPoint& pos = wxDefaultPosition,
                 const wxSize& size = wxDefaultSize,
-                long style = wxSP_ARROW_KEYS | wxTE_RIGHT,
+                long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
                 int min = 0, int max = 100, int initial = 0,
                 const wxString& name = _T("wxSpinCtrl"))
     {
                 int min = 0, int max = 100, int initial = 0,
                 const wxString& name = _T("wxSpinCtrl"))
     {
index 877aa32007e6f0669d7c6d89b9481d2563369956..62e6f93eaa92b3475016b93f69404dc07c89ce8f 100644 (file)
         events. Using this style will prevent the user from using the Enter key
         for dialog navigation (e.g. activating the default button in the
         dialog) under MSW.
         events. Using this style will prevent the user from using the Enter key
         for dialog navigation (e.g. activating the default button in the
         dialog) under MSW.
-    @style{wxTE_LEFT}
-        Same as for wxTextCtrl: the text is left aligned.
-    @style{wxTE_CENTER}
-        Same as for wxTextCtrl: the text is centered.
-    @style{wxTE_RIGHT}
-        Same as for wxTextCtrl: the text is right aligned (this is the
-        default).
+    @style{wxALIGN_LEFT}
+        Same as wxTE_LEFT for wxTextCtrl: the text is left aligned.
+    @style{wxALIGN_CENTRE}
+        Same as wxTE_CENTRE for wxTextCtrl: the text is centered.
+    @style{wxALIGN_RIGHT}
+        Same as wxTE_RIGHT for wxTextCtrl: the text is right aligned (this is
+        the default).
     @endStyleTable
 
 
     @endStyleTable
 
 
index 5d1e3c18e3fc5f25e097f8f005538e311f4b9601..5c53cd491acae0eb8aeafb176e4731ed9c9d5d84 100644 (file)
@@ -119,9 +119,9 @@ bool wxSpinCtrlGTKBase::Create(wxWindow *parent, wxWindowID id,
     m_value = gtk_spin_button_get_value( GTK_SPIN_BUTTON(m_widget));
 
     gfloat align;
     m_value = gtk_spin_button_get_value( GTK_SPIN_BUTTON(m_widget));
 
     gfloat align;
-    if ( HasFlag(wxTE_RIGHT) )
+    if ( HasFlag(wxALIGN_RIGHT) )
         align = 1.0;
         align = 1.0;
-    else if ( HasFlag(wxTE_CENTRE) )
+    else if ( HasFlag(wxALIGN_CENTRE) )
         align = 0.5;
     else
         align = 0.0;
         align = 0.5;
     else
         align = 0.0;
index 298319ad2d127ee48746f8058ae59565e9f6a0b6..d7a13374d0a8b3cf121f0b989d3f8633f740bacb 100644 (file)
@@ -336,11 +336,11 @@ bool wxSpinCtrl::Create(wxWindow *parent,
     WXDWORD msStyle = MSWGetStyle(GetWindowStyle(), & exStyle) ;
 
     // propagate text alignment style to text ctrl
     WXDWORD msStyle = MSWGetStyle(GetWindowStyle(), & exStyle) ;
 
     // propagate text alignment style to text ctrl
-    if ( style & wxTE_RIGHT )
+    if ( style & wxALIGN_RIGHT )
         msStyle |= ES_RIGHT;
         msStyle |= ES_RIGHT;
-    else if ( style & wxTE_CENTER )
+    else if ( style & wxALIGN_CENTER )
         msStyle |= ES_CENTER;
         msStyle |= ES_CENTER;
-    
+
     // this control is used for numeric entry so normally using these flags by
     // default shouldn't be a problem, if it is we can always add a style such
     // as wxSP_NON_NUMERIC later
     // this control is used for numeric entry so normally using these flags by
     // default shouldn't be a problem, if it is we can always add a style such
     // as wxSP_NON_NUMERIC later
@@ -481,7 +481,7 @@ void wxSpinCtrl::SetValue(const wxString& text)
 void  wxSpinCtrl::SetValue(int val)
 {
     m_blockEvent = true;
 void  wxSpinCtrl::SetValue(int val)
 {
     m_blockEvent = true;
-    
+
     wxSpinButton::SetValue(val);
 
     // normally setting the value of the spin button is enough as it updates
     wxSpinButton::SetValue(val);
 
     // normally setting the value of the spin button is enough as it updates
@@ -497,7 +497,7 @@ void  wxSpinCtrl::SetValue(int val)
     }
 
     m_oldValue = GetValue();
     }
 
     m_oldValue = GetValue();
-    
+
     m_blockEvent = false;
 }
 
     m_blockEvent = false;
 }
 
index 2704bdf77377060bd630e35c64307b04a4ac3015..1a582d7f6c0164b90f5e712df460001338cba837 100644 (file)
@@ -66,7 +66,7 @@ protected:
          event.SetEventObject( GetParent() );
          GetParent()->HandleWindowEvent(event);
      }
          event.SetEventObject( GetParent() );
          GetParent()->HandleWindowEvent(event);
      }
-     
+
      void OnKillFocus(wxFocusEvent& event)
      {
          long l;
      void OnKillFocus(wxFocusEvent& event)
      {
          long l;
@@ -102,7 +102,7 @@ protected:
 
              m_spin->m_oldValue = l;
          }
 
              m_spin->m_oldValue = l;
          }
-         
+
          // delegate to parent control
          event.SetEventObject( GetParent() );
          GetParent()->HandleWindowEvent(event);
          // delegate to parent control
          event.SetEventObject( GetParent() );
          GetParent()->HandleWindowEvent(event);
index 5115b639d7b772cda0100e9da99f367c405e826e..5684e747770748635eb07304a15a86bdf3948ac5 100644 (file)
@@ -77,9 +77,9 @@ wxSpinCtrlXmlHandler::wxSpinCtrlXmlHandler()
     XRC_ADD_STYLE(wxSP_VERTICAL);
     XRC_ADD_STYLE(wxSP_ARROW_KEYS);
     XRC_ADD_STYLE(wxSP_WRAP);
     XRC_ADD_STYLE(wxSP_VERTICAL);
     XRC_ADD_STYLE(wxSP_ARROW_KEYS);
     XRC_ADD_STYLE(wxSP_WRAP);
-    XRC_ADD_STYLE(wxTE_LEFT);
-    XRC_ADD_STYLE(wxTE_CENTER);
-    XRC_ADD_STYLE(wxTE_RIGHT);
+    XRC_ADD_STYLE(wxALIGN_LEFT);
+    XRC_ADD_STYLE(wxALIGN_CENTER);
+    XRC_ADD_STYLE(wxALIGN_RIGHT);
 }
 
 wxObject *wxSpinCtrlXmlHandler::DoCreateResource()
 }
 
 wxObject *wxSpinCtrlXmlHandler::DoCreateResource()
@@ -90,7 +90,7 @@ wxObject *wxSpinCtrlXmlHandler::DoCreateResource()
                     GetID(),
                     GetText(wxT("value")),
                     GetPosition(), GetSize(),
                     GetID(),
                     GetText(wxT("value")),
                     GetPosition(), GetSize(),
-                    GetStyle(wxT("style"), wxSP_ARROW_KEYS | wxTE_RIGHT),
+                    GetStyle(wxT("style"), wxSP_ARROW_KEYS | wxALIGN_RIGHT),
                     GetLong(wxT("min"), DEFAULT_MIN),
                     GetLong(wxT("max"), DEFAULT_MAX),
                     GetLong(wxT("value"), DEFAULT_VALUE),
                     GetLong(wxT("min"), DEFAULT_MIN),
                     GetLong(wxT("max"), DEFAULT_MAX),
                     GetLong(wxT("value"), DEFAULT_VALUE),