+ evtType = wxEVT_COMMAND_HEADER_SEPARATOR_DCLICK;
+ break;
+
+
+ // column resizing events
+ // ----------------------
+
+ // see comments in wxListCtrl::MSWOnNotify() for why we catch both
+ // ASCII and Unicode versions of this message
+ case HDN_BEGINTRACKA:
+ case HDN_BEGINTRACKW:
+ // non-resizeable columns can't be resized no matter what, don't
+ // even generate any events for them
+ if ( !GetColumn(idx).IsResizeable() )
+ {
+ veto = true;
+ break;
+ }
+
+ evtType = wxEVT_COMMAND_HEADER_BEGIN_RESIZE;
+ // fall through
+
+ case HDN_ENDTRACKA:
+ case HDN_ENDTRACKW:
+ width = nmhdr->pitem->cxy;
+
+ if ( evtType == wxEVT_NULL )
+ {
+ evtType = wxEVT_COMMAND_HEADER_END_RESIZE;
+
+ // don't generate events with invalid width
+ const int minWidth = GetColumn(idx).GetMinWidth();
+ if ( width < minWidth )
+ width = minWidth;
+ }
+ break;
+
+ case HDN_ITEMCHANGING:
+ if ( nmhdr->pitem && (nmhdr->pitem->mask & HDI_WIDTH) )
+ {
+ // prevent the column from being shrunk beneath its min width
+ 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;
+
+
+ // column reordering events
+ // ------------------------
+
+ case HDN_BEGINDRAG:
+ // Windows sometimes sends us events with invalid column indices
+ if ( nmhdr->iItem == -1 )
+ break;
+
+ // column must have the appropriate flag to be draggable
+ if ( !GetColumn(idx).IsReorderable() )
+ {
+ veto = true;
+ break;
+ }
+
+ evtType = wxEVT_COMMAND_HEADER_BEGIN_REORDER;
+ break;
+
+ case HDN_ENDDRAG:
+ wxASSERT_MSG( nmhdr->pitem->mask & HDI_ORDER, "should have order" );
+ order = nmhdr->pitem->iOrder;
+
+ // we also get messages with invalid order when column reordering
+ // is cancelled (e.g. by pressing Esc)
+ if ( order == -1 )
+ break;
+
+ order = MSWFromNativeOrder(order);
+
+ evtType = wxEVT_COMMAND_HEADER_END_REORDER;
+ break;
+
+ case NM_RELEASEDCAPTURE:
+ evtType = wxEVT_COMMAND_HEADER_DRAGGING_CANCELLED;