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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user