From 8478ed64d71502cd40bf07b15c0957877b4528e7 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 17 Oct 2009 16:13:37 +0000 Subject: [PATCH] Update column order in MSW native wxHeaderCtrl after drag. We must update the internally stored columns order even if the end reorder event was processed (but not vetoed), otherwise we don't reflect the new order in the our public functions such as GetColumnsOrder() which broke wxDVC display under MSW. Closes #11300. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62442 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/headerctrl.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/msw/headerctrl.cpp b/src/msw/headerctrl.cpp index 4983a1dcf4..9144513d5b 100644 --- a/src/msw/headerctrl.cpp +++ b/src/msw/headerctrl.cpp @@ -657,22 +657,24 @@ bool wxHeaderCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) if ( order != -1 ) event.SetNewOrder(order); - if ( GetEventHandler()->ProcessEvent(event) ) - { - if ( event.IsAllowed() ) - return true; // skip default message handling below + const bool processed = GetEventHandler()->ProcessEvent(event); - // we need to veto the default handling of this message, don't - // return to execute the code in the "if veto" branch below + if ( processed && !event.IsAllowed() ) veto = true; - } - else // not processed + + if ( !veto ) { // special post-processing for HDN_ENDDRAG: we need to update the // internal column indices array if this is allowed to go ahead as // the native control is going to reorder its columns now if ( evtType == wxEVT_COMMAND_HEADER_END_REORDER ) MoveColumnInOrderArray(m_colIndices, idx, order); + + if ( processed ) + { + // skip default processing below + return true; + } } }