MyControl and menu item updating

H H at h.com
Wed Aug 2 09:05:11 PDT 2006


In article <E1G84JL-0006Ru-00 at smtp.tt-solutions.com>,
 vadim at wxwindows.org (Vadim Zeitlin) wrote:

> On Tue, 01 Aug 2006 00:44:18 +0200 H <H at h.com> wrote:
> 
> H> Inside one of my dialogs I use a control that I have written by myself. 
> H> Let's say MyControl. This is derived from wxControl. MyControl 
> H> implements copy&paste and therefore also reacts on update UI events for 
> H> menu items. The problem is that the menu items are not updated correctly.
> 
>  Probably because you didn't implement EVT_UPDATE_UI() for them.
> 

I implemented the EVT_UPDATE_UI() because I use the same IDs for the 
context menu as for the menubar.

> H> If I replace my control with a standard wxTextCtrl and the clipboard 
> H> contents are identical the paste menu item in the menubar as well as in 
> H> the context menu are activated.
> 
>  I don't know which version of you use but I remember that there was a
> brief period when menu UI update events were forwarded to the active
> control which could result in the behaviour you describe. But we don't do
> this any more AFAIK.
> 
>  Regards,
> VZ

The problem indeed is that the active control does not receive any 
update events for menu items (anymore). This means that cut&paste is 
broken for user defined controls. I can still work around it by catching 
key events but still I cannot update the menu correctly. So, it is 
broken to 50%.
But as the wxTextCtrl is a native implementation it still works.

BTW: I am using 2.6.4 on MacOSX

Hartwig






More information about the wx-users mailing list