diff --git a/uppdev/ScrollBug/ScrollBug.h b/uppdev/ScrollBug/ScrollBug.h index 5727f80e9..da985eb34 100644 --- a/uppdev/ScrollBug/ScrollBug.h +++ b/uppdev/ScrollBug/ScrollBug.h @@ -3,11 +3,11 @@ #include +using namespace Upp; + #define LAYOUTFILE #include - - class ScrollBug : public WithScrollBugLayout { public: typedef ScrollBug CLASSNAME; diff --git a/uppdev/ScrollBug/ScrollBug.lay b/uppdev/ScrollBug/ScrollBug.lay index 1a1e1e55b..e8a24b953 100644 --- a/uppdev/ScrollBug/ScrollBug.lay +++ b/uppdev/ScrollBug/ScrollBug.lay @@ -1,3 +1,5 @@ LAYOUT(ScrollBugLayout, 548, 504) - ITEM(TabCtrl, tab, HSizePosZ(4, 4).VSizePosZ(28, 32)) + ITEM(ArrayCtrl, list, LeftPosZ(16, 512).TopPosZ(20, 464)) + ITEM(Button, Test, LeftPosZ(68, 88).TopPosZ(156, 32)) END_LAYOUT + diff --git a/uppdev/ScrollBug/main.cpp b/uppdev/ScrollBug/main.cpp index 048ebc9d2..31cd9e625 100644 --- a/uppdev/ScrollBug/main.cpp +++ b/uppdev/ScrollBug/main.cpp @@ -3,18 +3,13 @@ ScrollBug::ScrollBug() { CtrlLayout(*this, "Window title"); - - tab.Add(edit.SizePos(), "Edit"); - tab.Add("Empty"); - - for(int i = 0; i < 16000; i++) - edit.Insert(0, Format("Line %d\n", 16000 - i)); - - Sizeable().Zoomable(); + list.AddColumn("Test"); + for(int i = 0; i < 1000; i++) + list.Add(i); } GUI_APP_MAIN { - Ctrl::ShowRepaint = 30; + Ctrl::ShowRepaint(30); ScrollBug().Run(); } diff --git a/uppdev/ScrollTest/main.cpp b/uppdev/ScrollTest/main.cpp index 986a55707..195b357f3 100644 --- a/uppdev/ScrollTest/main.cpp +++ b/uppdev/ScrollTest/main.cpp @@ -1,8 +1,10 @@ #include +using namespace Upp; + struct App : public TopWindow { Point pos; - Button ok; + Button ok, tl; virtual void Paint(Draw &w) { @@ -17,7 +19,8 @@ struct App : public TopWindow { { if(key == VK_SPACE) { Size sz = GetSize(); - Size delta(rand() % 50, rand() % 50); + Size delta(rand() % 50 - 25, rand() % 50 - 25); + delta = Size(0, -10); pos += delta; ScrollView(-delta); } @@ -28,11 +31,12 @@ struct App : public TopWindow { { pos = Point(0, 0); Add(ok.HCenterPos(20).VCenterPos(20)); + Add(tl.TopPos(0, 20).LeftPos(0, 20)); } }; GUI_APP_MAIN { - Ctrl::ShowRepaint = 30; + Ctrl::ShowRepaint(30); App().Run(); }