![]() |
Stretch a control to the end of a toolbar |
Post Reply ![]() |
Author | |
spike ![]() Groupie ![]() Joined: 13 May 2003 Location: United States Status: Offline Points: 48 |
![]() ![]() ![]() ![]() ![]() Posted: 23 July 2004 at 9:46am |
Does anyone know a way to stretch a control (edit) to the end of a toolbar its in? CXTPCommandBars* pCommandBars = GetCommandBars(); CXTPToolBar* pCommandBar = (CXTPToolBar*)pCommandBars->Add(_T("Output Queue Toolbar"), xtpBarTop); if( pCommandBar ) CXTPControlEdit *pControl = (CXTPControlEdit *)pCommandBar->GetControls()->Add( xtpControlEdit, ID_OUTPUTFILTER_EDIT ); pControl->SetCaption( "Filter:" ); pCommandBar->SetFlags(xtpFlagStretched); pCommandBar->EnableDocking( xtpFlagStretched ); I just have the one edit control in the toolbar and would like it to take up the whole width of the toolbar and size when the toolbar is sized.
Thanks Craig
|
|
![]() |
|
SuperMario ![]() Admin Group ![]() ![]() Joined: 14 February 2004 Status: Offline Points: 18057 |
![]() ![]() ![]() ![]() ![]() |
No one has responded to this post, so I'll see if I can help.
I haven't tried this, but I would use the GetWidth method for the CommandBar to determine the size. Assuming that the edit control is the only control on the toolbar (from your post, it sounds like it is), then I would use the SetWidth method on the Edit control. |
|
![]() |
|
spike ![]() Groupie ![]() Joined: 13 May 2003 Location: United States Status: Offline Points: 48 |
![]() ![]() ![]() ![]() ![]() |
CAn someone from codejock help here? This hasnt been answered and I still dont have a good solution for it.
Thanks
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
in next version we will add xtpFlagControlStretched flag. You can patch your sources if you don't want wait next version: 1. add XTPControlFlags::xtpFlagControlStretched = 32 (XTPCommandBarDefines.h) 2. replace in XTPControls.cpp: void CXTPControls::_MoveRightAlligned(XTPBUTTONINFO* pData, CSize sizeResult, CRect rcBorder, DWORD dwMode) [attached]
3. Now you can use it:
CXTPControlComboBox* pComboMasked = (CXTPControlComboBox*)CControlComboBoxEx::CreateObject(); lpCreateControl->pControl = pComboMasked; Edited by oleg |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
spike ![]() Groupie ![]() Joined: 13 May 2003 Location: United States Status: Offline Points: 48 |
![]() ![]() ![]() ![]() ![]() |
Thanks Oleg, I will give it a shot tomorrow.
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |