Disabling Right-Click option on wxTextCtrl?

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
mbeardsley
Knows some wx things
Knows some wx things
Posts: 46
Joined: Thu Sep 25, 2014 7:40 pm

Disabling Right-Click option on wxTextCtrl?

Post by mbeardsley » Mon Dec 08, 2014 11:04 pm

Is there a way to disable the right-click options on a wxTextCtrl?

Not only do I not really want/need those options, it seems to cause an assert if you bring up the "Insert Unicode Control Character" sub-menu, but then click elsewhere (closing that sub-menu).

I would have expected some style setting for this, but I'm not seeing it in the documentation.

User avatar
doublemax
Moderator
Moderator
Posts: 14876
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Disabling Right-Click option on wxTextCtrl?

Post by doublemax » Tue Dec 09, 2014 2:06 am

Is there a way to disable the right-click options on a wxTextCtrl?
That's a native function of the Windows text edit control. I don't know any way to disable it. You could try to catch the rightclick event and consume it (do nothing in the event handler). But i'm not sure if this works.
Not only do I not really want/need those options, it seems to cause an assert if you bring up the "Insert Unicode Control Character" sub-menu, but then click elsewhere (closing that sub-menu).
Do you see this in any of the wxWidgets samples (e.g. "widgets"?).
Use the source, Luke!

mbeardsley
Knows some wx things
Knows some wx things
Posts: 46
Joined: Thu Sep 25, 2014 7:40 pm

Re: Disabling Right-Click option on wxTextCtrl?

Post by mbeardsley » Tue Dec 09, 2014 3:24 pm

Do you see this in any of the wxWidgets samples (e.g. "widgets"?).
Yes, I see this issue in both the "text" sample and the "widgets" sample.

To reproduce:
1) Run the "widgets" sample in debug mode.
2) Right-click in the text control (the control labeled "Control Height").
3) Hover the mouse over the "Insert Unicode control character" option to bring up the sub menu.
4) Without selecting anything from that sub menu, left-click on some other window.
5) Assert is "..\..\src\msw\toplevel.cpp(1544): assert "m_menuDepth > 0" failed in wxTopLevelWindowMSW::DoSendMenuOpenCloseEvent(): No open menus?"

This is running on Win7-64, built using wxWidgets-3.0.2 and vc10.

User avatar
doublemax
Moderator
Moderator
Posts: 14876
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Disabling Right-Click option on wxTextCtrl?

Post by doublemax » Tue Dec 09, 2014 5:25 pm

5) Assert is "..\..\src\msw\toplevel.cpp(1544): assert "m_menuDepth > 0" failed in wxTopLevelWindowMSW::DoSendMenuOpenCloseEvent(): No open menus?"
I see this too in wx 3.0.2, but it seems to be fixed in current trunk version.
Use the source, Luke!

Post Reply