Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Using CXTPControlGallery in a Panel
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Using CXTPControlGallery in a Panel

 Post Reply Post Reply
Author
Message
MacW View Drop Down
Senior Member
Senior Member


Joined: 26 June 2007
Status: Offline
Points: 253
Post Options Post Options   Thanks (0) Thanks(0)   Quote MacW Quote  Post ReplyReply Direct Link To This Post Topic: Using CXTPControlGallery in a Panel
    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...

Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
MacW View Drop Down
Senior Member
Senior Member


Joined: 26 June 2007
Status: Offline
Points: 253
Post Options Post Options   Thanks (0) Thanks(0)   Quote MacW Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
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.063 seconds.