summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-10-19 12:50:59 +0300
committerAndrei Karas <akaras@inbox.ru>2013-10-19 15:12:22 +0300
commite4d34f9e3f5b2068be1a8137c75a571e9da42cda (patch)
tree97d0e13dd2f163e9ce91576b29eec8563899097c /src
parentecc414fed44c8b0ee63c0acf188a109e3867a815 (diff)
downloadmv-e4d34f9e3f5b2068be1a8137c75a571e9da42cda.tar.gz
mv-e4d34f9e3f5b2068be1a8137c75a571e9da42cda.tar.bz2
mv-e4d34f9e3f5b2068be1a8137c75a571e9da42cda.tar.xz
mv-e4d34f9e3f5b2068be1a8137c75a571e9da42cda.zip
move virtual member calls from textpopup constructor into postInit.
Diffstat (limited to 'src')
-rw-r--r--src/gui/popups/textpopup.cpp4
-rw-r--r--src/gui/popups/textpopup.h2
-rw-r--r--src/gui/viewport.cpp1
-rw-r--r--src/gui/widgets/characterdisplay.cpp2
-rw-r--r--src/gui/widgets/emoteshortcutcontainer.cpp2
-rw-r--r--src/gui/windowmenu.cpp1
-rw-r--r--src/gui/windows/inventorywindow.cpp2
-rw-r--r--src/gui/windows/minimap.cpp2
-rw-r--r--src/gui/windows/ministatuswindow.cpp2
-rw-r--r--src/gui/windows/skilldialog.cpp2
10 files changed, 20 insertions, 0 deletions
diff --git a/src/gui/popups/textpopup.cpp b/src/gui/popups/textpopup.cpp
index 2b89e388b..73f5fbad0 100644
--- a/src/gui/popups/textpopup.cpp
+++ b/src/gui/popups/textpopup.cpp
@@ -33,6 +33,10 @@ TextPopup::TextPopup():
Popup("TextPopup", "textpopup.xml"),
mText()
{
+}
+
+void TextPopup::postInit()
+{
const int fontHeight = getFont()->getHeight();
int y = 0;
for (int f = 0; f < TEXTPOPUPCOUNT; f ++)
diff --git a/src/gui/popups/textpopup.h b/src/gui/popups/textpopup.h
index b165c2f25..d57b17faf 100644
--- a/src/gui/popups/textpopup.h
+++ b/src/gui/popups/textpopup.h
@@ -48,6 +48,8 @@ class TextPopup final : public Popup
*/
~TextPopup();
+ void postInit() override;
+
/**
* Sets the text to be displayed.
*/
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index e82b0f546..aa839fc20 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -80,6 +80,7 @@ Viewport::Viewport() :
{
mBeingPopup->postInit();
mPopupMenu->postInit();
+ mTextPopup->postInit();
setOpaque(false);
addMouseListener(this);
diff --git a/src/gui/widgets/characterdisplay.cpp b/src/gui/widgets/characterdisplay.cpp
index 9d409a6bb..fb2ec9e2f 100644
--- a/src/gui/widgets/characterdisplay.cpp
+++ b/src/gui/widgets/characterdisplay.cpp
@@ -47,6 +47,8 @@ CharacterDisplay::CharacterDisplay(const Widget2 *const widget,
mName(new Label(this, "wwwwwwwwwwwwwwwwwwwwwwww")),
mPopup(new TextPopup)
{
+ mPopup->postInit();
+
mPlayerBox->setActionEventId("select");
mPlayerBox->addActionListener(charSelectDialog);
setActionEventId("use");
diff --git a/src/gui/widgets/emoteshortcutcontainer.cpp b/src/gui/widgets/emoteshortcutcontainer.cpp
index 8ce8fad17..5e2666fd8 100644
--- a/src/gui/widgets/emoteshortcutcontainer.cpp
+++ b/src/gui/widgets/emoteshortcutcontainer.cpp
@@ -46,6 +46,8 @@ EmoteShortcutContainer::EmoteShortcutContainer():
mEmoteClicked(false),
mEmoteMoved(0)
{
+ mEmotePopup->postInit();
+
addMouseListener(this);
addWidgetListener(this);
diff --git a/src/gui/windowmenu.cpp b/src/gui/windowmenu.cpp
index 99f4b4ca5..1aefdaa73 100644
--- a/src/gui/windowmenu.cpp
+++ b/src/gui/windowmenu.cpp
@@ -59,6 +59,7 @@ WindowMenu::WindowMenu(const Widget2 *const widget) :
mAutoHide(1),
mSmallWindow(mainGraphics->getWidth() < 600)
{
+ mTextPopup->postInit();
int x = mPadding;
int h = 0;
diff --git a/src/gui/windows/inventorywindow.cpp b/src/gui/windows/inventorywindow.cpp
index 4be320617..bc803d0d3 100644
--- a/src/gui/windows/inventorywindow.cpp
+++ b/src/gui/windows/inventorywindow.cpp
@@ -130,6 +130,8 @@ InventoryWindow::InventoryWindow(Inventory *const inventory):
mSplit(false),
mCompactMode(false)
{
+ mTextPopup->postInit();
+
if (inventory)
{
setCaption(gettext(inventory->getName().c_str()));
diff --git a/src/gui/windows/minimap.cpp b/src/gui/windows/minimap.cpp
index a02e02f5d..d268addf6 100644
--- a/src/gui/windows/minimap.cpp
+++ b/src/gui/windows/minimap.cpp
@@ -58,6 +58,8 @@ Minimap::Minimap() :
mCustomMapImage(false),
mAutoResize(config.getBoolValue("autoresizeminimaps"))
{
+ mTextPopup->postInit();
+
setWindowName("Minimap");
mShow = config.getValueBool(getWindowName() + "Show", true);
diff --git a/src/gui/windows/ministatuswindow.cpp b/src/gui/windows/ministatuswindow.cpp
index fe56a1f59..cc666f614 100644
--- a/src/gui/windows/ministatuswindow.cpp
+++ b/src/gui/windows/ministatuswindow.cpp
@@ -91,7 +91,9 @@ MiniStatusWindow::MiniStatusWindow() :
mTextPopup(new TextPopup),
mStatusPopup(new StatusPopup)
{
+ mTextPopup->postInit();
mStatusPopup->postInit();
+
listen(CHANNEL_ATTRIBUTES);
StatusWindow::updateHPBar(mHpBar);
diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp
index e379ea425..74fb4faf5 100644
--- a/src/gui/windows/skilldialog.cpp
+++ b/src/gui/windows/skilldialog.cpp
@@ -70,6 +70,8 @@ class SkillListBox final : public ListBox
mRowHeight(getFont()->getHeight() * 2 + mSpacing + 2 * mPadding),
mSkillClicked(false)
{
+ mPopup->postInit();
+
if (mRowHeight < 34)
mRowHeight = 34;
}