10-30-2010 10:03 AM
Hello,
I have created a popup menu for a picture control, by right clicking the picture that can popup the menu item lists. When clicking a menu item it can show a child panel, at the same time, the menu items disappeared immediately. Is there any way to keep it staying on the panel until the program needs it to disappear?
David
10-31-2010 03:26 AM
I see no way of obtaining this effect: visibility of context menus is handled by the OS so unless there is some specific Windows API which I am not aware of (and it could be perfectly possible) I suppose you cannot let the menu visible after a choice is made by the operator. moreover, when a menu is displayed, the operability of mouse and keyboard is limited to it, in that either you choose a menu item or you click elsewere (or press ESC) to let the menu disappear.
An alternative way to have a "menu" always visible could be to tailor a panel to mimic it: single pixel border, stays on top when app is active, some text message to simulate menu items and a panel callback that when the user clicks on it activates a specific function based on mouse coordinates to detect which text message the mouse is on. You may still have problems with panel colour and with menu separators (the latter one possibly faked by a single-pixel-tall horizontal slider) and the items being highlighted when the mouse passes over them.
In my opinion, given these limitations it's better to develop a personalized panel with appropriate buttons and the "stays on top" attribute set, which could follow your app aesthetic standards and is easier to program.
10-31-2010 08:41 AM
Thanks.
David