Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - "expand"-button shown when not needed
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

"expand"-button shown when not needed

 Post Reply Post Reply
Author
Message
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Topic: "expand"-button shown when not needed
    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/
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 22 September 2009 at 10:53am
lol...
 
ShowExpandButton(FALSE); ... :P
PokerMemento - http://www.pokermemento.com/
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.141 seconds.