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.
Subject |
Author |
Date |
|
ahmad hassan
|
Feb 26, 2004 - 6:05 AM
|
Hello, First of all i would like to acknowledge your great library its one thing not to miss. I want to have a drop down button with the toolbar button. I was not able to get the seperate drop down button which i think the library supports it, i called pTBB->SetSeparatedDropDown(true); pCmdItem->StateSetSeparatedDD(); after getting appropriate button ptr or cmd item from appropriate classes. It didn’t work and i want to know how you enable the drop down button. I would also like to have BTNS_WHOLEDROPDOWN like thing for a button in toolbar but the thing is how, i don’t profuis support it or not. Waiting for your reply.
|
|
Technical Support
|
Feb 27, 2004 - 2:09 AM
|
Dear Ahmad,
The default implementation of the toolbar button has its drop-down button (a drop-down arrow) turned off. Here is a few lines of the code which illustrates the issue.
Attach a popup menu to your toolbar button:
INT nBtnIdx = m_wndToolBar.CommandToIndex( ID_XXX );
ASSERT( nBtnIdx >= 0 );
CMenu _line_menu;
VERIFY( _line_menu.LoadMenu( IDR_POPUP_MENU ) );
VERIFY( m_wndToolBar.SetButtonMenu( nBtnIdx, _line_menu.Detach() ) );
Turn the drop-down button on: CExtBarButton * pTBB = m_wndToolBar.GetButton(nBtnIdx);
pTBB->SetSeparatedDropDown(true);
// now your toolbar button is divided into two parts;
// the right part activates a menu
And on the contrary, the false parameter specifies the MFC’s BTNS_WHOLEDROPDOWN style: pTBB->SetSeparatedDropDown(false);
This make the entire toolbar button activate its attached menu.
|
|