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
treectrl with ctrl [message #22905] Wed, 26 August 2009 15:39 Go to previous message
sapiency is currently offline  sapiency
Messages: 56
Registered: September 2008
Member
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
 
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: Mon Apr 29 12:25:13 CEST 2024

Total time taken to generate the page: 0.02989 seconds