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 (sort column)
Re: ColumnList question (sort column) [message #2913 is a reply to message #2898] Sat, 29 April 2006 22:58 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14261
Registered: November 2005
Ultimate Member
forlano wrote on Sat, 29 April 2006 05:32

Hello,

I have put my data in a columnlist widget and I would like to see them sorted alphabetically (it does not matter if during the insertion or at the end). The syntax to do it is:

Sort(const ValueOrder& order)

but I was unable fo find an example that shows how to set this argument.

Thank you,
Luigi



[/code]
struct ValueOrder {
virtual bool operator()(const Value& a, const Value& b) const = 0;
};

struct StdValueOrder : ValueOrder {
int language;

virtual bool operator()(const Value& a, const Value& b) const;

StdValueOrder(int l = -1);
virtual ~StdValueOrder();
};

struct FnValueOrder : ValueOrder {
int (*fn)(const Value& a, const Value& b);

virtual bool operator()(const Value& a, const Value& b) const;

FnValueOrder(int (*fn)(const Value& a, const Value& b));
virtual ~FnValueOrder();
};
[/code]

Use "StdValueOrder()" in place of ValueOrder if you expect the "normal" ordering and content of columnlist consists of "Std" values (number, String, Date, Time).

list.Sort(StdValueOrder());


If you need something special, you can either create comparison function and use FnValueOrder, or you can derive ValueOrder and provide new operator().

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to set window shape by means of a bitmap?
Next Topic: Borderless always-on-top non-modal window
Goto Forum:
  


Current Time: Fri Jun 06 11:02:35 CEST 2025

Total time taken to generate the page: 0.04509 seconds