Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: pdsonic on July 21, 2008, 01:52:42 am

Title: bug in wxSmith? re: Checkable menu item not checkable
Post by: pdsonic on July 21, 2008, 01:52:42 am
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
Title: Re: bug in wxSmith? re: Checkable menu item not checkable
Post by: byo on July 21, 2008, 11:08:31 pm
Yup, this is a bug, thanks for reporting :)

BYO
Title: Re: bug in wxSmith? re: Checkable menu item not checkable
Post by: pdsonic on July 22, 2008, 06:25:37 am
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
Title: Re: bug in wxSmith? re: Checkable menu item not checkable
Post by: byo on July 22, 2008, 10:24:13 pm
Thanks again :)

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

Regards
   BYO

EDIT: Fixed in rev. 5136