HOWTO: XTPPropertyGridItem with drop down tree |
Post Reply |
Author | |
mgampi
Senior Member Joined: 14 July 2003 Status: Offline Points: 1201 |
Post Options
Thanks(0)
Posted: 20 November 2006 at 7:58am |
Hi;
In our most recent project I need a property grid item with dropdown tree support.
Has anyone ever done this? Whats the (best) design to realize this.
I prefer to use the CXTPPropertyGridItemConstraints* collection to hold the tree items data, due to minimize the break of the existing grid item design.
Any help is appreciated
Martin
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
The best design is to create new class derived from CXTPPropertyGridItem, override its OnInplaceButtonDown and show your tree.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
mgampi
Senior Member Joined: 14 July 2003 Status: Offline Points: 1201 |
Post Options
Thanks(0)
|
Hi Oleg;
I have done this already but I'm having troubles in using the control as if it's an item with a simple list where the constraints container determines the tree nodes.
I looked into the internal grid item / constraints design and found out, that its not possible to create my own XTPPropertyGridItemConstraints derived collection, since the m_arrConstraints member is private and no protected or public function exists to insert my own constraint into this list.
All I wanted to do is to provide a somehow standard interface to reusable property tree items like shown in this "pseudo" code sequence:
pItem=grid.AddChildItem(new CMyPropertyGridItemTree(...))
pConstraints=pItem->GetConstraints()
pConstraints.AddConstraint("Item text", new MyItemConstraintData(...));
I need this additional constraint item data to provide such informations as 'parent', 'internal key', ...
My problem is, that I can't find a - only coded once - solution to delete my constraint item data on shutdown.
In my opinion, the right place to do this is in the dtor of the CXTPPropertyGridItemConstraints() class, which I have to override because I use the m_dwData member to store the additional MyItemConstraintData pointer. And now the hidden m_ArrConstraints member comes in once again...
I know, that I could change the source of you library, but thats an maintenance issue, and therefore not allowed in our company.
Martin
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
why so difficult... why you can't just add this Tree as member and
use pItem->GetTreeCtrl() method to retrieve tree and add nodes.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
mgampi
Senior Member Joined: 14 July 2003 Status: Offline Points: 1201 |
Post Options
Thanks(0)
|
Hello Oleg; you're absolutely right. First I did it the wrong way. I tried to find a somehow 'universal' solution that encapsulates the detail of the tree portion. Martin |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
:) |
|
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 |