![]() |
Using CXTPControlGallery in a Panel |
Post Reply ![]() |
Author | |
MacW ![]() Senior Member ![]() Joined: 26 June 2007 Status: Offline Points: 253 |
![]() ![]() ![]() ![]() ![]() Posted: 25 November 2007 at 2:29pm |
Hi,
I want to use a CXTPControlGallery control in a normal Panel. As far as I gather from the samples, a CXTPControlGallery must be used in a ControlBar/Toolbar. I hence added a toolbar to my panel, and adjust it's position and size in the OnSize event. I now want to resize the CXTPControlGallery instance to fit the inner area of the toolbar so that it basically spreads the complete panel width sans the borders etc. required by the toolbar. How do I get the inner dimension of a toolbar (the usable width/height) ? Also, the documentation how all the CXTPControlGallery classes relate seems to be missing from the XTP help file? There is only a (sparse) documentation of the classes and methods, but not when to use which method to produce which result. Trying to gather all this from the samples would be a very time consuming task... |
|
![]() |
|
Oleg ![]() Senior Member ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
Add xtpFlagControlStretched flag for control.
Or override CXTPToolBar and its CalcDockingLayout method and set controls's rect.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
MacW ![]() Senior Member ![]() Joined: 26 June 2007 Status: Offline Points: 253 |
![]() ![]() ![]() ![]() ![]() |
Hi,
I tried with xtpFlagControlStretched but it does not change anything. The gallery does not stretch to the width of the toolbar. CXTPControlGallery* pcg = new CXTPControlGallery(); pcg->SetControlSize(CSize(100, 300)); pcg->SetResizable(); pcg->ShowBorders(TRUE); pcg->SetItems(m_pItemsShapes); pcg->SetFlags(pcg->GetFlags()|xtpFlagControlStretched); m_Toolbar.GetControls()->Add(pcg, ID_GALLERY_SHAPES); I resize the toolbar in OnSize to fill the client area of the panel, but the gallery does not follow. Anything I need to do, in a specific sequence? |
|
![]() |
|
Oleg ![]() Senior Member ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
Problem in this line pcg->SetControlSize(CSize(100, 300));
think you can in OnSize method set size for gallery before you update size of toolbar
pcg->SetControlSize(CSize(cx - gap, 300));
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
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 |