Replace Old Widgets

This commit is contained in:
IlyaShurupov 2024-10-18 10:56:42 +03:00 committed by Ilya Shurupov
parent 03da5e41d6
commit c41dc20132
81 changed files with 388 additions and 278 deletions

View file

@ -1,29 +1,19 @@
#include "GraphicApplication.hpp"
#include "WidgetApplication.hpp"
#include "Sketch3D.hpp"
#include "Sketch3DWidget.hpp"
using namespace tp;
class Sketch3DApplication : public Application {
class Sketch3DApplication : public WidgetApplication {
public:
Sketch3DApplication() :
mGui(*mGraphics->getCanvas(), { 1920, 1080 }) {}
void processFrame(EventHandler* eventHandler, halnf delta) override {
auto rec = RectF({ 0, 0 }, mWindow->getSize());
mGui.setVisible(true);
mGui.setArea(rec);
mGui.updateConfigWrapper(mWidgetManager);
mGui.procWrapper(*eventHandler, rec);
mGui(*mGraphics->getCanvas(), { 1920, 1080 }) {
setRoot(&mGui);
}
void drawFrame(Canvas* canvas) override { mGui.drawWrapper(*canvas); }
private:
WidgetManager mWidgetManager;
Sketch3DGUI mGui;
};