.reference

git-svn-id: svn://ultimatepp.org/upp/trunk@10795 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2017-01-29 10:29:49 +00:00
parent 1f0ecc2c7d
commit 3d85689bec
3 changed files with 38 additions and 1 deletions

View file

@ -0,0 +1,26 @@
#include <CtrlLib/CtrlLib.h>
using namespace Upp;
GUI_APP_MAIN
{
ArrayCtrl list;
list.AddColumn("Column1").Sorting(); // default sorting
list.AddColumn("Column2") // we provide compare function that sorts based on string length
.Sorting([](const Value& a, const Value& b) -> int {
return SgnCompare(AsString(a).GetCount(), AsString(b).GetCount());
});
list.Add("Not sorted");
for(int i = 0; i < 100; i++)
list.Add((int)Random(), (int)Random(), (int)Random());
list.SortingFrom(1);
TopWindow win;
win.Add(list.SizePos());
win.Run();
}