From: Vadim Zeitlin <vadim@wxwidgets.org>
Date: Thu, 11 Dec 2008 18:57:03 +0000 (+0000)
Subject: generate EVT_HEADER_RESIZING events from HDN_ITEMCHANGING, not from HDN_TRACK which... 
X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/93e4e62b92e8d86581984e5f99a2624b2caa15f5?ds=inline

generate EVT_HEADER_RESIZING events from HDN_ITEMCHANGING, not from HDN_TRACK which we don't seem to be getting at all

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57256 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---

diff --git a/src/msw/headerctrl.cpp b/src/msw/headerctrl.cpp
index 7336cba3b8..e8ef1b4320 100644
--- a/src/msw/headerctrl.cpp
+++ b/src/msw/headerctrl.cpp
@@ -374,12 +374,6 @@ bool wxHeaderCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
             evtType = wxEVT_COMMAND_HEADER_BEGIN_RESIZE;
             // fall through
 
-        case HDN_TRACKA:
-        case HDN_TRACKW:
-            if ( evtType == wxEVT_NULL )
-                evtType = wxEVT_COMMAND_HEADER_RESIZING;
-            // fall through
-
         case HDN_ENDTRACKA:
         case HDN_ENDTRACKW:
             width = nmhdr->pitem->cxy;
@@ -399,8 +393,20 @@ bool wxHeaderCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
             if ( nmhdr->pitem && (nmhdr->pitem->mask & HDI_WIDTH) )
             {
                 // prevent the column from being shrunk beneath its min width
-                if ( nmhdr->pitem->cxy < GetColumn(idx).GetMinWidth() )
+                width = nmhdr->pitem->cxy;
+                if ( width < GetColumn(idx).GetMinWidth() )
+                {
+                    // don't generate any events and prevent the change from
+                    // happening
                     veto = true;
+                }
+                else // width is acceptable
+                {
+                    // generate the resizing event from here as we don't seem
+                    // to be getting HDN_TRACK events at all, at least with
+                    // comctl32.dll v6
+                    evtType = wxEVT_COMMAND_HEADER_RESIZING;
+                }
             }
             break;