Print Page | Close Window

make toolbar fill a row of dockbar

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=1695
Printed Date: 08 November 2025 at 5:56am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: make toolbar fill a row of dockbar
Posted By: blueseaing
Subject: make toolbar fill a row of dockbar
Date Posted: 23 January 2005 at 1:15am

I want to implement a CXTPToolbar which can auto fill a row of dockbar , the toolbar   contain some controls which can stretch such as CXTPComBox, I realize such code:

//the above code can stretch the toolbar
void CXTPToolBar::AdjustWidth(int nAddedWidth, BOOL bFill)
{
 for(int i=0;i<GetControls()->GetCount();i++)
 {
  CXTPControl* pControl = m_pControls->GetAt(i);

  if(pControl->IsKindOf(RUNTIME_CLASS(CXTPContr olComboBox))
   &&(pControl->GetFlags()&xtp FlagControlStretched)) 
  {
   CXTPControlComboBox* pCombox = (CXTPControlComboBox*) pControl;
   if(bFill)
    nAddedWidth = GetDockBar()->GetMaxFreeWidth(this);   

   pCombox->SetWidth(pCombox->GetWidth( )+nAddedWidth);
   pCombox->SetDropDownWidth(pCombox->G etWidth()+nAddedWidth);
  }
 }
}

but my problem lies in: when I make a toolbar fill a row of dockbar, the drag action
will change ,for example, if I drag a toolbar to the stretched toolbar, the drag can't
happen, to avoid this, the stretched toolbar should auto decrease its width to meet the
drag requirement. How can do? 




Replies:
Posted By: blueseaing
Date Posted: 23 January 2005 at 1:21am

I think the change should include the above:

     CSize CXTPToolBar::CalcDynamicLayout(int nLength, DWORD nMode);   

     void CXTPDockContext::Move(CPoint pt);

     BOOL CXTPCommandBars::DockCommandBar(CXTPToolBar* pBar, LPRECT lpRect, CXTPDockBar* pDockBar);
 



Posted By: blueseaing
Date Posted: 26 January 2005 at 9:00am

no one can help me?



Posted By: Oleg
Date Posted: 31 January 2005 at 5:37am
Please wait next version. It will be new xtpFlagControlStretched flag.

-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: kinook
Date Posted: 08 March 2005 at 9:34am
How is xtpFlagControlStretched used? I have a combo on a command bar that I want to size automatically to the size of the command bar rather than being fixed in size. I tried this in the WordPad sample in CMainFrame::CreateToolBars()

pFormatBar->GetControls()->FindControl(ID_COMBO_FONT)- >SetFlags(xtpFlagControlStretched);

but it had no apparent effect. I can't find any samples using it either, and the docs just say "Indicates the control is stretched in the parent command bar".

-------------
Automate software builds with Visual Build Pro

https://kinook.com/VBP/" rel="nofollow - http://www.visualbuild.com


Posted By: kinook
Date Posted: 08 March 2005 at 10:02am
Oops, I now see that my IssueTrak issue was responded to (never received an email notification of it). The missing code was

     pFormatBar->EnableDocking(x tpFlagAlignAny|xtpFlagFloating|xtpFlagStretched);

Unfortunately, it doesn't help me, because I don't want the toolbar to take up the entire row and not allow other toolbars to be docked beside it.

-------------
Automate software builds with Visual Build Pro

https://kinook.com/VBP/" rel="nofollow - http://www.visualbuild.com


Posted By: docman
Date Posted: 07 May 2005 at 11:03am
I have the same problem.anybody resolved?



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