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
This commit is contained in:
Vadim Zeitlin 2009-10-17 16:13:37 +00:00
parent da16724e7a
commit 8478ed64d7

View File

@ -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;
}
}
}