Print Page | Close Window

Switch off customization arrow

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=6704
Printed Date: 02 May 2025 at 12:23pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Switch off customization arrow
Posted By: akur
Subject: Switch off customization arrow
Date 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





Replies:
Posted By: akur
Date 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).





Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net