]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/generic/splitter.h
Checking for wxUSE_SOCKETS and __GSOCKET_STANDALONE__ should be right, now
[wxWidgets.git] / include / wx / generic / splitter.h
index 55c78919087516c794021bfa08dfc5a23ccec9af..e2378b42d3e6ba34b2d6607117551027296f55f6 100644 (file)
@@ -160,6 +160,9 @@ public:
     // Adjusts the panes
     void OnSize(wxSizeEvent& event);
 
+    // In live mode, resize child windows in idle time
+    void OnIdle(wxIdleEvent& event);
+
     // Draws borders
     void DrawBorders(wxDC& dc);
 
@@ -181,12 +184,15 @@ public:
 protected:
     // our event handlers
     void OnSashPosChanged(wxSplitterEvent& event);
+    void OnSashPosChanging(wxSplitterEvent& event);
     void OnDoubleClick(wxSplitterEvent& event);
     void OnUnsplitEvent(wxSplitterEvent& event);
 
     void SendUnsplitEvent(wxWindow *winRemoved);
 
     int         m_splitMode;
+    bool        m_permitUnsplitAlways;
+    bool        m_needUpdating; // when in live mode, set the to TRUE to resize children in idle
     wxWindow*   m_windowOne;
     wxWindow*   m_windowTwo;
     int         m_dragMode;
@@ -237,14 +243,16 @@ public:
     // all
     void SetSashPosition(int pos)
     {
-        wxASSERT( GetEventType() == wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED );
+        wxASSERT( GetEventType() == wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED
+                || GetEventType() == wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING);
 
         m_data.pos = pos;
     }
 
     int GetSashPosition() const
     {
-        wxASSERT( GetEventType() == wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED );
+        wxASSERT( GetEventType() == wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED
+                || GetEventType() == wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING);
 
         return m_data.pos;
     }
@@ -273,7 +281,11 @@ public:
     }
 
 private:
+#ifdef __MWERKS__
+    friend class wxSplitterWindow;
+#else
     friend wxSplitterWindow;
+#endif
 
     // data for the different types of event
     union
@@ -300,9 +312,18 @@ typedef void (wxEvtHandler::*wxSplitterEventFunction)(wxSplitterEvent&);
     NULL                                                                    \
   },
 
-#define EVT_SPLITTER_DCLICK(id, fn)                                   \
+#define EVT_SPLITTER_SASH_POS_CHANGING(id, fn)                              \
+  {                                                                         \
+    wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING,                               \
+    id,                                                                     \
+    -1,                                                                     \
+    (wxObjectEventFunction)(wxEventFunction)(wxSplitterEventFunction) &fn,  \
+    NULL                                                                    \
+  },
+
+#define EVT_SPLITTER_DCLICK(id, fn)                                         \
   {                                                                         \
-    wxEVT_COMMAND_SPLITTER_DOUBLECLICKED,                                    \
+    wxEVT_COMMAND_SPLITTER_DOUBLECLICKED,                                   \
     id,                                                                     \
     -1,                                                                     \
     (wxObjectEventFunction)(wxEventFunction)(wxSplitterEventFunction) &fn,  \