Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » TreeCtrl » Bug changing text after node insertion
Re: Bug changing text after node insertion [message #16942 is a reply to message #16939] Tue, 22 July 2008 12:10 Go to previous messageGo to previous message
cbpporter is currently offline  cbpporter
Messages: 1428
Registered: September 2007
Ultimate Contributor
Ok, so there are two solutions to my problem

Solution number 1: write a new TreeCtrl that behaves the way I consider it intuitive. This is the best solution, but developing and testing a powerful TreeCtrl would take a lot of time, time which I don't have right now. I'll put it on the list of "things to do in my holiday".

Solution number 2: try and use what there is.

I created a separate data model to hold the tree, and now I don't have to do all that manual node handling because I populate the tree with a four line recursive function.

I do need GetLabel and since Matthias also needs it, we should add something like this:
String OptionTree::GetLabel(int id) const
{
	Node n = GetNode(id);
	Option *o = dynamic_cast<Option *>(~n.ctrl);
	if(o)
		return o->GetLabel();
	
	return "";
}

For this to work, GetLabel must be added to Pusher also, class which strangely does not have this method.

Now all works pretty much as expected. All I need to do is make the control select the item that is clicked upon. Any suggestions how to do this with OptionTree?
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IsSelected(id)
Next Topic: Clear() and external controls as nodes
Goto Forum:
  


Current Time: Wed Aug 27 13:22:52 CEST 2025

Total time taken to generate the page: 0.07105 seconds