]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/generic/splitter.h
Richtext interface fixes and additions for Phoenix
[wxWidgets.git] / include / wx / generic / splitter.h
index 2b75bb1d98356ac514f723e47ea6b716c9283e7e..ad319e44df4f477c81506f6185f320b8b866a1c4 100644 (file)
@@ -136,8 +136,14 @@ public:
     // Sets the border size
     void SetBorderSize(int WXUNUSED(width)) { }
 
-    // Gets the sash size
+    // Hide or show the sash and test whether it's currently hidden.
+    void SetSashInvisible(bool invisible = true);
+    bool IsSashInvisible() const { return HasFlag(wxSP_NOSASH); }
+
+    // Gets the current sash size which may be 0 if it's hidden and the default
+    // sash size.
     int GetSashSize() const;
+    int GetDefaultSashSize() const;
 
     // Gets the border size
     int GetBorderSize() const;
@@ -206,7 +212,7 @@ public:
     virtual void DrawSashTracker(int x, int y);
 
     // Tests for x, y over sash
-    virtual bool SashHitTest(int x, int y, int tolerance = 5);
+    virtual bool SashHitTest(int x, int y);
 
     // Resizes subwindows
     virtual void SizeWindows();
@@ -294,7 +300,6 @@ protected:
     bool        m_needUpdating:1;
     bool        m_permitUnsplitAlways:1;
     bool        m_isHot:1;
-    bool        m_checkRequestedSashPosition:1;
 
 private:
     DECLARE_DYNAMIC_CLASS(wxSplitterWindow)
@@ -329,16 +334,16 @@ public:
     // all
     void SetSashPosition(int pos)
     {
-        wxASSERT( GetEventType() == wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED
-                || GetEventType() == wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING);
+        wxASSERT( GetEventType() == wxEVT_SPLITTER_SASH_POS_CHANGED
+                || GetEventType() == wxEVT_SPLITTER_SASH_POS_CHANGING);
 
         m_data.pos = pos;
     }
 
     int GetSashPosition() const
     {
-        wxASSERT( GetEventType() == wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED
-                || GetEventType() == wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING);
+        wxASSERT( GetEventType() == wxEVT_SPLITTER_SASH_POS_CHANGED
+                || GetEventType() == wxEVT_SPLITTER_SASH_POS_CHANGING);
 
         return m_data.pos;
     }
@@ -346,7 +351,7 @@ public:
     // UNSPLIT event methods
     wxWindow *GetWindowBeingRemoved() const
     {
-        wxASSERT( GetEventType() == wxEVT_COMMAND_SPLITTER_UNSPLIT );
+        wxASSERT( GetEventType() == wxEVT_SPLITTER_UNSPLIT );
 
         return m_data.win;
     }
@@ -354,14 +359,14 @@ public:
     // DCLICK event methods
     int GetX() const
     {
-        wxASSERT( GetEventType() == wxEVT_COMMAND_SPLITTER_DOUBLECLICKED );
+        wxASSERT( GetEventType() == wxEVT_SPLITTER_DOUBLECLICKED );
 
         return m_data.pt.x;
     }
 
     int GetY() const
     {
-        wxASSERT( GetEventType() == wxEVT_COMMAND_SPLITTER_DOUBLECLICKED );
+        wxASSERT( GetEventType() == wxEVT_SPLITTER_DOUBLECLICKED );
 
         return m_data.pt.y;
     }
@@ -391,7 +396,7 @@ typedef void (wxEvtHandler::*wxSplitterEventFunction)(wxSplitterEvent&);
     wxEVENT_HANDLER_CAST(wxSplitterEventFunction, func)
 
 #define wx__DECLARE_SPLITTEREVT(evt, id, fn) \
-    wx__DECLARE_EVT1(wxEVT_COMMAND_SPLITTER_ ## evt, id, wxSplitterEventHandler(fn))
+    wx__DECLARE_EVT1(wxEVT_SPLITTER_ ## evt, id, wxSplitterEventHandler(fn))
 
 #define EVT_SPLITTER_SASH_POS_CHANGED(id, fn) \
     wx__DECLARE_SPLITTEREVT(SASH_POS_CHANGED, id, fn)
@@ -405,4 +410,11 @@ typedef void (wxEvtHandler::*wxSplitterEventFunction)(wxSplitterEvent&);
 #define EVT_SPLITTER_UNSPLIT(id, fn) \
     wx__DECLARE_SPLITTEREVT(UNSPLIT, id, fn)
 
+
+// old wxEVT_COMMAND_* constants
+#define wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED    wxEVT_SPLITTER_SASH_POS_CHANGED
+#define wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING   wxEVT_SPLITTER_SASH_POS_CHANGING
+#define wxEVT_COMMAND_SPLITTER_DOUBLECLICKED       wxEVT_SPLITTER_DOUBLECLICKED
+#define wxEVT_COMMAND_SPLITTER_UNSPLIT             wxEVT_SPLITTER_UNSPLIT
+
 #endif // _WX_GENERIC_SPLITTER_H_