Opened 6 years ago

Closed 6 months ago

#9495 closed enhancement (port to stable)

wxCheckbox support for multiline/wrapping

Reported by: joriksf Owned by:
Priority: normal Milestone:
Component: wxMSW Version: 2.8.7
Keywords: wxCheckbox multiline wrapping Cc:
Blocked By: Blocking:
Patch: yes

Description

msw version of wxCheckbox doesn't support multiline and/or wrapping.

Attachments (1)

mswMultilineCheckbox.patch download (940 bytes) - added by joriksf 6 years ago.
add support for multiline/wrapping to msw wxCheckbox

Download all attachments as: .zip

Change History (11)

Changed 6 years ago by joriksf

add support for multiline/wrapping to msw wxCheckbox

comment:1 follow-up: Changed 6 years ago by vadz

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

I didn't apply the patch as I wanted to reuse the code from wxButton but the problem should still be fixed.

Please let me know if you still have any troubles after the changes of r54008.

Thanks!

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

Thanks Vadim,
Trunk seems to be ok. Tested with adapted minimal sample. Some questions/remarks:

  1. We need to release our app with 2.8 branch. Is a backport viable?
  2. The msw checkbox only wraps if it contains '\n'. I.e. it truncates if e.g. a minsize is set that would allow multiple lines (but is smaller than text extent width). A trailing '\n' triggers wrapping but may have side-effects on other platforms?
  3. The Mac version does wrap based on minsize above.
  4. The Linux version (gtk1) always truncates in minsize case.

Regards, Jorik.

Replying to vadz:

I didn't apply the patch as I wanted to reuse the code from wxButton but the problem should still be fixed.

Please let me know if you still have any troubles after the changes of r54008.

Thanks!

comment:3 Changed 6 years ago by vadz

  • Milestone set to 2.8.9
  • Resolution changed from fixed to port to stable
  • Status changed from closed to portneeded

Thanks for testing!

  1. Yes, this could be backported but I don't want to do it right now as we're very close to 2.8.8 release and there is not enough time for testing if this doesn't break something. I'll backport it after 2.8.8 so that it makes part of 2.8.9.
  1. I'm not sure if always wrapping is the desired behaviour. OTOH I'm not even sure if breaking lines not on '\n's is expected and you seem to say that this does happen. IOW I don't really know what to do here...
  1. Again, I don't know if this behaviour is configurable under Mac or not.
  1. wxGTK1 is not very interesting any more, do you know how does wxGTK2 behave?

Thanks!

comment:4 Changed 6 years ago by joriksf

Ad. 2. breaking lines on whitespace other than '\n' does indeed occur.
Ad. 3. Nor do I.
Ad. 4. Don't know about gtk2, we're stuck with gtk1...

Something else that maybe related though is that painting/drawing problems (misplacement) seems to occur on Windows when:

  1. checkbox label is wrapped;
  2. Windows setting "Use visual styles on windows and buttons" is active (default on XP)
  3. wxCheckBox switches (or is switched) to owner drawn (MakeOwnerDrawn(true)).

Maybe additional changes are necessary, can you confirm this?
Thanks!

comment:5 follow-up: Changed 6 years ago by vadz

My guess would be that owner-drawn code, namely wxRendererNative::DrawCheckBox() simply doesn't handle multiline checkboxes at all...

comment:6 in reply to: ↑ 5 ; follow-up: Changed 6 years ago by joriksf

Replying to vadz:

My guess would be that owner-drawn code, namely wxRendererNative::DrawCheckBox() simply doesn't handle multiline checkboxes at all...

Yes, that seems to be a valid assumption, although the problem seems to be with the drawing of the actual box. Not with the (multiline) label...

Does the ownerdrawn code issue validate a new ticket (issue or feature request), or should it remain with this one (or not be addressed at all...)?

comment:7 in reply to: ↑ 6 Changed 6 years ago by vadz

Replying to joriksf:

Does the ownerdrawn code issue validate a new ticket (issue or feature request), or should it remain with this one (or not be addressed at all...)?

A new ticket would be more convenient to deal with, thanks in advance!

comment:8 Changed 6 years ago by vadz

  • Milestone changed from 2.8.9 to 2.8.10

This needs more time than I have before 2.8.9 release.

comment:9 Changed 6 years ago by vadz

  • Milestone 2.8.10 deleted

Unfortunately I still didn't (and am unlikely to have in near future) have time to properly backport this to 2.8 so resetting the target milestone.

comment:10 Changed 6 months ago by vadz

  • Status changed from portneeded to closed

As we don't plan to make any more 2.8 releases, closing all bugs with "port to 2.8 needed" status.

Note: See TracTickets for help on using tickets.