List Info

Thread: how to use menu IDs to obtain pointers to submenus




how to use menu IDs to obtain pointers to submenus
country flaguser name
United States
2007-10-19 18:43:29

Hi,
My ultimate goal is to disable part of the menu until another part of the menu has been clicked.

I have used DialogBlocks to make a frame window with an elaborate menubar.  I have DB generating code for C++ use only. ; I am trying to use the IDs that DB so kindly generates.  I am new to wxWidgets and I probably just do not understand the basic use of common classes.  The generated C++ event handler functions (part of the generated wxFrame derivative class) seem like the perfect place to process the wxMenuItem clicked events.  I just do not know what code to write to obtain pointers to the submenus in order to enable/disable the submenus of interest.  I imagine that the IDs would be useful, but I do not know what to use them for.  I don't see any functions in the wxWidgets documentation that will provide a pointer to a submenu given an ID.  Does anyone know how to accomplish this?

Thanks,
John


__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

__._,_.___
.

__,_._,___
Re: how to use menu IDs to obtain pointers to submenus
country flaguser name
United States
2007-10-19 19:06:00

I found the answer. I hope this helps someone.
You can call this code _after_ your derived framewindow has created
its menubar and added the necessary menu items:

wxMenuBar* theMenuBar = GetMenuBar(); // my only menubar
wxMenu* pluginsMenu = theMenuBar->GetMenu( 3 ); // the 4th menu,
"Plugins"
pluginsMenu->Enable( ID_MENU3, false ); // ID_MENU3 is "Graphics"

--- In anthemion-devtools%40yahoogroups.com">anthemion-devtoolsyahoogroups.com, john grant
<johnkonradgrant...> wrote:
>
> Hi,
> My ultimate goal is to disable part of the menu until another part
of the menu has been clicked.
>
> I have used DialogBlocks to make a frame window with an elaborate
menubar. I have DB generating code for C++ use only. I am trying to
use the IDs that DB so kindly generates. I am new to wxWidgets and I
probably just do not understand the basic use of common classes. The
generated C++ event handler functions (part of the generated wxFrame
derivative class) seem like the perfect place to process the
wxMenuItem clicked events. I just do not know what code to write to
obtain pointers to the submenus in order to enable/disable the
submenus of interest. I imagine that the IDs would be useful, but I
do not know what to use them for. I don't see any functions in the
wxWidgets documentation that will provide a pointer to a submenu given
an ID. Does anyone know how to accomplish this?
>
> Thanks,
> John
>;
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>

__._,_.___
.

__,_._,___
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )