Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Expand Button drawn wider when it should be hidden
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Expand Button drawn wider when it should be hidden

 Post Reply Post Reply
Author
Message
richards View Drop Down
Newbie
Newbie


Joined: 02 June 2009
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote richards Quote  Post ReplyReply Direct Link To This Post Topic: Expand Button drawn wider when it should be hidden
    Posted: 03 June 2009 at 10:56am

When I call pTB->ShowExpandButton(false) from the main frame's OnCreate, it works fine. If I call it from within a command handler, the ExpandButton appears as a normal size button on the toolbar. How can I hide the expand button in the context of a menu command handler?

I'm using Toolkit Pro v 13.0.0 with Microsoft Visual Studio 2008 Version 9.0.21022.8. Here's the code:


void CMainFrame::LockToolbars(bool lock)
{
     bool is_enabled = !lock;

     CXTPCommandBars *pCBs = GetCommandBars();

     pCBs->EnableCustomization(is_enabled);

     int n = pCBs->GetCount();
     for (int i=0; i<n; i++)
     {
          CXTPToolBar *pTB = pCBs->GetAt(i);

          if (pTB)
          {
               pTB->SetShowGripper(is_enabled);
               pTB->ShowExpandButton(is_enabled);
               pTB->SetCloseable(is_enabled && (pTB != m_pMenuBar));
               pTB->EnableDocking(lock ? 0 : ( xtpFlagAlignAny | xtpFlagFloating));
               pTB->Invalidate();
          }
     }

     pCBs->UpdateCommandBars();
}
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 04 June 2009 at 2:07am
Hi,

Try also manually hide it
 
pPopupExp = (CXTPControlPopup*)pToolBar->GetControls()->FindControl(XTP_ID_TOOLBAR_EXPAND);
pPopupExp->SetVisible(FALSE);
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
richards View Drop Down
Newbie
Newbie


Joined: 02 June 2009
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote richards Quote  Post ReplyReply Direct Link To This Post Posted: 04 June 2009 at 8:57am
Thanks, that works.

And thanks for a great product, by the way! This has really transformed the look and feel of my app with only a few day's effort.
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.047 seconds.