Switch off customization arrow |
Post Reply |
Author | |
akur
Senior Member Joined: 16 May 2006 Status: Offline Points: 139 |
Post Options
Thanks(0)
Posted: 22 March 2007 at 6:40am |
Hello,
I've successfully added an XTP toolbar to a plain CWnd (a non-XTP window), but I cannot switch off the toolbar customization arrow. Does anybody know how do I get rid of this arrow? I use this code in my CWnd::OnCreate(): m_pCommandBars = (CXTPCommandBars*) (RUNTIME_CLASS(CXTPCommandBars))->CreateObject(); ASSERT(m_pCommandBars); m_pCommandBars->SetSite(this); m_pCommandBars->EnableDocking(); m_pMyToolbar = m_pCommandBars->Add(_T("MyToolbar"), xtpBarBottom); m_pMyToolbar->ModifyBarStyle(CBRS_GRIPPER, 0); m_pMyToolbar->ShowExpandButton(FALSE); m_pMyToolbar->SetFlags(0, xtpFlagAlignBottom|xtpFlagStretched); m_pMyToolbar->SetContextMenuPresent(FALSE); m_pMyToolbar->SetCustomizeDialogPresent(FALSE); m_pMyToolbar->GetPaintManager()->m_bFlatToolBar = TRUE; m_pFirstButton = new CXTPControlButton(); m_pFirstButton->SetFlags(xtpFlagManualUpdate); m_pFirstButton->SetID(IDC_MY_FIRST_BUTTON); if (hCustomIcon) m_pFirstButton->SetCustomIcon(hCustomIcon); m_pMyToolbar->GetControls()->Add(m_pFirstButton); // ... adding some other buttons just like this one |
|
akur
Senior Member Joined: 16 May 2006 Status: Offline Points: 139 |
Post Options
Thanks(0)
|
By debugging XTP code, I've just found out that the triangle at the beginning was an "ExpandButton" added automatically by XTP when the toolbar was created. It can be avoided by a single line:
m_pCommandBars->GetCommandBarsOptions()->bShowExpandButtonAlways = FALSE; Now the toolbar has only those items I have really added into it. But I still wonder why no other windows in my project have this problem? (I use XTP toolbars in several other, non-XTP windows, too). |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |