]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/splitter.cpp
deTABified
[wxWidgets.git] / src / generic / splitter.cpp
index 874a63621d7894d0e7cbf298e7cd4a09b51f7224..6950009cb04e290edb236e92fb8f9ebd38c0c86c 100644 (file)
@@ -33,7 +33,6 @@
 #include "wx/dcscreen.h"
 #include "wx/settings.h"
 
-#if !USE_SHARED_LIBRARY
 IMPLEMENT_DYNAMIC_CLASS(wxSplitterWindow, wxWindow)
 IMPLEMENT_DYNAMIC_CLASS(wxSplitterEvent, wxCommandEvent)
 
@@ -50,7 +49,6 @@ BEGIN_EVENT_TABLE(wxSplitterWindow, wxWindow)
     EVT_SPLITTER_DCLICK(-1,           wxSplitterWindow::OnDoubleClick)
     EVT_SPLITTER_UNSPLIT(-1,          wxSplitterWindow::OnUnsplitEvent)
 END_EVENT_TABLE()
-#endif
 
 wxSplitterWindow::wxSplitterWindow()
 {
@@ -164,8 +162,8 @@ void wxSplitterWindow::OnIdle(wxIdleEvent& WXUNUSED(event))
 
 void wxSplitterWindow::OnMouseEvent(wxMouseEvent& event)
 {
-    long x = event.GetX();
-    long y = event.GetY();
+    wxCoord x = (wxCoord)event.GetX(),
+            y = (wxCoord)event.GetY();
 
     // reset the cursor
 #ifdef __WXMOTIF__
@@ -191,6 +189,15 @@ void wxSplitterWindow::OnMouseEvent(wxMouseEvent& event)
 
             m_oldX = x;
             m_oldY = y;
+
+            if ( m_splitMode == wxSPLIT_VERTICAL )
+            {
+                SetCursor(*m_sashCursorWE);
+            }
+            else
+            {
+                SetCursor(*m_sashCursorNS);
+            }
             return;
         }
     }
@@ -284,6 +291,19 @@ void wxSplitterWindow::OnMouseEvent(wxMouseEvent& event)
     }
     else if (event.Dragging() && (m_dragMode == wxSPLIT_DRAG_DRAGGING))
     {
+#ifdef __WXMSW__
+        // Otherwise, the cursor sometimes reverts to the normal cursor
+        // during dragging.
+        if ( m_splitMode == wxSPLIT_VERTICAL )
+        {
+            SetCursor(*m_sashCursorWE);
+        }
+        else
+        {
+            SetCursor(*m_sashCursorNS);
+        }
+#endif
+
         // Obtain window size. We are only interested in the dimension the sash
         // splits up
         int new_sash_position =