Opened 3 years ago

Closed 2 years ago

#13506 closed defect (fixed)

Resize column in wxGrid with native header resizes only header

Reported by: ivan_14_32 Owned by:
Priority: normal Milestone:
Component: wxGrid Version: stable-latest
Keywords: Cc:
Blocked By: Blocking:
Patch: no

Description

wxMSW

Resize column in wxGrid with UseNativeHeader affects only header itself, doesn't resize column in grid main window.

I see it only with comctl32.dll 6.00.2900.6028, with 6.00.2900.5512 works fine.

Difference in notify messages.

6.00.2900.6028 sends HDN_TRACK during column border drag
6.00.2900.5512 sends HDN_ITEMCHANGING during column border drag

In msw/headerctrl.cpp wxHeaderCtrl::MSWOnNotify we have only HDN_ITEMCHANGING processing.

When I change (in wxHeaderCtrl::MSWOnNotify)

case HDN_ITEMCHANGING:

if ( nmhdr->pitem && (nmhdr->pitem->mask & HDI_WIDTH) )

with

case HDN_ITEMCHANGING:
case HDN_TRACK:

if ( nmhdr->pitem && (nmhdr->pitem->mask & HDI_WIDTH) )

resizing works with both version

Attachments (1)

headerctrl.patch download (451 bytes) - added by ivan_14_32 3 years ago.
there is a patch

Download all attachments as: .zip

Change History (5)

Changed 3 years ago by ivan_14_32

there is a patch

comment:1 Changed 2 years ago by hackish

Can we get this patch applied and close the ticket?

comment:2 Changed 2 years ago by vadz

  • Status changed from new to infoneeded_new

So do you see the problem as well? I don't know where to find this exact version of comctl32.dll to test and according to everything I could find, HDB_TRACK is not supposed to be sent when using HDS_FULLDRAG which we do use.

comment:3 Changed 2 years ago by hackish

  • Status changed from infoneeded_new to new

I believe I saw the problem while working on something unrelated. I found this, applied the patch and it went away. I naturally assumed the patch was well tested but just hadn't been looked at someone with rights to commit. Since I wasn't working on this issue specifically I can't 100% confirm the reasons or version of comctl32 I had installed at the time. If necessary I can spend some time in the next week or two and come up with a solid test case.

comment:4 Changed 2 years ago by VZ

  • Resolution set to fixed
  • Status changed from new to closed

(In [73293]) Process HDN_TRACK in wxMSW wxHeaderCtrl just in case.

This message is not supposed to be sent but apparently some buggy comctl32.dll
versions do send it instead of HDN_ITEMCHANGING, so handle it too.

Closes #13506.

Note: See TracTickets for help on using tickets.