Menu not enabled?
-
Hi, I have got a problem with a popup menu that I have created in a CDialogBar. The menu item is grayed out when the menu is displayed.:( I use the same approach for some buttons, but there the menu item is enabled. Am I doing something wrong, or is there a way to enable the menu item? Cheers,
/FredrikDo you Sonork? I do! 100.11430:PhatBoy
-
Hi, I have got a problem with a popup menu that I have created in a CDialogBar. The menu item is grayed out when the menu is displayed.:( I use the same approach for some buttons, but there the menu item is enabled. Am I doing something wrong, or is there a way to enable the menu item? Cheers,
/FredrikDo you Sonork? I do! 100.11430:PhatBoy
That could probably be because the menu-item handlers dont exist in the context. Like perhaps you have put them in a view, which is not valid when you show the popup menu, as the focus is on the control bar. Try putting the handlers in the frame window class Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut
-
That could probably be because the menu-item handlers dont exist in the context. Like perhaps you have put them in a view, which is not valid when you show the popup menu, as the focus is on the control bar. Try putting the handlers in the frame window class Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut
It works if I put the handler in the frame window class, although I do not quite understand why.:confused: What I am trying to do, is to encapsulate the menu item handler in my derived toolbar class. I handle the WM_RBUTTONDOWN message in the toolbar class to display the menu. How do I do everything from the toolbar class? Cheers,
/FredrikDo you Sonork? I do! 100.11430:PhatBoy
-
It works if I put the handler in the frame window class, although I do not quite understand why.:confused: What I am trying to do, is to encapsulate the menu item handler in my derived toolbar class. I handle the WM_RBUTTONDOWN message in the toolbar class to display the menu. How do I do everything from the toolbar class? Cheers,
/FredrikDo you Sonork? I do! 100.11430:PhatBoy
Fredrik Skoog wrote: It works if I put the handler in the frame window class, although I do not quite understand why Because, by default, if you do not setup an ON_COMMAND* handler for a command, it will be disabled. You also might want to look into how command routing works, so as to understand the order that is used when searching for a Command Handler. Peace! -=- James.