summaryrefslogtreecommitdiff
path: root/src/gui/widgets/basiccontainer2.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-05-27 18:10:47 +0300
committerAndrei Karas <akaras@inbox.ru>2015-05-27 18:10:47 +0300
commit0dbb4c4ba8044aaf0346706ba735e58b4cfc13f7 (patch)
tree90ed4c8b02892caa8642236e9aed767af42581d4 /src/gui/widgets/basiccontainer2.cpp
parent917d35d6cbea488f07596d0403d0bef8d6413f8a (diff)
downloadManaVerse-0dbb4c4ba8044aaf0346706ba735e58b4cfc13f7.tar.gz
ManaVerse-0dbb4c4ba8044aaf0346706ba735e58b4cfc13f7.tar.bz2
ManaVerse-0dbb4c4ba8044aaf0346706ba735e58b4cfc13f7.tar.xz
ManaVerse-0dbb4c4ba8044aaf0346706ba735e58b4cfc13f7.zip
Improve a bit basiccontainer2.
Diffstat (limited to 'src/gui/widgets/basiccontainer2.cpp')
-rw-r--r--src/gui/widgets/basiccontainer2.cpp38
1 files changed, 12 insertions, 26 deletions
diff --git a/src/gui/widgets/basiccontainer2.cpp b/src/gui/widgets/basiccontainer2.cpp
index 11fca50b3..cc0158d9a 100644
--- a/src/gui/widgets/basiccontainer2.cpp
+++ b/src/gui/widgets/basiccontainer2.cpp
@@ -82,10 +82,11 @@ BasicContainer2::~BasicContainer2()
void BasicContainer2::draw(Graphics* graphics)
{
BLOCK_START("BasicContainer2::draw")
- if (isOpaque())
+ if (mOpaque)
{
- graphics->setColor(getBaseColor());
- graphics->fillRectangle(Rect(0, 0, getWidth(), getHeight()));
+ graphics->setColor(mBaseColor);
+ graphics->fillRectangle(Rect(0, 0,
+ mDimension.width, mDimension.height));
}
drawChildren(graphics);
@@ -97,41 +98,26 @@ void BasicContainer2::safeDraw(Graphics* graphics)
BLOCK_START("BasicContainer2::draw")
if (isOpaque())
{
- graphics->setColor(getBaseColor());
- graphics->fillRectangle(Rect(0, 0, getWidth(), getHeight()));
+ graphics->setColor(mBaseColor);
+ graphics->fillRectangle(Rect(0, 0,
+ mDimension.width, mDimension.height));
}
safeDrawChildren(graphics);
BLOCK_END("BasicContainer2::draw")
}
-void BasicContainer2::setOpaque(bool opaque)
-{
- mOpaque = opaque;
-}
-
-bool BasicContainer2::isOpaque() const
-{
- return mOpaque;
-}
-
void BasicContainer2::add(Widget* widget)
{
+ // +++ need move all add() calls from constructors
+ // and after this method can be deleted
+ // and virtual moved to basiccontainer
BasicContainer::add(widget);
}
-void BasicContainer2::addXY(Widget* widget, int x, int y)
+void BasicContainer2::addXY(Widget* widget,
+ const int x, const int y)
{
widget->setPosition(x, y);
BasicContainer::add(widget);
}
-
-void BasicContainer2::remove(Widget* widget)
-{
- BasicContainer::remove(widget);
-}
-
-void BasicContainer2::clear()
-{
- BasicContainer::clear();
-}