added EVT_HEADER_DRAGGING_CANCELLED event sent when either resizing or reordering operation is cancelled instead of having a special cancelled flag in normal END_RESIZE/REORDER events

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57233 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-12-10 16:05:21 +00:00
parent 702f5349c6
commit 565804f2b9
6 changed files with 35 additions and 42 deletions

View File

@@ -300,17 +300,19 @@ void wxHeaderCtrl::EndResizing(int xPhysical)
EndDragging();
const bool cancelled = xPhysical == -1;
// if dragging was cancelled we must have already lost the mouse capture so
// don't try to release it
if ( xPhysical != -1 )
if ( !cancelled )
ReleaseMouse();
wxHeaderCtrlEvent event(wxEVT_COMMAND_HEADER_END_RESIZE, GetId());
wxHeaderCtrlEvent event(cancelled ? wxEVT_COMMAND_HEADER_DRAGGING_CANCELLED
: wxEVT_COMMAND_HEADER_END_RESIZE,
GetId());
event.SetEventObject(this);
event.SetColumn(m_colBeingResized);
if ( xPhysical == -1 )
event.SetCancelled();
else
if ( !cancelled )
event.SetWidth(ConstrainByMinWidth(m_colBeingResized, xPhysical));
GetEventHandler()->ProcessEvent(event);