Dear experts
how does one disable a TGPopupMenu object?
there is some documentation/examples on disabling a TGMenuEntry, but not for TGPopupMenu.
many thanks
Dear experts
how does one disable a TGPopupMenu object?
there is some documentation/examples on disabling a TGMenuEntry, but not for TGPopupMenu.
many thanks
Hi Igor,
The popup menus can be added or removed from the menu bar dynamically. There is no way to disable them. You can remove a popup menu from the menu bar by using TGPopupMenu *menu = menubar->RemovePopup(menu_name). Returned menu has to be deleted by you, or can be re-used in another call of AddPopup(…). RemovePopup returns 0 if the menu is not found. Do not use hot key (&) in the menu_name.
Cheers, Ilka
[quote=“antcheva”]Hi Igor,
The popup menus can be added or removed from the menu bar dynamically. There is no way to disable them. You can remove a popup menu from the menu bar by using TGPopupMenu *menu = menubar->RemovePopup(menu_name). Returned menu has to be deleted by you, or can be re-used in another call of AddPopup(…). RemovePopup returns 0 if the menu is not found. Do not use hot key (&) in the menu_name.
Cheers, Ilka[/quote]
thanks Ilka,
and what about nested TGPopupMenu ?
{
TGPopupMenu* f=new TGPopupMenu();
f->AddPopup(“Tracks”,fTracksPopup);
}
as i understood from the sources
first TGPopupMenu owns a list of one TGMenuEntry in this case, which I can not access by GetId() because AddPopup does not assign any default increment value to it.
Hi Igor,
A cascaded menu groups related menu choices together in a sub-menu to reduce the number of menu entries displayed in the parent popup menu. In principal, they are always enabled. This standard behavior is implemented in our code. You can disable all entries of a cascaded menu, but the parent menu entry is enabled any time because it should provide all necessary information about the choices it gives to the users and the current state of those choices.
Cheers, Ilka
[quote=“antcheva”]Hi Igor,
A cascaded menu groups related menu choices together in a sub-menu to reduce the number of menu entries displayed in the parent popup menu. In principal, they are always enabled. This standard behavior is implemented in our code. You can disable all entries of a cascaded menu, but the parent menu entry is enabled any time because it should provide all necessary information about the choices it gives to the users and the current state of those choices.
Cheers, Ilka[/quote]
hmm,
in the project i am working on we have a tree-like structure of nested popupmenus, so at least coloring “grey” those popup branches which are disabled is prefered. if unfolding of the branches is kept at the same time, i guess it’s ok.
disabling the bottom-end MenuEntries is also OK.
Hi Igor,
I see no confusion if the menu entries leading to the second/third level cascaded menus are enabled - users can click and see the next cascaded level, which may contain only disabled entries if it is the last one. Having a cascaded menu entry in gray will require no popup of the related menu and this is not advised by the GUI essential rules.
Cheers, Ilka
[quote=“antcheva”]Hi Igor,
I see no confusion if the menu entries leading to the second/third level cascaded menus are enabled - users can click and see the next cascaded level, which may contain only disabled entries if it is the last one. Having a cascaded menu entry in gray will require no popup of the related menu and this is not advised by the GUI essential rules.
Cheers, Ilka[/quote]
ok. agree.
thanks