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 » treectrl with ctrl
Re: treectrl with ctrl [message #22913 is a reply to message #22905] Fri, 28 August 2009 11:47 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13980
Registered: November 2005
Ultimate Member
sapiency wrote on Wed, 26 August 2009 09:39

hi,

with controls in Nodes it is not possible to use 'Value' and 'Key'


void  TreeCtrl::Set(int id, Value v)
{
	Item& m = item[id];
	if(m.ctrl)
		m.ctrl->SetData(v);
	else {
		m.value = m.key = v;
		RefreshItem(id);
	}
	SetOption(id);
}

void  TreeCtrl::Set(int id, Value k, Value v)
{
	Item& m = item[id];
	if(m.ctrl)
		m.ctrl->SetData(v);
	else {
		m.key = k;
		m.value = v;
		RefreshItem(id);
	}
	SetOption(id);
}


This could be solved if there would be a virtual method in Ctrl
virtual void SetData(const Value& data, const Value& value) {}

and modify the method in TreeCtrl to:
void  TreeCtrl::Set(int id, Value k, Value v)
{
	Item& m = item[id];
	if(m.ctrl)
		m.ctrl->SetData(k, v);
	else {
		m.key = k;
		m.value = v;
		RefreshItem(id);
	}
	SetOption(id);
}


Maybe it is possible to extend the code

regards

reinhard


Well, I think the design is quite right for value - widget now represents the Value of node. This behaviour is also consistent with ArrayCtrl.

There is a sort of question of what to do with key though. I think we should try something better...

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: bug with shift select
Next Topic: Nodes with Ctrl content disappear when Drag n Drop
Goto Forum:
  


Current Time: Wed May 15 06:00:17 CEST 2024

Total time taken to generate the page: 0.02688 seconds