Skip to content

Commit 60c51b2

Browse files
author
徐扬斌
committed
Fix DND reordering of generic verion wxHeaderCtrl
The old DND reorder implementation is buggy and wrong in many ways. This is a rework that fix almost everything with better user experiences, better dropped pos indication. ToDo: Better explanation code comments for several main changes. I'm now too busy to leave an explanation with enough details.
1 parent 8ea5f44 commit 60c51b2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/generic/headerctrlg.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,8 @@ bool wxHeaderCtrl::EndReordering(int xPhysical)
516516
{
517517
return false;
518518
}
519-
if ( static_cast<int>(colNew) != colOld && dropped_region != Region::NoWhere )
519+
520+
if ( static_cast<int>(colNew) != colOld )
520521
{
521522
wxHeaderCtrlEvent event(wxEVT_HEADER_END_REORDER, GetId());
522523
event.SetEventObject(this);
@@ -546,7 +547,7 @@ bool wxHeaderCtrl::EndReordering(int xPhysical)
546547
event.SetNewOrder(new_pos);
547548

548549
//printf("Move col %d to %d, pos to %d\n", colOld, colNew, new_pos);
549-
if ( !GetEventHandler()->ProcessEvent(event) || event.IsAllowed() )
550+
if ( GetEventHandler()->ProcessEvent(event) || event.IsAllowed() )
550551
{
551552
// do reorder the columns
552553
DoMoveCol(colOld, new_pos);

0 commit comments

Comments
 (0)