Print Page | Close Window

Using CXTPControlGallery in a Panel

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=8883
Printed Date: 17 September 2025 at 12:08am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Using CXTPControlGallery in a Panel
Posted By: MacW
Subject: Using CXTPControlGallery in a Panel
Date 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...




Replies:
Posted By: Oleg
Date Posted: 26 November 2007 at 12:54am
Hi,
 
Add xtpFlagControlStretched flag for control.
 
Or override CXTPToolBar and its CalcDockingLayout method and set controls's rect.


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


Posted By: MacW
Date Posted: 26 November 2007 at 12:32pm
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?


Posted By: Oleg
Date Posted: 26 November 2007 at 2:00pm
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



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