]> git.saurik.com Git - wxWidgets.git/commitdiff
Deprecate second parameter of wxSlider::SetTickFreq().
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 5 Feb 2011 16:36:30 +0000 (16:36 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 5 Feb 2011 16:36:30 +0000 (16:36 +0000)
This parameter was never needed nor properly documented. Simply remove it from
SetTickFreq() and keep the overload still taking it for backwards
compatibility only.

Closes #12907.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66844 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

18 files changed:
docs/changes.txt
include/wx/cocoa/slider.h
include/wx/msw/slider.h
include/wx/os2/slider.h
include/wx/osx/slider.h
include/wx/palmos/slider.h
include/wx/slider.h
include/wx/univ/slider.h
interface/wx/slider.h
samples/controls/controls.cpp
samples/widgets/slider.cpp
src/cocoa/slider.mm
src/msw/slider.cpp
src/os2/slider.cpp
src/osx/slider_osx.cpp
src/palmos/slider.cpp
src/univ/slider.cpp
src/xrc/xh_slidr.cpp

index 1605e451e83b8c0370c289f1d2e64e8f93bc0785..905066a05137cd4c571573b3b5d3bb0fdcb8f48c 100644 (file)
@@ -377,7 +377,9 @@ Deprecated methods and their replacements
   with more expected semantics.
 - wxPORTRAIT and wxLANDSCAPE are now elements of wxPrintOrientation enum and
   wxPrintData::SetOrientation(int) takes wxPrintOrientation and not int.
-
+- Second parameter of wxSlider::SetTickFreq(int n, int pos) is deprecated,
+  simply remove it from your code and use wxSlider::SetTickFreq(int n) as it
+  was never used anyhow.
 
 Major new features in this release
 ----------------------------------
index 0b5e20df709ca80b81acd09224b783ff5f0c7e29..46a4ef7c40ee73059b954ed3950e135b75607002 100644 (file)
@@ -94,12 +94,14 @@ public:
     virtual int GetThumbLength() const;
 
     // copied from (wxSliderCocoa.h)
-    virtual void SetTickFreq(int n, int pos);
     virtual int GetTickFreq() const;
-    virtual void ClearTicks() { SetTickFreq(0, 0); }
+    virtual void ClearTicks() { SetTickFreq(0); }
 
     virtual void SetTickPos(int pos);
 
+protected:
+    // Platform-specific implementation of SetTickFreq
+    virtual void DoSetTickFreq(int freq);
 };
 
 #endif
index e84a0e146a09b6240d495a35cf06320cccf67bcb..abd4ec4985fa0a771e084afea13044d699906f37 100644 (file)
@@ -59,7 +59,6 @@ public:
     int GetMax() const { return m_rangeMax; }
 
     // Win32-specific slider methods
-    void SetTickFreq(int n, int pos);
     int GetTickFreq() const { return m_tickFreq; }
     void SetPageSize(int pageSize);
     int GetPageSize() const;
@@ -131,6 +130,9 @@ protected:
     // of dragging the thumb or scrolling the mouse wheel
     bool m_isDragging;
 
+    // Platform-specific implementation of SetTickFreq
+    virtual void DoSetTickFreq(int freq);
+
     DECLARE_DYNAMIC_CLASS_NO_COPY(wxSlider)
 };
 
index 9fc369c7e5e3510d26e7b8d1cdc0d662a01aeced..92b71310370dc458045d6c0b4035055b4fbb0d30 100644 (file)
@@ -94,9 +94,6 @@ public:
                                   );
                  void SetThumbLength(int nLen) ;
                  void SetTick(int ntickPos) ;
-                 void SetTickFreq( int n
-                                  ,int nPos
-                                 );
 
     //
     // IMPLEMENTATION
@@ -148,6 +145,10 @@ protected:
                            ,int  nHeight
                            ,int  nSizeFlags = wxSIZE_AUTO
                           );
+
+    // Platform-specific implementation of SetTickFreq
+    virtual void DoSetTickFreq(int freq);
+
 private:
     DECLARE_DYNAMIC_CLASS(wxSlider)
 }; // end of CLASS wxSlider
index 535d61c22ed37b8f5ad90d7a6e5c4a85d2367596..851a8eabebeb02fd5046ed49cd7b2db245001338 100644 (file)
@@ -59,7 +59,6 @@ public:
     void SetMax(int maxValue) { SetRange(m_rangeMin, maxValue); }
 
     // For trackbars only
-    void SetTickFreq(int n, int pos);
     inline int GetTickFreq() const { return m_tickFreq; }
     void SetPageSize(int pageSize);
     int GetPageSize() const ;
@@ -81,6 +80,9 @@ public:
     virtual void TriggerScrollEvent( wxEventType scrollEvent ) ;
 
 protected:
+    // Platform-specific implementation of SetTickFreq
+    virtual void DoSetTickFreq(int freq);
+
     virtual wxSize DoGetBestSize() const;
     virtual void   DoSetSize(int x, int y, int w, int h, int sizeFlags);
     virtual void   DoMoveWindow(int x, int y, int w, int h);
index 078d5d23ec7e9cb7c34e3dff4de0fd3b7bd4d1d7..5c978c1b9c2e298362cbe59d0b0504e51d39efb4 100644 (file)
@@ -52,7 +52,6 @@ public:
     int GetMax() const;
 
     // For trackbars only
-    void SetTickFreq(int n, int pos);
     int GetTickFreq() const;
     void SetPageSize(int pageSize);
     int GetPageSize() const;
@@ -75,6 +74,8 @@ public:
     bool SendScrollEvent(WXEVENTPTR event);
 
 protected:
+    // Platform-specific implementation of SetTickFreq
+    virtual void DoSetTickFreq(int freq);
 
     virtual wxSize DoGetBestSize() const;
 
index 84896602f958b72dfd48608d28107056c43167ad..2bb796236e484f1273fb9d20f032b5c71c7453bc 100644 (file)
@@ -95,7 +95,7 @@ public:
     // warning: most of subsequent methods are currently only implemented in
     //          wxMSW under Win95 and are silently ignored on other platforms
 
-    virtual void SetTickFreq(int WXUNUSED(n), int WXUNUSED(pos)) { }
+    void SetTickFreq(int freq) { DoSetTickFreq(freq); }
     virtual int GetTickFreq() const { return 0; }
     virtual void ClearTicks() { }
     virtual void SetTick(int WXUNUSED(tickPos)) { }
@@ -105,7 +105,13 @@ public:
     virtual int GetSelStart() const { return GetMax(); }
     virtual void SetSelection(int WXUNUSED(min), int WXUNUSED(max)) { }
 
+#ifdef WXWIN_COMPATIBILITY_2_8
+    wxDEPRECATED_INLINE( void SetTickFreq(int freq, int), DoSetTickFreq(freq); )
+#endif
+
 protected:
+    // Platform-specific implementation of SetTickFreq
+    virtual void DoSetTickFreq(int WXUNUSED(freq)) { /* unsupported by default */ }
 
     // choose the default border for this window
     virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
index 3ffb5dd6fd0a58e6d9559f52e9b70a1d07bfba7d..6f6ae3a2aa98c417fb7f7a0d57f92347df5d5ab8 100644 (file)
@@ -77,7 +77,6 @@ public:
     virtual void SetThumbLength(int lenPixels);
     virtual int GetThumbLength() const;
 
-    virtual void SetTickFreq(int n, int WXUNUSED(dummy) = 0);
     virtual int GetTickFreq() const { return m_tickFreq; }
 
     // wxUniv-specific methods
@@ -137,6 +136,9 @@ protected:
         INVALID_THUMB_VALUE = -0xffff
     };
 
+    // Platform-specific implementation of SetTickFreq
+    virtual void DoSetTickFreq(int freq);
+
     // overridden base class virtuals
     virtual wxSize DoGetBestClientSize() const;
     virtual void DoDraw(wxControlRenderer *renderer);
index 443ffe5e67f48a81bce4591384b611944d8cd146..bd7ae93f0042ff0b8c63ffb69a43be2a65972497 100644 (file)
@@ -337,14 +337,12 @@ public:
         @param n
             Frequency. For example, if the frequency is set to two, a tick mark is
             displayed for every other increment in the slider's range.
-        @param pos
-            Position. Must be greater than zero. @todo: what is this for?
 
         @onlyfor{wxmsw}
 
         @see GetTickFreq()
     */
-    virtual void SetTickFreq(int n, int pos);
+    virtual void SetTickFreq(int n);
 
     /**
         Sets the slider position.
index e95eda9e445c7cb6a3ad4e8535ef6b7a2901a10a..79e9eebecf408231952a19c8be0f4395ed4aa938 100644 (file)
@@ -855,7 +855,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
     m_slider = new wxSlider( panel, ID_SLIDER, 0, 0, 200,
                              wxDefaultPosition, wxSize(155,wxDefaultCoord),
                              wxSL_AUTOTICKS | wxSL_LABELS);
-    m_slider->SetTickFreq(40, 0);
+    m_slider->SetTickFreq(40);
     sz->Add( m_slider, 0, wxALL, 10 );
 
     m_gaugeVert = new wxGauge( panel, wxID_ANY, 100,
index 26002e1431b45cef16775825372d6eb1a23c9cd6..c4f5135444d8920fee7920e134dc1a4784f20d44 100644 (file)
@@ -531,7 +531,7 @@ void SliderWidgetsPage::DoSetTickFreq()
         return;
     }
 
-    m_slider->SetTickFreq(freq, 0 /* unused */);
+    m_slider->SetTickFreq(freq);
 }
 
 void SliderWidgetsPage::DoSetThumbLen()
index 9610fc44bb28638a5f56519543e42e8de46779a3..5ab19e01ef50b9768fc4cff43cae1f54bebe83b4 100644 (file)
@@ -87,8 +87,7 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID winid,
     // minValue > maxValue not handled, tickMarks set to 0
     if ( style & wxSL_AUTOTICKS )
         tickMarks = ((maxValue - minValue >= 0) ? (maxValue - minValue) : 0);
-    // arg2 needed a value, doesnt do anything
-    SetTickFreq(tickMarks,1);
+    SetTickFreq(tickMarks);
 
     return true;
 }
@@ -206,7 +205,7 @@ int wxSlider::GetMax() const
     return [GetNSSlider() maxValue];
 }
 
-void wxSlider::SetTickFreq(int n, int pos)
+void wxSlider::DoSetTickFreq(int n)
 {
     const int numTicks = (n > 0) ? ((GetMax() - GetMin()) / n) + 1 : 0;
     [GetNSSlider() setNumberOfTickMarks:numTicks];
index 3eb922c534cab47b92adcc2cbffdab972a7c7eb6..b65a2814f5f220f1d0fce2e1fb6dc8e275d1b022 100644 (file)
@@ -666,10 +666,10 @@ void wxSlider::SetRange(int minValue, int maxValue)
     }
 }
 
-void wxSlider::SetTickFreq(int n, int pos)
+void wxSlider::DoSetTickFreq(int n)
 {
     m_tickFreq = n;
-    ::SendMessage( GetHwnd(), TBM_SETTICFREQ, (WPARAM) n, (LPARAM) pos );
+    ::SendMessage( GetHwnd(), TBM_SETTICFREQ, (WPARAM) n, (LPARAM) 0 );
 }
 
 void wxSlider::SetPageSize(int pageSize)
index 83752dd30b0bbe75d50dd71d248b46562050ca98..c55d438bb234259c12413db024f8adb9f881d190 100644 (file)
@@ -1074,7 +1074,7 @@ void wxSlider::SetTick(
 } // end of wxSlider::SetTick
 
 // For trackbars only
-void wxSlider::SetTickFreq( int n, int WXUNUSED(nPos) )
+void wxSlider::DoSetTickFreq( int n )
 {
     SLDCDATA  vSlData;
     WNDPARAMS vWndParams;
index de069f1e4ad519a9a11519c52972e080d9aad23e..ef3a7f1b7d636cb9a675835374b9b6e12db7786f 100644 (file)
@@ -206,7 +206,7 @@ void wxSlider::SetRange(int minValue, int maxValue)
 }
 
 // For trackbars only
-void wxSlider::SetTickFreq(int n, int WXUNUSED(pos))
+void wxSlider::DoSetTickFreq(int n)
 {
     // TODO
     m_tickFreq = n;
index 9db9fa3679d645992eec2469068710509d5fa887..53f08eeaaabde17086f578f1e54d95ce224a1471 100644 (file)
@@ -168,7 +168,7 @@ void wxSlider::SetRange(int WXUNUSED(minValue), int WXUNUSED(maxValue))
     // unsupported feature
 }
 
-void wxSlider::SetTickFreq(int WXUNUSED(n), int WXUNUSED(pos))
+void wxSlider::DoSetTickFreq(int WXUNUSED(n))
 {
     // unsupported feature
 }
index 431707a0956f04ca7a73d3032fdfe5ebc44cb2f6..dde77642183f5314e7f57dda3764f0ab9a44b6a1 100644 (file)
@@ -352,7 +352,7 @@ int wxSlider::GetThumbLength() const
 // wxSlider ticks
 // ----------------------------------------------------------------------------
 
-void wxSlider::SetTickFreq(int n, int WXUNUSED(dummy))
+void wxSlider::DoSetTickFreq(int n)
 {
     wxCHECK_RET (n > 0, wxT("invalid slider tick frequency"));
 
index 9f6e07cf31c479023a3ab8b12aa98e7d5887e7ad..b888d71de995c48c738b0e44ecd4aaa3ae420207 100644 (file)
@@ -63,7 +63,7 @@ wxObject *wxSliderXmlHandler::DoCreateResource()
 
     if( HasParam(wxT("tickfreq")))
     {
-        control->SetTickFreq(GetLong(wxT("tickfreq")), 0);
+        control->SetTickFreq(GetLong(wxT("tickfreq")));
     }
     if( HasParam(wxT("pagesize")))
     {