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 » ArrayCtrl, HeaderCtrl & GridCtrl » ArrayCtrl sorting
Re: ArrayCtrl sorting [message #13319 is a reply to message #13313] Tue, 01 January 2008 11:01 Go to previous message
mirek is currently offline  mirek
Messages: 13982
Registered: November 2005
Ultimate Member
michael wrote on Mon, 31 December 2007 13:35

Thanks, Mirek.

But i didn't understand how to use Order. Can you please explain this?

Michael


E.g. like this:

struct DatumJmenoOrder : public ArrayCtrl::Order {
	virtual bool operator()(const Vector<Value>& row1, const Vector<Value>& row2) const
	{
		int q;
		q = (Date)row1[0] - (Date)row2[0];
		if(q) return q < 0;
		q = CompareJmeno(row1, row2, 1);
		if(q) return q < 0;
		q = CompareAdresa(row1, row2, 4);
		return q < 0;
	}
};


Compares based on 3 rows, with specific comparisons used for two of them...

Mirek
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Selection changes before LostFocus() is called
Next Topic: How to change GridCtrl background color
Goto Forum:
  


Current Time: Sun Jun 02 23:44:14 CEST 2024

Total time taken to generate the page: 0.03601 seconds