Home » Community » Newbie corner » TreeCtrl: How to...?
TreeCtrl: How to...? [message #28825] |
Sat, 18 September 2010 13:01 |
281264
Messages: 270 Registered: June 2010 Location: Spain
|
Experienced Member |
|
|
Chaps:
Allow me to ask some questions concerning TreeCtrl. Here they go:
1.- What is the role of id, key and value? I think id is assigned automatically at the time a node is added and one can not control it-??;
2.- How to modify the look of the TreeCtrl? For example how to implement a Display? I am trying this in a .h file:
struct MyDisplay: public Display{
virtual void Paint(Draw& w, const Rect& r, const Value& q, Color ink,Color paper,dword style){
w.DrawRect(r,paper);
}
};
And this in the implementation:
tree.SetDisplay(Single<MyDisplay>());
but I do not have a clear understanding of Display behaviour. For example if I wanted to modify the font, font color, backcolor, etc of an element of the tree when it is clicked, how to do it?
3.- How is Value q passed to a Display?
Many thank.
Cheers,
Javier
|
|
|
Re: TreeCtrl: How to...? [message #28871 is a reply to message #28825] |
Tue, 21 September 2010 10:37 |
mrjt
Messages: 705 Registered: March 2007 Location: London
|
Contributor |
|
|
1- Yes. Id is for internal tracking. Key is a value assigned by the developer to track items and Value is the representation of Key that the developer want to opresent the user.
2- The dword style contains a value indicating that the element being drawn is selected. Ctrl::SELECTED or something like that.
3- q is the Value of the item being drawn.
|
|
|
Goto Forum:
Current Time: Fri Apr 26 08:31:45 CEST 2024
Total time taken to generate the page: 0.02801 seconds
|