]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/splitter.cpp
pc 2 mac conversion for file operations
[wxWidgets.git] / src / generic / splitter.cpp
index 1e51050540b8eeac14b402d965dd228041496660..01e143d8b8a928c1bda70b1bd3957149cbf990c6 100644 (file)
@@ -16,6 +16,7 @@
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
+#if wxUSE_SPLITTER
 #ifdef __BORLANDC__
     #pragma hdrstop
 #endif
@@ -252,6 +253,9 @@ void wxSplitterWindow::OnMouseEvent(wxMouseEvent& event)
                 m_windowOne = m_windowTwo;
                 m_windowTwo = (wxWindow *) NULL;
                 OnUnsplit(removedWindow);
+                wxSplitterEvent event(wxEVT_COMMAND_SPLITTER_UNSPLIT, this);
+                event.m_data.win = removedWindow;
+                (void)DoSendEvent(event);
                 SetSashPositionAndNotify(0);
             }
             else if ( posSashNew == GetWindowSize() )
@@ -260,6 +264,9 @@ void wxSplitterWindow::OnMouseEvent(wxMouseEvent& event)
                 wxWindow *removedWindow = m_windowTwo;
                 m_windowTwo = (wxWindow *) NULL;
                 OnUnsplit(removedWindow);
+                wxSplitterEvent event(wxEVT_COMMAND_SPLITTER_UNSPLIT, this);
+                event.m_data.win = removedWindow;
+                (void)DoSendEvent(event);
                 SetSashPositionAndNotify(0);
             }
             else
@@ -274,13 +281,17 @@ void wxSplitterWindow::OnMouseEvent(wxMouseEvent& event)
 
         SizeWindows();
     }  // left up && dragging
-    else if (event.Moving() && !event.Dragging())
+    else if ((event.Moving() || event.Leaving() || event.Entering()) && (m_dragMode == wxSPLIT_DRAG_NONE))
     {
         // Just change the cursor as required
-        if ( SashHitTest(x, y) )
+        if ( !event.Leaving() && SashHitTest(x, y) )
+        {
             SetResizeCursor();
+        }
         else
+        {
             SetCursor(* wxSTANDARD_CURSOR);
+        }
     }
     else if (event.Dragging() && (m_dragMode == wxSPLIT_DRAG_DRAGGING))
     {
@@ -877,7 +888,7 @@ bool wxSplitterWindow::Unsplit(wxWindow *toRemove)
         return FALSE;
     }
 
-    win->Show(FALSE);
+    OnUnsplit(win);
     DoSetSashPosition(0);
     SizeWindows();
 
@@ -1058,8 +1069,12 @@ void wxSplitterWindow::OnDoubleClickSash(int x, int y)
         if ( GetMinimumPaneSize() == 0 || m_permitUnsplitAlways )
         {
             wxWindow* win = m_windowTwo;
-            if (Unsplit(win))
-                OnUnsplit(win);
+            if ( Unsplit(win) )
+            {
+                wxSplitterEvent unsplitEvent(wxEVT_COMMAND_SPLITTER_UNSPLIT, this);
+                unsplitEvent.m_data.win = win;
+                (void)DoSendEvent(unsplitEvent);
+            }
         }
     }
     //else: blocked by user
@@ -1067,13 +1082,8 @@ void wxSplitterWindow::OnDoubleClickSash(int x, int y)
 
 void wxSplitterWindow::OnUnsplit(wxWindow *winRemoved)
 {
-    // do it before calling the event handler which may delete the window
+    // call this before calling the event handler which may delete the window
     winRemoved->Show(FALSE);
-
-    wxSplitterEvent event(wxEVT_COMMAND_SPLITTER_UNSPLIT, this);
-    event.m_data.win = winRemoved;
-
-    (void)DoSendEvent(event);
 }
 
 #if defined( __WXMSW__ ) || defined( __WXMAC__)
@@ -1093,5 +1103,6 @@ void wxSplitterWindow::OnSetCursor(wxSetCursorEvent& event)
     //else: do nothing, in particular, don't call Skip()
 }
 
+#endif // wxUSE_SPLITTER
 #endif // wxMSW