awidgets
This commit is contained in:
parent
c87e5a25d5
commit
a55a5ec5cc
7 changed files with 151 additions and 51 deletions
|
|
@ -3,29 +3,23 @@
|
|||
namespace tp {
|
||||
|
||||
template <typename Events, typename Canvas>
|
||||
class SimpleWidget : public ScrollableWindow<Events, Canvas> {
|
||||
class SimpleWidget : public CollapsableMenu<Events, Canvas> {
|
||||
public:
|
||||
SimpleWidget() {
|
||||
this->addWidget(&mLabel);
|
||||
this->addWidget(&mButton);
|
||||
this->addWidget(&mSlider);
|
||||
this->addWidget(&mCollapsableMenu);
|
||||
this->addWidgetToMenu(&mInMenuButton1);
|
||||
this->addWidgetToMenu(&mInMenuButton2);
|
||||
|
||||
mCollapsableMenu.addWidgetToMenu(&mInMenuButton1);
|
||||
mCollapsableMenu.addWidgetToMenu(&mInMenuButton2);
|
||||
this->addWidgetToMenu(&mLabel);
|
||||
this->addWidgetToMenu(&mSlider);
|
||||
|
||||
mInMenuButton1.mLabel.mLabel = "Button1";
|
||||
mInMenuButton2.mLabel.mLabel = "Button2";
|
||||
|
||||
this->mArea.size = { 500, 500 };
|
||||
}
|
||||
|
||||
private:
|
||||
CollapsableMenu<Events, Canvas> mCollapsableMenu;
|
||||
ButtonWidget<EventHandler, Canvas> mInMenuButton1;
|
||||
ButtonWidget<EventHandler, Canvas> mInMenuButton2;
|
||||
|
||||
ButtonWidget<EventHandler, Canvas> mButton;
|
||||
LabelWidget<EventHandler, Canvas> mLabel;
|
||||
NamedSliderWidget<EventHandler, Canvas> mSlider;
|
||||
};
|
||||
|
|
@ -36,10 +30,17 @@ namespace tp {
|
|||
SimpleWidget2() {
|
||||
this->mChildWidgets.pushBack(&mFloating);
|
||||
mFloating.addWidgetToMenu(&mWidget);
|
||||
mFloating.addWidgetToMenu(&mWidget2);
|
||||
|
||||
// this->mChildWidgets.pushBack(&mFloating2);
|
||||
// mFloating2.addWidgetToMenu(&mWidget2);
|
||||
}
|
||||
|
||||
private:
|
||||
FloatingWidget<EventHandler, Canvas> mFloating;
|
||||
SimpleWidget<EventHandler, Canvas> mWidget;
|
||||
|
||||
FloatingWidget<EventHandler, Canvas> mFloating2;
|
||||
SimpleWidget<EventHandler, Canvas> mWidget2;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue