1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:57:35 +00:00

Start working on a simple TextBox widget.

This commit is contained in:
Andreas Kling 2018-10-13 22:46:34 +02:00
parent 6f1b384cde
commit dfb70ed234
7 changed files with 201 additions and 2 deletions

View file

@ -9,6 +9,7 @@
#include "ClockWidget.h"
#include "CheckBox.h"
#include "ListBox.h"
#include "TextBox.h"
#include <cstdio>
int main(int argc, char** argv)
@ -48,7 +49,7 @@ int main(int argc, char** argv)
{
auto* widgetTestWindow = new Window;
widgetTestWindow->setTitle("Widget test");
widgetTestWindow->setRect({ 20, 40, 100, 160 });
widgetTestWindow->setRect({ 20, 40, 100, 180 });
auto* widgetTestWindowWidget = new Widget;
widgetTestWindowWidget->setWindowRelativeRect({ 0, 0, 100, 100 });
@ -67,11 +68,18 @@ int main(int argc, char** argv)
c->setCaption("CheckBox");
auto *lb = new ListBox(widgetTestWindowWidget);
lb->setWindowRelativeRect({0, 60, 100, 100 });
lb->setWindowRelativeRect({ 0, 60, 100, 100 });
lb->addItem("This");
lb->addItem("is");
lb->addItem("a");
lb->addItem("ListBox");
auto *tb = new TextBox(widgetTestWindowWidget);
tb->setWindowRelativeRect({ 0, 160, 100, 20 });
tb->setText("Hello!");
tb->setFocus(true);
WindowManager::the().setActiveWindow(widgetTestWindow);
}
auto* win = new Window;