Opened 6 years ago

Closed 19 months ago

#9628 closed defect (fixed)

Ownerdrawn checkbox painting/positioning for wrapped labels

Reported by: joriksf Owned by: vadz
Priority: normal Milestone:
Component: wxMSW Version: stable-latest
Keywords: checkbox ownerdrawn Cc:
Blocked By: Blocking:
Patch: yes

Description

When Windows is set to "Use visual styles on windows and buttons" (default on XP/Vista), ownerdrawn checkboxes (with wrapped labels) are positioned/painted incorrectly.
Attached code sample (in wxMinimal context) demonstrates this.

Attachments (3)

ownerdrawn.cpp download (887 bytes) - added by joriksf 6 years ago.
test9628.diff download (1.4 KB) - added by catalin 19 months ago.
Patch to minimal sample for testing this ticket
fix9628.diff download (2.7 KB) - added by catalin 19 months ago.
Patch for wxCheckBox::MSWOnDraw() for fixing this ticket

Download all attachments as: .zip

Change History (7)

Changed 6 years ago by joriksf

comment:1 in reply to: ↑ description Changed 6 years ago by joriksf

See also ticket:9495

Changed 19 months ago by catalin

Patch to minimal sample for testing this ticket

Changed 19 months ago by catalin

Patch for wxCheckBox::MSWOnDraw() for fixing this ticket

comment:2 Changed 19 months ago by catalin

  • Keywords wrap removed
  • Patch set
  • Status changed from new to confirmed

Added a [new] patch to minimal sample for testing this ticket.

Added a patch that fixes the following ownerdrawn issues:

  • the checkbox grows beyond its default size when the control is resized;
  • the label is aligned vertically at the top of the control (it should be in the middle);
  • the label is drawn at the left of the control when wxALIGN_RIGHT is used and it has focus rect.

comment:3 Changed 19 months ago by vadz

  • Owner set to vadz
  • Status changed from confirmed to accepted

Thanks for the excellent patch and test case! Will push out soon.

comment:4 Changed 19 months ago by VZ

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

(In [73404]) Fix appearance of multiline wxCheckBox with non-standard colours in wxMSW.

Owner-drawn checkbox (which is used when wxCheckBox colour is changed) didn't
center its label correctly and didn't right align it when using wxALIGN_RIGHT
style in focused state.

Closes #9628.

Note: See TracTickets for help on using tickets.