gui updates
This commit is contained in:
parent
05ac11b24c
commit
b8f125b472
42 changed files with 1179 additions and 962 deletions
|
|
@ -23,7 +23,7 @@ public:
|
|||
|
||||
private:
|
||||
WidgetManager mWidgetManager;
|
||||
ComplexWidget<EventHandler, Canvas> mGui;
|
||||
ComplexWidget mGui;
|
||||
};
|
||||
|
||||
int main() {
|
||||
|
|
|
|||
|
|
@ -4,8 +4,7 @@
|
|||
|
||||
namespace tp {
|
||||
|
||||
template <typename Events, typename Canvas>
|
||||
class UserWidget : public Widget<Events, Canvas> {
|
||||
class UserWidget : public Widget {
|
||||
public:
|
||||
UserWidget() = default;
|
||||
|
||||
|
|
@ -39,8 +38,7 @@ namespace tp {
|
|||
halnf mRounding = 0;
|
||||
};
|
||||
|
||||
template <typename Events, typename Canvas>
|
||||
class MessageWidget : public Widget<Events, Canvas> {
|
||||
class MessageWidget : public Widget {
|
||||
public:
|
||||
MessageWidget() = default;
|
||||
|
||||
|
|
@ -84,8 +82,7 @@ namespace tp {
|
|||
halnf mRounding = 0;
|
||||
};
|
||||
|
||||
template <typename Events, typename Canvas>
|
||||
class LoginWidget : public Widget<Events, Canvas> {
|
||||
class LoginWidget : public Widget {
|
||||
public:
|
||||
explicit LoginWidget() {
|
||||
mPass.mId = "pass";
|
||||
|
|
@ -120,16 +117,15 @@ namespace tp {
|
|||
}
|
||||
|
||||
public:
|
||||
TextInputWidget<Events, Canvas> mUser;
|
||||
TextInputWidget<Events, Canvas> mPass;
|
||||
ButtonWidget<Events, Canvas> mButton;
|
||||
TextInputWidget mUser;
|
||||
TextInputWidget mPass;
|
||||
ButtonWidget mButton;
|
||||
bool mLogged = false;
|
||||
|
||||
RGBA mBGColor;
|
||||
};
|
||||
|
||||
template <typename Events, typename Canvas>
|
||||
class ActiveChatWidget : public Widget<Events, Canvas> {
|
||||
class ActiveChatWidget : public Widget {
|
||||
public:
|
||||
ActiveChatWidget() {
|
||||
mSend.mLabel.mLabel = "Send";
|
||||
|
|
@ -172,23 +168,22 @@ namespace tp {
|
|||
}
|
||||
|
||||
public:
|
||||
Buffer<MessageWidget<Events, Canvas>> mMessages;
|
||||
ScrollableWindow<Events, Canvas> mHistoryView;
|
||||
TextInputWidget<Events, Canvas> mMessage;
|
||||
ButtonWidget<Events, Canvas> mSend;
|
||||
Buffer<MessageWidget> mMessages;
|
||||
ScrollableWindow mHistoryView;
|
||||
TextInputWidget mMessage;
|
||||
ButtonWidget mSend;
|
||||
|
||||
RGBA mBGColor;
|
||||
halnf mPadding = 0;
|
||||
};
|
||||
|
||||
template <typename Events, typename Canvas>
|
||||
class ChattingWidget : public Widget<Events, Canvas> {
|
||||
class ChattingWidget : public Widget {
|
||||
public:
|
||||
ChattingWidget() {
|
||||
// todo : fetch code
|
||||
mUsers.append(UserWidget<Events, Canvas>());
|
||||
mUsers.append(UserWidget<Events, Canvas>());
|
||||
mUsers.append(UserWidget<Events, Canvas>());
|
||||
mUsers.append(UserWidget());
|
||||
mUsers.append(UserWidget());
|
||||
mUsers.append(UserWidget());
|
||||
|
||||
mUsers[0].mArea = { 0, 0, 100, 100 };
|
||||
mUsers[1].mArea = { 0, 0, 100, 100 };
|
||||
|
|
@ -198,9 +193,9 @@ namespace tp {
|
|||
mSideView.addWidget(&message.data());
|
||||
}
|
||||
|
||||
mActive.mMessages.append(MessageWidget<Events, Canvas>());
|
||||
mActive.mMessages.append(MessageWidget<Events, Canvas>());
|
||||
mActive.mMessages.append(MessageWidget<Events, Canvas>());
|
||||
mActive.mMessages.append(MessageWidget());
|
||||
mActive.mMessages.append(MessageWidget());
|
||||
mActive.mMessages.append(MessageWidget());
|
||||
|
||||
mActive.mMessages[0].mArea = { 0, 0, 100, 50 };
|
||||
mActive.mMessages[1].mArea = { 0, 0, 100, 50 };
|
||||
|
|
@ -229,16 +224,15 @@ namespace tp {
|
|||
}
|
||||
|
||||
public:
|
||||
Buffer<UserWidget<Events, Canvas>> mUsers;
|
||||
ScrollableWindow<Events, Canvas> mSideView;
|
||||
ActiveChatWidget<Events, Canvas> mActive;
|
||||
SplitView<Events, Canvas> mSplitView;
|
||||
Buffer<UserWidget> mUsers;
|
||||
ScrollableWindow mSideView;
|
||||
ActiveChatWidget mActive;
|
||||
SplitView mSplitView;
|
||||
|
||||
RGBA mBGColor;
|
||||
};
|
||||
|
||||
template <typename Events, typename Canvas>
|
||||
class ComplexWidget : public Widget<Events, Canvas> {
|
||||
class ComplexWidget : public Widget {
|
||||
public:
|
||||
ComplexWidget() {
|
||||
this->mChildWidgets.pushBack(&mLogin);
|
||||
|
|
@ -264,8 +258,8 @@ namespace tp {
|
|||
|
||||
private:
|
||||
bool mLogged = false;
|
||||
LoginWidget<Events, Canvas> mLogin;
|
||||
ChattingWidget<Events, Canvas> mChatting;
|
||||
LoginWidget mLogin;
|
||||
ChattingWidget mChatting;
|
||||
|
||||
RGBA mBGColor;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public:
|
|||
private:
|
||||
WidgetManager mWidgetManager;
|
||||
|
||||
SimpleWidget2<EventHandler, Canvas> mGui;
|
||||
SimpleWidget2 mGui;
|
||||
};
|
||||
|
||||
int main() {
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
|
||||
namespace tp {
|
||||
|
||||
template <typename Events, typename Canvas>
|
||||
class SimpleWidget : public CollapsableMenu<Events, Canvas> {
|
||||
class SimpleWidget : public CollapsableMenu {
|
||||
public:
|
||||
SimpleWidget() {
|
||||
this->addWidgetToMenu(&mInMenuButton1);
|
||||
|
|
@ -17,30 +16,29 @@ namespace tp {
|
|||
}
|
||||
|
||||
private:
|
||||
ButtonWidget<EventHandler, Canvas> mInMenuButton1;
|
||||
ButtonWidget<EventHandler, Canvas> mInMenuButton2;
|
||||
ButtonWidget mInMenuButton1;
|
||||
ButtonWidget mInMenuButton2;
|
||||
|
||||
LabelWidget<EventHandler, Canvas> mLabel;
|
||||
NamedSliderWidget<EventHandler, Canvas> mSlider;
|
||||
LabelWidget mLabel;
|
||||
NamedSliderWidget mSlider;
|
||||
};
|
||||
|
||||
template <typename Events, typename Canvas>
|
||||
class SimpleWidget2 : public Widget<Events, Canvas> {
|
||||
class SimpleWidget2 : public Widget {
|
||||
public:
|
||||
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 mFloating;
|
||||
SimpleWidget mWidget;
|
||||
|
||||
FloatingWidget<EventHandler, Canvas> mFloating2;
|
||||
SimpleWidget<EventHandler, Canvas> mWidget2;
|
||||
FloatingWidget mFloating2;
|
||||
SimpleWidget mWidget2;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue