ladybird/Widgets/test.cpp

47 lines
1.0 KiB
C++
Raw Normal View History

2018-10-10 16:12:38 +03:00
#include "FrameBufferSDL.h"
#include "EventLoopSDL.h"
#include "RootWidget.h"
2018-10-10 17:49:36 +03:00
#include "Label.h"
2018-10-11 02:48:09 +03:00
#include "Button.h"
2018-10-11 03:50:08 +03:00
#include "TerminalWidget.h"
2018-10-11 17:52:40 +03:00
#include "WindowManager.h"
2018-10-10 16:12:38 +03:00
#include <cstdio>
int main(int c, char** v)
{
FrameBufferSDL fb(800, 600);
fb.show();
EventLoopSDL loop;
RootWidget w;
fb.setRootWidget(&w);
2018-10-11 17:52:40 +03:00
WindowManager::the();
auto* l1 = new Label(&w);
l1->setRect(Rect(100, 100, 300, 20));
l1->setText("0123456789");
auto* l2 = new Label(&w);
l2->setRect(Rect(100, 120, 300, 20));
l2->setText("ABCDEFGHIJKLMNOPQRSTUVWXYZ");
auto* l3 = new Label(&w);
l3->setRect(Rect(100, 140, 300, 20));
l3->setText("abcdefghijklmnopqrstuvwxyz");
auto* l4 = new Label(&w);
l4->setRect(Rect(100, 160, 300, 20));
l4->setText("!\"#$%&'()*+,-./:;<=>?@[\\]^_{|}~");
2018-10-11 02:48:09 +03:00
auto* b = new Button(&w);
b->setRect(Rect(10, 10, 100, 30));
b->setCaption("Button!");
2018-10-10 17:49:36 +03:00
2018-10-11 03:50:08 +03:00
auto* t = new TerminalWidget(&w);
2018-10-11 17:52:40 +03:00
t->setWindowTitle("Console");
2018-10-11 03:50:08 +03:00
2018-10-10 16:12:38 +03:00
return loop.exec();
}