News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

bug in wxSmith? re: Checkable menu item not checkable

Started by pdsonic, July 21, 2008, 01:52:42 AM

Previous topic - Next topic

pdsonic

Hi,

I'm not sure if this is the right forum.

I'm using CB 5106 on WinXP SP2

On my main wxFrame I have a menu item that is checkable. In wxSmith I set the item as Check, but when I examine the object using the debugger the Menu item kind is wxITEM_NORMAL. And of course the check mark does not appear when I click on it.

However, if I set its kind MenuItem->SetKind( wxITEM_CHECK ), after it is constructed, it works.

Also, this is using the XRC file.

Thanks.

pdsonic

byo


pdsonic

You're welcome.   :)

And I have another one...

For obtaining the MenuItem's address the auto-generated code is as follows:

   MenuItemAbout = (wxMenuItem*)FindWindow(XRCID("idMenuItemAbout"));

But this returns NULL. After looking on the forums (MenuItem's do not inherit from wxWindow), I found that the following works for me:

   MenuItemAbout = GetMenuBar()->FindItem(XRCID("idMenuItemAbout"));


This is a minor problem, as the workaround is quite easy.


pdsonic

byo

Thanks again :)

I'm just starting to fix it :) Should be ready today.

Regards
   BYO

EDIT: Fixed in rev. 5136