Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » CExtRibbonNodeFile Want the Coords to the Menu entries Collapse All
Subject Author Date
Andrew Banks Jan 8, 2007 - 12:16 PM

The file menu has a set of menu entries to the left for file open, new etc.

When one of these menu entries is clicked, how can I get the screen coords of the clicked menu entry OnMouseClick

Sergiy Lavrynenko Jan 9, 2007 - 6:05 AM

Dear Andrew,

The ribbon file menu is the UI item provided by the ribbon file button which is a kind of the ribbon gallery button. The ribbon gallery button displays the ribbon gallery popup menu which contains gallery control and/or a set of menu items. Simple ribbon gallery buttons are displaying ribbon gallery popup menu with the gallery control at the top and a set of menu items at the bottom. The ribbon file button is displaying the ribbon file popup menu with the gallery control at the right (typically displays recently used documents/files) and a set of menu items at the left (typically a set of classic file/print commands). Currently there are no virtual methods in the CExtRibbonPage/CExtRibbonBar classes for catching the mouse click position on the gallery control. The gallery control was designed to display a set of selectable checked/unchecked items wich are typically not similar to toolbar command buttons/menu command items. Could you explain why you need the mouse click location on the gallery control and how are you going to use it?

Andrew Banks Jan 9, 2007 - 10:26 AM

I am associating a dialog with file save as, file open, file new. Currently, I display these in the center of the app. However, to remain consistant with the RibbonBar I implemented, I would like the dialog just to the right of the menu entry.

On the top buttons, I use in the OnCommand handler GetButtonRect(CommandToIndex( command_id ), lpRect ) ;
Map lprect to coords relative to the ribbon bar for screen coords. Use lprect and SetWindowPos on the dialog to drop it just below the Ribbon button to function as a multi data input menu instead of single data input menus. It works fine.

Similarly, I want to drop a dialog just to the right of the file menu entry. It help maintain user context.

If you could tell me where the function and source file is where the click occurs, I will figure a way around it or change the source code myself.


    

Sergiy Lavrynenko Jan 11, 2007 - 3:56 AM

Dear Andrew,

Prof-UIS toolbars and menus are supporting the hover/selection notifications and you can see how this works in the HelpNotes sample application. So, you can catch the location of the File | Open, File | Save, File | Save As, File | Print and all the other menu items/toolbar buttons in screen coordinates. The menu item provides selection notification independently from the submenu nesting level. You should analyze the command identifier of the menu item to came to any conlusions about which window should be displayed near it. Is that what you need?