diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-06-14 15:57:45 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-06-14 15:57:45 +0300 |
commit | 33dc4573f4defbfb40b62d2d5ee1ed8f423c9db7 (patch) | |
tree | 877cd5bcdb0525af4778c6fa5b39924db47f4f9a | |
parent | 1be49b309ada7c988a5b48baa83281427db778fe (diff) | |
download | manaverse-33dc4573f4defbfb40b62d2d5ee1ed8f423c9db7.tar.gz manaverse-33dc4573f4defbfb40b62d2d5ee1ed8f423c9db7.tar.bz2 manaverse-33dc4573f4defbfb40b62d2d5ee1ed8f423c9db7.tar.xz manaverse-33dc4573f4defbfb40b62d2d5ee1ed8f423c9db7.zip |
Add to Widget class method postInit().
-rw-r--r-- | src/gui/widgets/createwidget.h | 3 | ||||
-rw-r--r-- | src/gui/widgets/desktop.h | 2 | ||||
-rw-r--r-- | src/gui/widgets/listbox.h | 2 | ||||
-rw-r--r-- | src/gui/widgets/popup.h | 2 | ||||
-rw-r--r-- | src/gui/widgets/setupitem.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/sliderlist.cpp | 4 | ||||
-rw-r--r-- | src/gui/widgets/sliderlist.h | 4 | ||||
-rw-r--r-- | src/gui/widgets/tabbedarea.h | 2 | ||||
-rw-r--r-- | src/gui/widgets/widget.h | 3 | ||||
-rw-r--r-- | src/gui/widgets/window.h | 2 |
10 files changed, 16 insertions, 10 deletions
diff --git a/src/gui/widgets/createwidget.h b/src/gui/widgets/createwidget.h index 984c60c37..3a2102676 100644 --- a/src/gui/widgets/createwidget.h +++ b/src/gui/widgets/createwidget.h @@ -25,4 +25,7 @@ var = new type(__VA_ARGS__); \ var->postInit() +#define CREATEWIDGET2(type, ...) \ + static_cast<type>(Widget::callPostInit(new type(__VA_ARGS__))) + #endif // GUI_WIDGETS_CREATEWIDGET_H diff --git a/src/gui/widgets/desktop.h b/src/gui/widgets/desktop.h index da1c32c0b..21da974cd 100644 --- a/src/gui/widgets/desktop.h +++ b/src/gui/widgets/desktop.h @@ -69,7 +69,7 @@ class Desktop final : public Container, void safeDraw(Graphics *graphics) override final; - void postInit(); + void postInit() override final; void handleLink(const std::string &link, MouseEvent *event) override final; diff --git a/src/gui/widgets/listbox.h b/src/gui/widgets/listbox.h index 6e3cd2015..9dff11e09 100644 --- a/src/gui/widgets/listbox.h +++ b/src/gui/widgets/listbox.h @@ -103,7 +103,7 @@ class ListBox notfinal : public Widget, virtual ~ListBox(); - void postInit(); + void postInit() override; /** * Draws the list box. diff --git a/src/gui/widgets/popup.h b/src/gui/widgets/popup.h index fb00930bb..a784990ec 100644 --- a/src/gui/widgets/popup.h +++ b/src/gui/widgets/popup.h @@ -173,7 +173,7 @@ class Popup notfinal : public Container, bool isPopupVisible() const { return mVisible == Visible_true; } - virtual void postInit() + void postInit() override { mInit = true; } protected: diff --git a/src/gui/widgets/setupitem.cpp b/src/gui/widgets/setupitem.cpp index b02f2b9ba..b359cc952 100644 --- a/src/gui/widgets/setupitem.cpp +++ b/src/gui/widgets/setupitem.cpp @@ -1078,7 +1078,7 @@ void SetupItemSliderList::createControls() mLabel = new Label(this, mText); mLabel->setToolTip(mDescription); mSlider = new SliderList(this, mModel); - mSlider->postInit(mParent, mEventName); + mSlider->postInit2(mParent, mEventName); mSlider->setSelectedString(mValue); mSlider->adjustSize(); diff --git a/src/gui/widgets/sliderlist.cpp b/src/gui/widgets/sliderlist.cpp index 3dc5df633..e31aa1fc3 100644 --- a/src/gui/widgets/sliderlist.cpp +++ b/src/gui/widgets/sliderlist.cpp @@ -52,8 +52,8 @@ SliderList::SliderList(const Widget2 *const widget, setHeight(sliderHeight); } -void SliderList::postInit(ActionListener *const listener, - const std::string &eventId) +void SliderList::postInit2(ActionListener *const listener, + const std::string &eventId) { mPrevEventId = eventId + "_prev"; mNextEventId = eventId + "_next"; diff --git a/src/gui/widgets/sliderlist.h b/src/gui/widgets/sliderlist.h index d2a4d8071..a48ffeb4a 100644 --- a/src/gui/widgets/sliderlist.h +++ b/src/gui/widgets/sliderlist.h @@ -44,8 +44,8 @@ class SliderList final : public Container, ~SliderList(); - void postInit(ActionListener *const listener, - const std::string &eventId); + void postInit2(ActionListener *const listener, + const std::string &eventId); void updateAlpha(); diff --git a/src/gui/widgets/tabbedarea.h b/src/gui/widgets/tabbedarea.h index 0950d740b..3d123f2ec 100644 --- a/src/gui/widgets/tabbedarea.h +++ b/src/gui/widgets/tabbedarea.h @@ -97,7 +97,7 @@ class TabbedArea final : public ActionListener, ~TabbedArea(); - void postInit(); + void postInit() override final; /** * Draw the tabbed area. diff --git a/src/gui/widgets/widget.h b/src/gui/widgets/widget.h index e13e8f791..5868e20aa 100644 --- a/src/gui/widgets/widget.h +++ b/src/gui/widgets/widget.h @@ -1027,6 +1027,9 @@ class Widget notfinal : public Widget2 void windowResized(); + virtual void postInit() + { } + protected: /** * Distributes an action event to all action listeners diff --git a/src/gui/widgets/window.h b/src/gui/widgets/window.h index 1ef0b3793..84931b88d 100644 --- a/src/gui/widgets/window.h +++ b/src/gui/widgets/window.h @@ -289,7 +289,7 @@ class Window notfinal : public BasicContainer2, void setSaveVisible(const bool save) { mSaveVisible = save; } - virtual void postInit() + virtual void postInit() override { mInit = true; } /** |