"Sticky" MFC popup menu -


I currently have some toolbar buttons that have side by side with small arrow ( TBSTYLE_EX_DRAWDDARROWS ) When clicked, results in the popup context menu displayed below the button This is done by creating a custom popup menu and by calling TrackPopupMenu .

The client now wants to be able to choose from many options from the menu before closing, so that many options

  1. the user clicks the dropdown button
  2. The dropdown menu appears (the modal wait for the user's action indefinitely)
  3. The user has some items (Eg, toggle a checkmark)
  4. The timer (e.g., 500ms) begins
  5. if the timer is equal Limit expires, the menu stops and executed all selected actions.
  6. Before the timer expires, the user clicks on another item, go back to 4.

The best I can come up with is to redesign the menu by calling TrackPopupMenu several times when you select an item, the menu will be " Flicker ", and possibly to have a timeout, I'll need to start a thread, which I would like to save.

Instead of a menu, open a dialog box with options on it. A dialogue can easily be all necessary.

A menu that does not stop when you click, it will look just wrong. A dialog that closes by itself also seems wrong, but perhaps it is at least two evils.

Edit: If you have learned anything with Microsoft, try not to fight the default behavior. If you do this then you are asking for trouble. .

If you are dynamically creating your menu, then I can see how easy the automatic shape can be, but it is not difficult to do this in the dialog - make the dialog really big and before That it shows, count the children and take a union of all your rectangles, then resize it to check the boundaries to ensure that they are off-screen, if statement with offsetting The checkboxes are trivial;


Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -