mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-23 06:13:07 -06:00
changed svn layout
git-svn-id: svn://ultimatepp.org/upp/trunk@281 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
commit
263ff5f895
2665 changed files with 642923 additions and 0 deletions
43
reference/ArrayCtrlEdits/main.cpp
Normal file
43
reference/ArrayCtrlEdits/main.cpp
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
#include <CtrlLib/CtrlLib.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
#define LAYOUTFILE <ArrayCtrlEdits/ArrayCtrlEdits.lay>
|
||||
#include <CtrlCore/lay.h>
|
||||
|
||||
struct App : public WithAppLayout<TopWindow> {
|
||||
EditDouble editdbl;
|
||||
|
||||
typedef App CLASSNAME;
|
||||
App();
|
||||
};
|
||||
|
||||
struct SqrNumberConvert : Convert {
|
||||
virtual Value Format(const Value& q) const {
|
||||
return IsNull(q) ? (double)Null : (double)q * (double)q;
|
||||
}
|
||||
};
|
||||
|
||||
void EditDblMinMaxFactory(One<Ctrl>& ctrl)
|
||||
{
|
||||
ctrl.Create<EditDouble>().MinMax(0, 1);
|
||||
}
|
||||
|
||||
App::App()
|
||||
{
|
||||
CtrlLayout(*this);
|
||||
list.AddColumn("Number").Edit(editdbl);
|
||||
list.AddColumnAt(0, "Number^2").SetConvert(Single<SqrNumberConvert>());
|
||||
list.AddColumn("Text").Ctrls<EditString>();
|
||||
list.AddColumn("Limited number").Ctrls(EditDblMinMaxFactory);
|
||||
list.AddCtrl(editor);
|
||||
list.AddCtrl(option);
|
||||
list.Appending().Removing();
|
||||
list.SetLineCy(EditField::GetStdHeight());
|
||||
list.ColumnWidths("49 63 74 96");
|
||||
}
|
||||
|
||||
GUI_APP_MAIN
|
||||
{
|
||||
App().Run();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue