Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Switch off customization arrow
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Switch off customization arrow

 Post Reply Post Reply
Author
Message
akur View Drop Down
Senior Member
Senior Member


Joined: 16 May 2006
Status: Offline
Points: 139
Post Options Post Options   Thanks (0) Thanks(0)   Quote akur Quote  Post ReplyReply Direct Link To This Post Topic: Switch off customization arrow
    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


Back to Top
akur View Drop Down
Senior Member
Senior Member


Joined: 16 May 2006
Status: Offline
Points: 139
Post Options Post Options   Thanks (0) Thanks(0)   Quote akur Quote  Post ReplyReply Direct Link To This Post Posted: 22 March 2007 at 7:58am
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).


Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.