Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Property Grid
  New Posts New Posts RSS Feed - HOWTO: XTPPropertyGridItem with drop down tree
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

HOWTO: XTPPropertyGridItem with drop down tree

 Post Reply Post Reply
Author
Message
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Topic: HOWTO: XTPPropertyGridItem with drop down tree
    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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 20 November 2006 at 9:19am
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
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 20 November 2006 at 9:46am
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
 
 
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 20 November 2006 at 10:40am
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
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 20 November 2006 at 1:28pm

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.
On the other hand I wanted to minimize the amount of source code needed to implement tree items with different content.

Martin

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 20 November 2006 at 1:56pm

:)

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.188 seconds.