Add win32 mouse button events.

This commit is contained in:
jmsgrogan 2023-01-17 08:34:48 +00:00
parent 2bc53186bc
commit 78a4fa99ff
20 changed files with 141 additions and 53 deletions

View file

@ -1,9 +1,14 @@
#include "TestUiApplication.h"
#include "TestFramework.h"
#include "TestRenderUtils.h"
#include "TestUtils.h"
#include "RectangleNode.h"
#include "TextNode.h"
#include "Button.h"
#include "TransformNode.h"
#include <memory>
#include <string>
#include <iostream>
@ -20,5 +25,31 @@ TEST_CASE(TestD2dRendering, "graphics")
scene->addNode(text_node.get());
scene->update();
gui_app->run();
};
TEST_CASE(TestD2dWidgetRendering, "graphics")
{
auto gui_app = TestCaseRunner::getInstance().getTestApplication();
auto scene = gui_app->getMainWindowScene();
Widget widget;
widget.setBackgroundColor({ 0, 200, 0 });
widget.setBounds(300, 300);
auto button = Button::Create();
button->setBackgroundColor({ 200, 0, 0 });
button->setLabel("Test Button");
button->setMaxWidth(100);
widget.addWidget(std::move(button));
widget.onPaintEvent(nullptr);
scene->addNode(widget.getRootNode());
scene->update();
TestRenderer::writeSvg(TestUtils::getTestOutputDir(__FILE__) / "TestD2dWidgetRendering.svg", scene);
gui_app->run();
};