]> git.saurik.com Git - wxWidgets.git/commitdiff
send wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED only once after end of dragging and...
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 27 Mar 2005 15:50:17 +0000 (15:50 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 27 Mar 2005 15:50:17 +0000 (15:50 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33094 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
docs/latex/wx/splitevt.tex
src/generic/splitter.cpp

index b117198451f77f2d0255c8ead9d5160191321f70..3c5b398af903887b074e55a6c116339076ba4b66 100644 (file)
@@ -27,6 +27,8 @@ All (GUI):
 - Fixed wxScrolledWindow sizer behaviour so that the virtual size
   isn't used to set the window size.
 - Added wxTE_BESTWRAP (based on patch by Mart Raudsepp)
+- wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED is now only sent once at the end of
+  splitter dragging and not after each CHANGING event (Jacobo Vilella Vilahur)
 
 Unix:
 
index 520df0d44f7f2c57d4d1d4b6c8d628fd4ec66adb..9f430e802d3ceec5b5c26f17537ce9d17efe36a8 100644 (file)
@@ -32,8 +32,8 @@ modify the position of the tracking bar to properly reflect the position that
 would be set if the drag were to be completed at this point. Processes a
 wxEVT\_COMMAND\_SPLITTER\_SASH\_POS\_CHANGING event.}
 \twocolitem{{\bf EVT\_SPLITTER\_SASH\_POS\_CHANGED(id, func)}}{The sash
-position was changed. May be used to modify the sash position before
-it is set, or to prevent the change from taking place.
+position was changed. This event is generated after the user releases the mouse
+after dragging the splitter.
 Processes a wxEVT\_COMMAND\_SPLITTER\_SASH\_POS\_CHANGED event.}
 \twocolitem{{\bf EVT\_SPLITTER\_UNSPLIT(id, func)}}{The splitter has been just
 unsplit. Processes a wxEVT\_COMMAND\_SPLITTER\_UNSPLIT event. This event can't
index 0c04fde00056bc7864366d336f353a1ea1402ca4..df06c7d5e0c8566fc7de11156aa89e5167a4ac4b 100644 (file)
@@ -383,7 +383,7 @@ void wxSplitterWindow::OnMouseEvent(wxMouseEvent& event)
         }
         else
         {
-            SetSashPositionAndNotify(posSashNew);
+            DoSetSashPosition(posSashNew);
             m_needUpdating = true;
         }
     }
@@ -631,13 +631,15 @@ void wxSplitterWindow::SetSashPositionAndNotify(int sashPos)
     // SetSashPosition():
     m_requestedSashPosition = INT_MAX;
 
-    if ( DoSetSashPosition(sashPos) )
-    {
-        wxSplitterEvent event(wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED, this);
-        event.m_data.pos = m_sashPosition;
+    // note that we must send the event in any case, i.e. even if the sash
+    // position hasn't changed and DoSetSashPosition() returns false because we
+    // must generate a CHANGED event at the end of resizing
+    DoSetSashPosition(sashPos);
 
-        (void)DoSendEvent(event);
-    }
+    wxSplitterEvent event(wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED, this);
+    event.m_data.pos = m_sashPosition;
+
+    (void)DoSendEvent(event);
 }
 
 // Position and size subwindows.