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 » shortcut key of Ribbon bar Collapse All
Subject Author Date
Chris Anderson Oct 1, 2007 - 4:33 PM

hi there,

I ran into a ribbon bar prolem related to shortcut key : ribbon bar is not able to capture shortcut key when co-existing with a menu bar.

Our app creates a main frame window, which in turn creates both a menu bar and a ribbon bar. Based on the configuration, it shows either only the menu bar or only the ribbon bar.

The ribbon bar is created in this way, for a menu ( like &Page ), a ribbon tab is created :

CExtRibbonNodeTabPage *pRibbonTabPage = new CExtRibbonNodeTabPage( ...);
...
pRibbonTabPage->CmdKeyTipSet( new CExtCustomizeCmdKeyTip( ’P’), false );

Once the ribbon bar is created, the menu bar will be hidden.

When the app is running, pressing ALT + P is not able to switch to the Page tab, instead, the menu bar will pop up, which doesn’t look good, is there any way to make sure it’s the ribbon bar, not the menu bar, capture the shortcut key ?

Suhai Gyorgy Oct 2, 2007 - 1:50 AM

Just a guess. I’d try to override PreTranslateMessage in MainFrame like this:

BOOL CMainFrame::PreTranslateMessage(MSG* pMsg) 
{
	if( "menubar is visible" && m_wndMenuBar.TranslateMainFrameMessage( pMsg ) )
		return TRUE;
	if( "ribbonbar is visible" && m_wndRibbonBar.TranslateMainFrameMessage( pMsg ) )
		return TRUE;
	return CExtNCW < CFrameWnd > :: PreTranslateMessage(pMsg);
}

Chris Anderson Oct 2, 2007 - 12:06 PM

Actually this is what I did. I found out that WM_SYSKEYUP is filtered out in our app, so I make sure this msg and WM_SYSKEYDOWN, WM_SYSCHAR and WM_KEYDOWN msg are not filtered out.

I’m still having problem, but I would like to make sure all the msg used by prof-uis are not filtered out. Could you confirm ?

Thanks

Chris Anderson Oct 2, 2007 - 12:19 PM

I just fixed an error in the msg filtering, so it’s working now.

Thanks