Page 1 of 1

Disabling Right-Click option on wxTextCtrl?

Posted: Mon Dec 08, 2014 11:04 pm
by mbeardsley
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.

Re: Disabling Right-Click option on wxTextCtrl?

Posted: Tue Dec 09, 2014 2:06 am
by doublemax
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"?).

Re: Disabling Right-Click option on wxTextCtrl?

Posted: Tue Dec 09, 2014 3:24 pm
by mbeardsley
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.

Re: Disabling Right-Click option on wxTextCtrl?

Posted: Tue Dec 09, 2014 5:25 pm
by doublemax
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.