]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/univ/slider.h
Make wxComboCtrlBase::Set*groundColour() methods public.
[wxWidgets.git] / include / wx / univ / slider.h
index b9a0bf9e9a82a5170fa51d168588c6ceba78d20a..fadab4d12ff825ed96745dd1f3f208b2a9f45a78 100644 (file)
@@ -4,15 +4,10 @@
 // Author:      Vadim Zeitlin
 // Modified by:
 // Created:     09.02.01
 // Author:      Vadim Zeitlin
 // Modified by:
 // Created:     09.02.01
-// RCS-ID:      $Id$
 // Copyright:   (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
 // Copyright:   (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
-    #pragma interface "univslider.h"
-#endif
-
 #ifndef _WX_UNIV_SLIDER_H_
 #define _WX_UNIV_SLIDER_H_
 
 #ifndef _WX_UNIV_SLIDER_H_
 #define _WX_UNIV_SLIDER_H_
 
 
 // our actions are the same as scrollbars
 
 
 // our actions are the same as scrollbars
 
-#define wxACTION_SLIDER_START       _T("start")     // to the beginning
-#define wxACTION_SLIDER_END         _T("end")       // to the end
-#define wxACTION_SLIDER_LINE_UP     _T("lineup")    // one line up/left
-#define wxACTION_SLIDER_PAGE_UP     _T("pageup")    // one page up/left
-#define wxACTION_SLIDER_LINE_DOWN   _T("linedown")  // one line down/right
-#define wxACTION_SLIDER_PAGE_DOWN   _T("pagedown")  // one page down/right
-#define wxACTION_SLIDER_PAGE_CHANGE _T("pagechange")// change page by numArg
+#define wxACTION_SLIDER_START       wxT("start")     // to the beginning
+#define wxACTION_SLIDER_END         wxT("end")       // to the end
+#define wxACTION_SLIDER_LINE_UP     wxT("lineup")    // one line up/left
+#define wxACTION_SLIDER_PAGE_UP     wxT("pageup")    // one page up/left
+#define wxACTION_SLIDER_LINE_DOWN   wxT("linedown")  // one line down/right
+#define wxACTION_SLIDER_PAGE_DOWN   wxT("pagedown")  // one page down/right
+#define wxACTION_SLIDER_PAGE_CHANGE wxT("pagechange")// change page by numArg
 
 
-#define wxACTION_SLIDER_THUMB_DRAG      _T("thumbdrag")
-#define wxACTION_SLIDER_THUMB_MOVE      _T("thumbmove")
-#define wxACTION_SLIDER_THUMB_RELEASE   _T("thumbrelease")
+#define wxACTION_SLIDER_THUMB_DRAG      wxT("thumbdrag")
+#define wxACTION_SLIDER_THUMB_MOVE      wxT("thumbmove")
+#define wxACTION_SLIDER_THUMB_RELEASE   wxT("thumbrelease")
 
 // ----------------------------------------------------------------------------
 // wxSlider
 // ----------------------------------------------------------------------------
 
 
 // ----------------------------------------------------------------------------
 // wxSlider
 // ----------------------------------------------------------------------------
 
-class WXDLLEXPORT wxSlider : public wxSliderBase,
+class WXDLLIMPEXP_CORE wxSlider : public wxSliderBase,
                              public wxControlWithThumb
 {
 public:
                              public wxControlWithThumb
 {
 public:
@@ -81,7 +76,6 @@ public:
     virtual void SetThumbLength(int lenPixels);
     virtual int GetThumbLength() const;
 
     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
     virtual int GetTickFreq() const { return m_tickFreq; }
 
     // wxUniv-specific methods
@@ -95,10 +89,14 @@ public:
         { return IsVert() ? wxVERTICAL : wxHORIZONTAL; }
 
     // do we have labels?
         { return IsVert() ? wxVERTICAL : wxHORIZONTAL; }
 
     // do we have labels?
-    bool HasLabels() const { return (GetWindowStyle() & wxSL_LABELS) != 0; }
+    bool HasLabels() const
+        { return ((GetWindowStyle() & wxSL_LABELS) != 0) &&
+                 ((GetWindowStyle() & (wxSL_TOP|wxSL_BOTTOM|wxSL_LEFT|wxSL_RIGHT)) != 0); }
 
     // do we have ticks?
 
     // do we have ticks?
-    bool HasTicks() const { return (GetWindowStyle() & wxSL_TICKS) != 0; }
+    bool HasTicks() const
+        { return ((GetWindowStyle() & wxSL_TICKS) != 0) &&
+                 ((GetWindowStyle() & (wxSL_TOP|wxSL_BOTTOM|wxSL_LEFT|wxSL_RIGHT|wxSL_BOTH)) != 0); }
 
     // implement wxControlWithThumb interface
     virtual wxWindow *GetWindow() { return this; }
 
     // implement wxControlWithThumb interface
     virtual wxWindow *GetWindow() { return this; }
@@ -110,7 +108,7 @@ public:
 
     virtual void SetShaftPartState(wxScrollThumb::Shaft shaftPart,
                                    int flag,
 
     virtual void SetShaftPartState(wxScrollThumb::Shaft shaftPart,
                                    int flag,
-                                   bool set = TRUE);
+                                   bool set = true);
 
     virtual void OnThumbDragStart(int pos);
     virtual void OnThumbDrag(int pos);
 
     virtual void OnThumbDragStart(int pos);
     virtual void OnThumbDrag(int pos);
@@ -118,24 +116,33 @@ public:
     virtual void OnPageScrollStart();
     virtual bool OnPageScroll(int pageInc);
 
     virtual void OnPageScrollStart();
     virtual bool OnPageScroll(int pageInc);
 
-    // for wxStdSliderButtonInputHandler
+    // for wxStdSliderInputHandler
     wxScrollThumb& GetThumb() { return m_thumb; }
 
     wxScrollThumb& GetThumb() { return m_thumb; }
 
+    virtual bool PerformAction(const wxControlAction& action,
+                               long numArg = 0,
+                               const wxString& strArg = wxEmptyString);
+
+    static wxInputHandler *GetStdInputHandler(wxInputHandler *handlerDef);
+    virtual wxInputHandler *DoGetStdInputHandler(wxInputHandler *handlerDef)
+    {
+        return GetStdInputHandler(handlerDef);
+    }
+
 protected:
     enum
     {
         INVALID_THUMB_VALUE = -0xffff
     };
 
 protected:
     enum
     {
         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);
     virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
 
     // overridden base class virtuals
     virtual wxSize DoGetBestClientSize() const;
     virtual void DoDraw(wxControlRenderer *renderer);
     virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
 
-    virtual bool PerformAction(const wxControlAction& action,
-                               long numArg = 0,
-                               const wxString& strArg = wxEmptyString);
-
     // event handlers
     void OnSize(wxSizeEvent& event);
 
     // event handlers
     void OnSize(wxSizeEvent& event);
 
@@ -145,7 +152,7 @@ protected:
     // normalize the value to fit in the range
     int NormalizeValue(int value) const;
 
     // normalize the value to fit in the range
     int NormalizeValue(int value) const;
 
-    // change the value by the given increment, return TRUE if really changed
+    // change the value by the given increment, return true if really changed
     bool ChangeValueBy(int inc);
 
     // change the value to the given one
     bool ChangeValueBy(int inc);
 
     // change the value to the given one
@@ -217,29 +224,4 @@ private:
     DECLARE_DYNAMIC_CLASS(wxSlider)
 };
 
     DECLARE_DYNAMIC_CLASS(wxSlider)
 };
 
-// ----------------------------------------------------------------------------
-// wxStdSliderButtonInputHandler: default slider input handling
-// ----------------------------------------------------------------------------
-
-class WXDLLEXPORT wxStdSliderButtonInputHandler : public wxStdInputHandler
-{
-public:
-    // default ctor
-    wxStdSliderButtonInputHandler(wxInputHandler *inphand)
-        : wxStdInputHandler(inphand)
-    {
-    }
-
-    // base class methods
-    virtual bool HandleKey(wxControl *control,
-                           const wxKeyEvent& event,
-                           bool pressed);
-    virtual bool HandleMouse(wxControl *control,
-                             const wxMouseEvent& event);
-    virtual bool HandleMouseMove(wxControl *control,
-                                 const wxMouseEvent& event);
-
-    virtual bool HandleFocus(wxControl *control, const wxFocusEvent& event);
-};
-
 #endif // _WX_UNIV_SLIDER_H_
 #endif // _WX_UNIV_SLIDER_H_