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 » U++ Widgets - General questions or Mixed problems » ColumnList question (move and delete item)
ColumnList question (move and delete item) [message #2795] Tue, 25 April 2006 15:30 Go to next message
forlano is currently offline  forlano
Messages: 1189
Registered: March 2006
Location: Italy
Senior Contributor
Hello,

I had to show data vertically (just one column), then change their relative position and remove when necessary. Instead to use the arrayctrl I wanted to experiment the ColumnList believing that was more appropriate. Now that everything is ready I can't find a method to remove the item and permit their relative motion.
Is there a solution or I must come back to the arraycrtl?

Thank you,
Luigi

[Updated on: Tue, 25 April 2006 15:31]

Report message to a moderator

Re: ColumnList question (move and delete item) [message #2798 is a reply to message #2795] Tue, 25 April 2006 19:59 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13986
Registered: November 2005
Ultimate Member
Well, to my surprise, columnlist indeed does not support those, for no real reason...

Going to add them now...

Mirek
Re: ColumnList question (move and delete item) [message #2800 is a reply to message #2798] Tue, 25 April 2006 20:26 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13986
Registered: November 2005
Ultimate Member
OK, added.

Will be in next release, however, if you really need it now, just add/replace these methods in ColumnList:

void ColumnList::Insert(int ii, const Value& val, bool canselect)
{
	Item& m = item.Insert(ii);
	int c = -1;
	if(cursor >= ii) {
		c = cursor + 1;
		KillCursor();
	}
	m.value = val;
	m.sel = false;
	m.canselect = canselect;
	m.display = NULL;
	Refresh();
	SetSb();
	if(c >= 0)
		SetCursor(c);
}

void ColumnList::Insert(int ii, const Value& val, const Display& display, bool canselect)
{
	Insert(ii, val, canselect);
	item[ii].display = &display;
}

void ColumnList::Remove(int ii)
{
	int c = -1;
	if(cursor >= ii) {
		c = max(ii, cursor - 1);
		KillCursor();
	}
	item.Remove(ii);
	Refresh();
	SetSb();
	if(c >= 0)
		SetCursor(c);
}

void ColumnList::Add(const Value& val, bool canselect)
{
	Insert(item.GetCount(), val, canselect);
}

void ColumnList::Add(const Value& val, const Display& display, bool canselect)
{
	Add(val);
	item.Top().display = &display;
}



Mirek
Re: ColumnList question (move and delete item) [message #2802 is a reply to message #2800] Tue, 25 April 2006 22:00 Go to previous message
forlano is currently offline  forlano
Messages: 1189
Registered: March 2006
Location: Italy
Senior Contributor
luzr wrote on Tue, 25 April 2006 20:26

OK, added.

Will be in next release, however, if you really need it now, just add/replace these methods in ColumnList:

Mirek


Thank you Mirek,

I can wait. I'll use it for the next experiment.
Now I've used an arrayctrl single column.

Luigi
Previous Topic: How to run timer just a several cycles?
Next Topic: DropList cores on ClearList()
Goto Forum:
  


Current Time: Mon Jun 17 18:03:11 CEST 2024

Total time taken to generate the page: 0.02272 seconds