]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/univ/slider.h
fix warnings in EventsSuppressor ctor from gcc with -O option
[wxWidgets.git] / include / wx / univ / slider.h
index a5e51055f0166484f3e2ce90c55d68bbf1313a6f..acb54538b60a758f952493527f1fe68f5b13e04f 100644 (file)
@@ -9,10 +9,6 @@
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
 // 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_
 
@@ -95,10 +91,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 +110,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,9 +118,19 @@ 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
     {
 protected:
     enum
     {
@@ -132,10 +142,6 @@ protected:
     virtual void DoDraw(wxControlRenderer *renderer);
     virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
 
     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 +151,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 +223,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(wxInputConsumer *consumer,
-                           const wxKeyEvent& event,
-                           bool pressed);
-    virtual bool HandleMouse(wxInputConsumer *consumer,
-                             const wxMouseEvent& event);
-    virtual bool HandleMouseMove(wxInputConsumer *consumer,
-                                 const wxMouseEvent& event);
-
-    virtual bool HandleFocus(wxInputConsumer *consumer, const wxFocusEvent& event);
-};
-
 #endif // _WX_UNIV_SLIDER_H_
 #endif // _WX_UNIV_SLIDER_H_