summaryrefslogtreecommitdiff
path: root/src/gui/statuswindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-10-19 23:56:04 +0300
committerAndrei Karas <akaras@inbox.ru>2012-10-20 13:55:42 +0300
commitd59cd9111c1e86b224ea62cc975c49b157e2b3cf (patch)
treed7186479633c0269573e92b5a5213d04b84b3995 /src/gui/statuswindow.cpp
parent71d2b482d84246b8456ea863f94a9a766d33f197 (diff)
downloadmanaplus-d59cd9111c1e86b224ea62cc975c49b157e2b3cf.tar.gz
manaplus-d59cd9111c1e86b224ea62cc975c49b157e2b3cf.tar.bz2
manaplus-d59cd9111c1e86b224ea62cc975c49b157e2b3cf.tar.xz
manaplus-d59cd9111c1e86b224ea62cc975c49b157e2b3cf.zip
Add to some controls palette inheritance from other controls.
Diffstat (limited to 'src/gui/statuswindow.cpp')
-rw-r--r--src/gui/statuswindow.cpp32
1 files changed, 19 insertions, 13 deletions
diff --git a/src/gui/statuswindow.cpp b/src/gui/statuswindow.cpp
index a8f5b8e39..6dd4c29a2 100644
--- a/src/gui/statuswindow.cpp
+++ b/src/gui/statuswindow.cpp
@@ -79,7 +79,8 @@ class AttrDisplay : public Container
}
protected:
- AttrDisplay(const int id, const std::string &name);
+ AttrDisplay(const Widget2 *const widget,
+ const int id, const std::string &name);
const int mId;
const std::string mName;
@@ -92,7 +93,8 @@ class AttrDisplay : public Container
class DerDisplay final : public AttrDisplay
{
public:
- DerDisplay(const int id, const std::string &name);
+ DerDisplay(const Widget2 *const widget,
+ const int id, const std::string &name);
A_DELETE_COPY(DerDisplay)
@@ -103,7 +105,8 @@ class DerDisplay final : public AttrDisplay
class ChangeDisplay final : public AttrDisplay, gcn::ActionListener
{
public:
- ChangeDisplay(const int id, const std::string &name);
+ ChangeDisplay(const Widget2 *const widget,
+ const int id, const std::string &name);
A_DELETE_COPY(ChangeDisplay)
@@ -139,9 +142,9 @@ StatusWindow::StatusWindow() :
mJobLvlLabel(nullptr),
mJobLabel(nullptr),
mJobBar(nullptr),
- mAttrCont(new VertContainer(32)),
+ mAttrCont(new VertContainer(this,32)),
mAttrScroll(new ScrollArea(mAttrCont, false)),
- mDAttrCont(new VertContainer(32)),
+ mDAttrCont(new VertContainer(this, 32)),
mDAttrScroll(new ScrollArea(mDAttrCont, false)),
mCharacterPointsLabel(new Label("C")),
mCorrectionPointsLabel(nullptr),
@@ -441,12 +444,12 @@ void StatusWindow::addAttribute(const int id, const std::string &name,
if (modifiable)
{
- disp = new ChangeDisplay(id, name);
+ disp = new ChangeDisplay(this, id, name);
mAttrCont->add1(disp);
}
else
{
- disp = new DerDisplay(id, name);
+ disp = new DerDisplay(this, id, name);
mDAttrCont->add1(disp);
}
mAttrs[id] = disp;
@@ -748,8 +751,9 @@ void StatusWindow::action(const gcn::ActionEvent &event)
}
}
-AttrDisplay::AttrDisplay(const int id, const std::string &name) :
- Container(),
+AttrDisplay::AttrDisplay(const Widget2 *const widget,
+ const int id, const std::string &name) :
+ Container(widget),
mId(id),
mName(name),
mLayout(new LayoutHelper(this)),
@@ -781,8 +785,9 @@ std::string AttrDisplay::update()
return mName;
}
-DerDisplay::DerDisplay(const int id, const std::string &name) :
- AttrDisplay(id, name)
+DerDisplay::DerDisplay(const Widget2 *const widget,
+ const int id, const std::string &name) :
+ AttrDisplay(widget, id, name)
{
// LayoutHelper h(this);
ContainerPlacer place = mLayout->getPlacer(0, 0);
@@ -793,8 +798,9 @@ DerDisplay::DerDisplay(const int id, const std::string &name) :
update();
}
-ChangeDisplay::ChangeDisplay(const int id, const std::string &name) :
- AttrDisplay(id, name),
+ChangeDisplay::ChangeDisplay(const Widget2 *const widget,
+ const int id, const std::string &name) :
+ AttrDisplay(widget, id, name),
gcn::ActionListener(),
mNeeded(1),
mPoints(new Label(_("Max"))),