mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
syncing uppdev
git-svn-id: svn://ultimatepp.org/upp/trunk@1510 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
de5f125d68
commit
214b94f6f8
4 changed files with 16 additions and 15 deletions
|
|
@ -3,11 +3,11 @@
|
|||
|
||||
#include <CtrlLib/CtrlLib.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
#define LAYOUTFILE <ScrollBug/ScrollBug.lay>
|
||||
#include <CtrlCore/lay.h>
|
||||
|
||||
|
||||
|
||||
class ScrollBug : public WithScrollBugLayout<TopWindow> {
|
||||
public:
|
||||
typedef ScrollBug CLASSNAME;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
#include <CtrlLib/CtrlLib.h>
|
||||
|
||||
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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue