Opened 7 years ago

Closed 7 years ago

#13722 closed defect (fixed)

wxComboCtrl draws text with wrong vertical alignment (wxMSW)

Reported by: fsenore Owned by:
Priority: normal Milestone:
Component: wxMSW Version: 2.9.3-rc1
Keywords: wxComboCtrl Cc:
Blocked By: Blocking:
Patch: no


You can see the problem in the combo sample.
Just run it and see that the text is not drawn vertically centered anymore.

Now it is drawn too low, very near to the bottom of the control. It looks ugly in a dialog that uses other controls that draw text vertically centered.

Tested on a Windows XP computer.

Change History (5)

comment:1 Changed 7 years ago by vadz

Do you know/remember the last version in which this worked correctly? Can you please try to find when exactly did it change?

comment:2 Changed 7 years ago by fsenore

It worked with 2.9.2. I did not test with later versions until 2.9.3-rc1.

I searched for diffs in the source code but both the combo.h file and the msx\combo.cpp file are identical. Do you have an idea of which other files I could track for changes?

comment:3 Changed 7 years ago by fsenore

I have done some bisection work to find the revision that introduced the problem.
I first checked out blindly, sometimes asking for revisions that (I discovered at a later time) do not exist. I suppose that I got the immediately existing previous revision.

Revision 69057 works correctly.
At a previous time I checked out 69068 and it did not work correctly. That revision does not exist so I suppose I got 69066.

Looking at the log it looks like the culprit might be 69066: Fix best size computation for wxTextCtrl without borders in wxMSW.

Hope this helps.

comment:4 Changed 7 years ago by vadz

  • Status changed from new to confirmed

Thanks for tracking it down, will check in the fix soon.

comment:5 Changed 7 years ago by VZ

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

(In [69942]) Remove vertical wxTextCtrl adjustment hacks for wxMSW in wxComboCtrl code.

Because wxTextCtrl used to wrongly report its best size in wxNO_BORDER case
under MSW, wxComboCtrl manually adjusted its position to work around this.
However since r69066 wxTextCtrl::GetBestSize() was fixed and now these
adjustments resulted in wrong vertical position for the control.

Just remove all manual adjustments completely now to fix this.

Closes #13722.

Note: See TracTickets for help on using tickets.