mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-09-05 17:44:55 -06:00
Adding uppdev....
git-svn-id: svn://ultimatepp.org/upp/trunk@328 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
dc9f782ba5
commit
4a1c627474
2823 changed files with 619073 additions and 0 deletions
36
uppdev/ArrayCtrlSort/main.cpp
Normal file
36
uppdev/ArrayCtrlSort/main.cpp
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
#include "ArrayCtrlSort.h"
|
||||
|
||||
class ArrayCtrlSort : public TopWindow {
|
||||
ArrayCtrl a;
|
||||
EditDouble ed1, ed2;
|
||||
|
||||
public:
|
||||
typedef ArrayCtrlSort CLASSNAME;
|
||||
ArrayCtrlSort();
|
||||
};
|
||||
|
||||
struct CvSum : public Convert {
|
||||
virtual Value Format(const Value& q) const {
|
||||
ValueArray va = q;
|
||||
return (int)va[0] + (int)va[1];
|
||||
}
|
||||
};
|
||||
|
||||
ArrayCtrlSort::ArrayCtrlSort()
|
||||
{
|
||||
a.AddColumn("first", "First").Edit(ed1).Sorting();
|
||||
a.AddColumn("second", "Second").Edit(ed2);
|
||||
a.AddColumnAt("first", "Format").Add("second").SetFormat("%d + %d = ").Sorting();
|
||||
a.AddColumnAt("first", "Sum")
|
||||
.Add("second")
|
||||
.SetConvert(Single<CvSum>());
|
||||
for(int i = 0; i < 100; i++)
|
||||
a.Add(rand() % 20, rand() % 10);
|
||||
Add(a.SizePos());
|
||||
a.ColumnSort(3, StdValueOrder());
|
||||
}
|
||||
|
||||
GUI_APP_MAIN
|
||||
{
|
||||
ArrayCtrlSort().Run();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue