Resize events
This commit is contained in:
parent
4c8cd87421
commit
e52b8ef401
|
@ -50,8 +50,8 @@ static constexpr uint kInitialHeight = 600;
|
||||||
TabUI::TabUI()
|
TabUI::TabUI()
|
||||||
: UI(kInitialWidth, kInitialHeight),
|
: UI(kInitialWidth, kInitialHeight),
|
||||||
tab(getWindow().getNativeWindowHandle()),
|
tab(getWindow().getNativeWindowHandle()),
|
||||||
AButtonWidget(this, 75.f, 700.f, 500.f, kParameterButtonA, this),
|
AButtonWidget(this, 75.f, kInitialWidth - 100, kInitialHeight - 100, kParameterButtonA, this),
|
||||||
BButtonWidget(this, 75.f, 700.f, 400.f, kParameterButtonB, this)
|
BButtonWidget(this, 75.f, kInitialWidth - 100, kInitialHeight - 200, kParameterButtonB, this)
|
||||||
{
|
{
|
||||||
|
|
||||||
#ifdef DGL_NO_SHARED_RESOURCES
|
#ifdef DGL_NO_SHARED_RESOURCES
|
||||||
|
@ -141,6 +141,15 @@ bool TabUI::onMouse(const MouseEvent &ev)
|
||||||
return false; // Allow event to propagate.
|
return false; // Allow event to propagate.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TabUI::onResize(const ResizeEvent &ev)
|
||||||
|
{
|
||||||
|
float x = ev.size.getWidth();
|
||||||
|
float y = ev.size.getHeight();
|
||||||
|
AButtonWidget.setAbsolutePos(x - 100, y - 100);
|
||||||
|
BButtonWidget.setAbsolutePos(x - 100, y - 200);
|
||||||
|
return UI::onResize(ev);
|
||||||
|
}
|
||||||
|
|
||||||
bool TabUI::onScroll(const ScrollEvent &ev)
|
bool TabUI::onScroll(const ScrollEvent &ev)
|
||||||
{
|
{
|
||||||
double add;
|
double add;
|
||||||
|
|
|
@ -46,6 +46,7 @@ public:
|
||||||
void uiIdle() override;
|
void uiIdle() override;
|
||||||
bool onMouse(const MouseEvent &ev) override;
|
bool onMouse(const MouseEvent &ev) override;
|
||||||
bool onScroll(const ScrollEvent &ev) override;
|
bool onScroll(const ScrollEvent &ev) override;
|
||||||
|
void onResize(const ResizeEvent &ev) override;
|
||||||
void onNanoDisplay() override;
|
void onNanoDisplay() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in New Issue