Opened 9 months ago

Last modified 9 months ago

#18589 confirmed defect

wxRichTextCtrl does not like to be wxID_HIGHEST + 1

Reported by: rwruck Owned by:
Priority: low Milestone:
Component: wxRichText Version: 3.0.4
Keywords: Cc:
Blocked By: Blocking:
Patch: no

Description

As stated in https://docs.wxwidgets.org/3.0/page_stdevtid.html, identifiers above wxID_HIGHEST are free to be used by user code.
Unfortunately, wxRichTextCtrl seems to use wxID_HIGHEST to wxID_HIGHEST + 3 for its own menu items, so if you assign wxID_HIGHEST + 1 to a wxRichTextCtrl, it will always be disabled because the control itself disables its menu items with those IDs.
See richtextctrl.h.

Change History (2)

comment:1 Changed 9 months ago by oneeyeman

Hi,
Is there a reason you can't use wxID_ANY?

comment:2 Changed 9 months ago by vadz

  • Priority changed from normal to low
  • Status changed from new to confirmed

It's indeed a bad idea to hardcode wxID_RICHTEXT_PROPERTIESn values like this, I don't know why was it done, but it would be nice to fix this, ideally by not using fixed constants. I don't know this code at all, however, so I don't really have any plans to do it, sorry.

Note: See TracTickets for help on using tickets.