Please download the latest source code from our ftp server (profuis2641(2007-05-07).zip). This code update includes support for both ribbon screen tips and ribbon key tips. Now both key tips and screen tips are initialized in the updated ribbon samples. For example, here is the code for the Paste command:
CExtRibbonNode * pNodePaste =
new CExtRibbonNode( ID_EDIT_PASTE, 0, NULL, 0, _T("Paste") );
pNodePaste->CmdKeyTipSet( new CExtCustomizeCmdKeyTip( _T(’V’) ), false );
pNodePaste->RibbonILE_RuleArrayGet().RemoveAll();
VERIFY( pNodePaste->m_iconBig.m_bmpNormal.LoadBMP_Resource( MAKEINTRESOURCE(ID_EDIT_PASTE_BIG) ) );
pNodePaste->m_iconBig.m_bmpNormal.Make32();
pNodePaste->m_iconBig.m_bmpNormal.AlphaColor( RGB(255,0,255), RGB(0,0,0), 0 );
pCmdScreenTip = new CExtCustomizeCmdScreenTip;
pCmdScreenTip->CaptionMainSet( _T("Paste") );
pCmdScreenTip->TextMainSet( _T("Paste the contents\nof the Clipboard.") );
pCmdScreenTip->BmpMainGet().LoadBMP_Resource( MAKEINTRESOURCE(ID_EDIT_PASTE_BIG) );
pCmdScreenTip->BmpMainGet().Make32();
pCmdScreenTip->BmpMainGet().AlphaColor( RGB(255,0,255), RGB(0,0,0), 0 );
pCmdScreenTip->CaptionSecondarySet( _T("Press F1 for more help.") );
pCmdScreenTip->BmpSecondaryGet().LoadBMP_Resource( MAKEINTRESOURCE(ID_APP_ABOUT_16x16) );
pCmdScreenTip->BmpSecondaryGet().PreMultiplyRGBChannels( false );
pNodePaste->CmdScreenTipAttach( pCmdScreenTip );
pCmdScreenTip = new CExtCustomizeCmdScreenTip;
pCmdScreenTip->CaptionMainSet( _T("Paste") );
pCmdScreenTip->TextMainSet( _T("Click here for more options such as\npasting only the values or\nformatting.") );
pCmdScreenTip->BmpMainGet().LoadBMP_Resource( MAKEINTRESOURCE(ID_EDIT_PASTE_BIG) );
pCmdScreenTip->BmpMainGet().Make32();
pCmdScreenTip->BmpMainGet().AlphaColor( RGB(255,0,255), RGB(0,0,0), 0 );
pCmdScreenTip->CaptionSecondarySet( _T("Press F1 for more help.") );
pCmdScreenTip->BmpSecondaryGet().LoadBMP_Resource( MAKEINTRESOURCE(ID_APP_ABOUT_16x16) );
pCmdScreenTip->BmpSecondaryGet().PreMultiplyRGBChannels( false );
pNodePaste->CmdScreenTipAttach( pCmdScreenTip, false );
pRibbonGroup->InsertNode(
NULL,
pNodePaste
);
You can assign a key tip using one line of code (the
CmdKeyTipSet()
method call). A screen tip consists of two parts: main and secondary. Each part consists of the caption, bitmap and multiline text. All the parts are optional. The main part is located at the top of screen tip when the secondary part is at the bottom. If both parts are initialized, then the horizontal separator is displayed between them.