Print Page | Close Window

"expand"-button shown when not needed

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=15217
Printed Date: 27 April 2024 at 6:22am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: "expand"-button shown when not needed
Posted By: znakeeye
Subject: "expand"-button shown when not needed
Date Posted: 21 September 2009 at 10:30am

I have a toolbar in one of my panes. The last button contains a label which is updated every now and then. For some reason, the "expand-dropdown" is shown even though there is plenty of space left... why?

 
Relevant creation code:
 
int CMyPane::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
    if (CWnd::OnCreate(lpCreateStruct) == -1)
        return -1;
    InitCommandBars();
    CXTPCommandBars* pCommandBars = GetCommandBars();
   
    m_wndToolBar.SetCommandBars(pCommandBars);
    if (!m_wndToolBar.CreateToolBar(WS_TABSTOP | WS_VISIBLE | WS_CHILD | CBRS_TOOLTIPS, this) || !m_wndToolBar.LoadToolBar(IDR_PANE_CASE_EXPLORER))
        return -1;
   
    m_wndToolBar.SetOwner(AfxGetMainWnd());
 
 
And when updating the caption of the last item:
 
pLabel->SetCaption(pszCaption);
pLabel->SetTooltip(pszTooltip);
CXTPClientRect rc(this);
 
// Also called in OnWindowPosChanged():
CSize sz = m_wndToolBar.CalcDockingLayout(cx, LM_HIDEWRAP | LM_HORZDOCK | LM_HORZ | LM_COMMIT);
m_wndToolBar.MoveWindow(0, 0, cx, sz.cy);
m_wndToolBar.Invalidate(FALSE);


-------------
PokerMemento - http://www.pokermemento.com/



Replies:
Posted By: znakeeye
Date Posted: 22 September 2009 at 10:53am
lol...
 
ShowExpandButton(FALSE); ... :P


-------------
PokerMemento - http://www.pokermemento.com/



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