diff --git a/uppdev/ArrayCtrl/ArrayCtrl.upp b/uppdev/ArrayCtrl/ArrayCtrl.upp index fd10d1890..280951725 100644 --- a/uppdev/ArrayCtrl/ArrayCtrl.upp +++ b/uppdev/ArrayCtrl/ArrayCtrl.upp @@ -1,16 +1,15 @@ -description "\377B"; - -uses - CtrlLib, - Crypto; - -file - app.tpp, - ArrayCtrl.h, - main.cpp optimize_speed, - src.tpp, - srcimp.tpp; - -mainconfig - "" = "GUI"; - +description "\377B"; + +uses + CtrlLib; + +file + app.tpp, + ArrayCtrl.h, + main.cpp optimize_speed, + src.tpp, + srcimp.tpp; + +mainconfig + "" = "GUI"; + diff --git a/uppdev/ArrayCtrl/main.cpp b/uppdev/ArrayCtrl/main.cpp index 4e5685e94..59cd2d9d1 100644 --- a/uppdev/ArrayCtrl/main.cpp +++ b/uppdev/ArrayCtrl/main.cpp @@ -1,74 +1,68 @@ -#include - -using namespace Upp; - -struct App : TopWindow { - ArrayCtrl a, b; - Splitter s; - - void DnD(PasteClip& d) - { - if(AcceptText(d)) - a.Add(GetString(d), GetString(d)); - } - - void DnDInsert(int line, PasteClip& d) - { - if(AcceptInternal(d, "array")) - a.InsertDrop(line, d); - if(AcceptText(d)) { - a.Insert(line); - a.Set(line, 0, GetString(d)); - a.SetCursor(line); - } - } - - void DnDInsertB(int line, PasteClip& d) - { - if(AcceptInternal()(d, "array")) - b.InsertDrop(line, d); - } - - void Drag() - { - if(DoDragAndDrop(InternalClip(a, "array")) == DND_MOVE) - a.RemoveSelection(); - } - - void DragB() - { - if(DoDragAndDrop(InternalClip(b, "array")) == DND_MOVE) - b.RemoveSelection(); - } - - typedef App CLASSNAME; - - App() { - a.AddColumn("Text"); - a.MultiSelect(); - a.NoGrid(); - a.WhenDropInsert = THISBACK(DnDInsert); - a.WhenDrop = THISBACK(DnD); - a.WhenDrag = THISBACK(Drag); - - b.AddColumn("Text"); - b.MultiSelect(); - b.WhenDropInsert = THISBACK(DnDInsertB); - b.WhenDrag = THISBACK(DragB); - - Add(s.Horz(a, b)); - for(int i = 0; i < 200; i++) { - a.Add(i); - b.Add(FormatIntRoman(i, true)); - if((i & 3) == 0) - a.AddSeparator(); - } - Sizeable(); - } -}; - -GUI_APP_MAIN -{ - DUMP("Test"); - App().Run(); -} +#include + +using namespace Upp; + +struct App : TopWindow { + ArrayCtrl a, b; + Splitter s; + + void DnD(PasteClip& d) + { + if(AcceptText(d)) + a.Add(GetString(d), GetString(d)); + } + + void DnDInsert(int line, PasteClip& d) + { + if(AcceptInternal(d, "array")) + a.InsertDrop(line, d); + if(AcceptText(d)) { + a.Insert(line); + a.Set(line, 0, GetString(d)); + a.SetCursor(line); + } + } + + void DnDInsertB(int line, PasteClip& d) + { + } + + void Drag() + { + } + + void DragB() + { + } + + typedef App CLASSNAME; + + App() { + a.AddColumn("Text"); + a.MultiSelect(); + a.NoGrid(); + a.WhenDropInsert = THISBACK(DnDInsert); + a.WhenDrop = THISBACK(DnD); + a.WhenDrag = THISBACK(Drag); + + b.AddColumn("Text"); + b.MultiSelect(); + b.WhenDropInsert = THISBACK(DnDInsertB); + b.WhenDrag = THISBACK(DragB); + + Add(s.Horz(a, b)); + for(int i = 0; i < 200; i++) { + a.Add(i); + b.Add(FormatIntRoman(i, true)); + if((i & 3) == 0) + a.AddSeparator(); + } + Sizeable(); + } +}; + +GUI_APP_MAIN +{ + DUMP("Test"); + App().Run(); +} diff --git a/uppdev/Cham/main.cpp b/uppdev/Cham/main.cpp index 992e63778..3d6fb81dd 100644 --- a/uppdev/Cham/main.cpp +++ b/uppdev/Cham/main.cpp @@ -1,62 +1,164 @@ -#include - -CH_INTS(ChA, 2, 1 << 2); -CH_INTS(ChB, 2, ChA); -CH_INT(ChC, 123456); - -#define IMAGECLASS TImg -#define IMAGEFILE -#include - -struct MyApp : TopWindow { - virtual void Paint(Draw& w) - { - w.DrawRect(GetSize(), Cyan); - ChPaint(w, GetSize(), TImg::TB1()); - } -}; - -GUI_APP_MAIN -{ - MyApp().Run(); - return; - TopWindow w; - Button b; - FrameRight