diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-10-18 16:13:40 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-10-19 15:12:20 +0300 |
commit | 49965a6282c0f8273ba30ddc48d877334c39bd2a (patch) | |
tree | bb65a6d5394dda9d87a6694876b18fb586427184 | |
parent | 0e316e6ce75b3dca91a824b050410804441f593e (diff) | |
download | plus-49965a6282c0f8273ba30ddc48d877334c39bd2a.tar.gz plus-49965a6282c0f8273ba30ddc48d877334c39bd2a.tar.bz2 plus-49965a6282c0f8273ba30ddc48d877334c39bd2a.tar.xz plus-49965a6282c0f8273ba30ddc48d877334c39bd2a.zip |
move virtual member calls from listbox constuctor into postInit.
-rw-r--r-- | src/gui/widgets/listbox.cpp | 3 | ||||
-rw-r--r-- | src/gui/widgets/listbox.h | 2 | ||||
-rw-r--r-- | src/gui/widgets/popuplist.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/tabs/setup_colors.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/tabs/setup_input.cpp | 1 | ||||
-rw-r--r-- | src/gui/widgets/tabs/setup_video.cpp | 2 | ||||
-rw-r--r-- | src/gui/windows/buydialog.cpp | 1 | ||||
-rw-r--r-- | src/gui/windows/emotewindow.cpp | 2 | ||||
-rw-r--r-- | src/gui/windows/npcdialog.cpp | 1 | ||||
-rw-r--r-- | src/gui/windows/questswindow.cpp | 2 | ||||
-rw-r--r-- | src/gui/windows/selldialog.cpp | 1 | ||||
-rw-r--r-- | src/gui/windows/serverdialog.cpp | 2 | ||||
-rw-r--r-- | src/gui/windows/shopwindow.cpp | 3 | ||||
-rw-r--r-- | src/gui/windows/skilldialog.cpp | 1 | ||||
-rw-r--r-- | src/gui/windows/socialwindow.cpp | 8 | ||||
-rw-r--r-- | src/gui/windows/worldselectdialog.cpp | 1 |
16 files changed, 34 insertions, 0 deletions
diff --git a/src/gui/widgets/listbox.cpp b/src/gui/widgets/listbox.cpp index b6d31c239..ba6b47e22 100644 --- a/src/gui/widgets/listbox.cpp +++ b/src/gui/widgets/listbox.cpp @@ -73,7 +73,10 @@ ListBox::ListBox(const Widget2 *const widget, mRowHeight = font->getHeight() + 2 * mItemPadding; else mRowHeight = 13; +} +void ListBox::postInit() +{ adjustSize(); } diff --git a/src/gui/widgets/listbox.h b/src/gui/widgets/listbox.h index fa5906077..3f4637e73 100644 --- a/src/gui/widgets/listbox.h +++ b/src/gui/widgets/listbox.h @@ -53,6 +53,8 @@ class ListBox : public gcn::ListBox, virtual ~ListBox(); + void postInit(); + /** * Draws the list box. */ diff --git a/src/gui/widgets/popuplist.cpp b/src/gui/widgets/popuplist.cpp index 5fd38a785..346539348 100644 --- a/src/gui/widgets/popuplist.cpp +++ b/src/gui/widgets/popuplist.cpp @@ -42,6 +42,8 @@ PopupList::PopupList(DropDown *const widget, mPressedIndex(-2), mModal(modal) { + mListBox->postInit(); + setFocusable(true); mListBox->setDistributeMousePressed(true); diff --git a/src/gui/widgets/tabs/setup_colors.cpp b/src/gui/widgets/tabs/setup_colors.cpp index c29da4a8a..db4b2faae 100644 --- a/src/gui/widgets/tabs/setup_colors.cpp +++ b/src/gui/widgets/tabs/setup_colors.cpp @@ -77,6 +77,8 @@ Setup_Colors::Setup_Colors(const Widget2 *const widget) : mBlueSlider(new Slider(0, 255)), mBlueText(new TextField(this)) { + mColorBox->postInit(); + // TRANSLATORS: settings colors tab name setName(_("Colors")); mColorBox->addSelectionListener(this); diff --git a/src/gui/widgets/tabs/setup_input.cpp b/src/gui/widgets/tabs/setup_input.cpp index 35fa4204a..3d4203244 100644 --- a/src/gui/widgets/tabs/setup_input.cpp +++ b/src/gui/widgets/tabs/setup_input.cpp @@ -107,6 +107,7 @@ Setup_Input::Setup_Input(const Widget2 *const widget) : mKeySetting(false), mActionDataSize(new int [9]) { + mKeyList->postInit(); inputManager.setSetupInput(this); // TRANSLATORS: setting tab name setName(_("Input")); diff --git a/src/gui/widgets/tabs/setup_video.cpp b/src/gui/widgets/tabs/setup_video.cpp index bd53763cc..647274125 100644 --- a/src/gui/widgets/tabs/setup_video.cpp +++ b/src/gui/widgets/tabs/setup_video.cpp @@ -215,6 +215,8 @@ Setup_Video::Setup_Video(const Widget2 *const widget) : // TRANSLATORS: video settings checkbox mNoFrameCheckBox(new CheckBox(this, _("No frame"), mNoFrame)) { + mModeList->postInit(); + // TRANSLATORS: video settings tab name setName(_("Video")); diff --git a/src/gui/windows/buydialog.cpp b/src/gui/windows/buydialog.cpp index b7e49ab3f..dcd94be81 100644 --- a/src/gui/windows/buydialog.cpp +++ b/src/gui/windows/buydialog.cpp @@ -239,6 +239,7 @@ void BuyDialog::init() mShopItems = new ShopItems; mShopItemList = new ShopListBox(this, mShopItems, mShopItems); + mShopItemList->postInit(); mScrollArea = new ScrollArea(mShopItemList, getOptionBool("showbackground"), "buy_background.xml"); mScrollArea->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER); diff --git a/src/gui/windows/emotewindow.cpp b/src/gui/windows/emotewindow.cpp index 405aff746..c9f5f927c 100644 --- a/src/gui/windows/emotewindow.cpp +++ b/src/gui/windows/emotewindow.cpp @@ -57,6 +57,8 @@ EmoteWindow::EmoteWindow() : mScrollFontPage(new ScrollArea(mFontPage, false, "fontpage.xml")), mImageSet(Theme::getImageSetFromThemeXml("emotetabs.xml", "", 17, 16)) { + mColorPage->postInit(); + mFontPage->postInit(); setShowTitle(false); setResizable(true); diff --git a/src/gui/windows/npcdialog.cpp b/src/gui/windows/npcdialog.cpp index 4f3d851c2..ba8754482 100644 --- a/src/gui/windows/npcdialog.cpp +++ b/src/gui/windows/npcdialog.cpp @@ -126,6 +126,7 @@ NpcDialog::NpcDialog(const int npcId) : mShowAvatar(false), mLogInteraction(config.getBoolValue("logNpcInGui")) { + mItemList->postInit(); // Basic Window Setup setWindowName("NpcText"); setResizable(true); diff --git a/src/gui/windows/questswindow.cpp b/src/gui/windows/questswindow.cpp index 7ac9a1efb..ce0c1a796 100644 --- a/src/gui/windows/questswindow.cpp +++ b/src/gui/windows/questswindow.cpp @@ -144,6 +144,8 @@ QuestsWindow::QuestsWindow() : mCompleteQuestEffectId(paths.getIntValue("completeQuestEffectId")), mMap(nullptr) { + mQuestsListBox->postInit(); + setWindowName("Quests"); setResizable(true); setCloseButton(true); diff --git a/src/gui/windows/selldialog.cpp b/src/gui/windows/selldialog.cpp index a188861f0..5cca9892f 100644 --- a/src/gui/windows/selldialog.cpp +++ b/src/gui/windows/selldialog.cpp @@ -84,6 +84,7 @@ void SellDialog::init() mShopItems = new ShopItems(true); mShopItemList = new ShopListBox(this, mShopItems, mShopItems); + mShopItemList->postInit(); mShopItemList->setProtectItems(true); mScrollArea = new ScrollArea(mShopItemList, getOptionBool("showbackground"), "sell_background.xml"); diff --git a/src/gui/windows/serverdialog.cpp b/src/gui/windows/serverdialog.cpp index 3b0f9e6c9..d1ec6f0df 100644 --- a/src/gui/windows/serverdialog.cpp +++ b/src/gui/windows/serverdialog.cpp @@ -272,6 +272,8 @@ ServerDialog::ServerDialog(ServerInfo *const serverInfo, mServerInfo(serverInfo), mPersistentIPCheckBox(nullptr) { + mServersList->postInit(); + if (isSafeMode) { // TRANSLATORS: servers dialog name diff --git a/src/gui/windows/shopwindow.cpp b/src/gui/windows/shopwindow.cpp index 18ad32470..97edec99d 100644 --- a/src/gui/windows/shopwindow.cpp +++ b/src/gui/windows/shopwindow.cpp @@ -115,6 +115,9 @@ ShopWindow::ShopWindow(): mTradeNick(""), mTradeMoney(0) { + mBuyShopItemList->postInit(); + mSellShopItemList->postInit(); + setWindowName("Personal Shop"); setResizable(true); setCloseButton(true); diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp index 2eb1bbdaa..ffc76ae81 100644 --- a/src/gui/windows/skilldialog.cpp +++ b/src/gui/windows/skilldialog.cpp @@ -469,6 +469,7 @@ void SkillDialog::loadSkills() model->updateVisibilities(); listbox = new SkillListBox(this, model); + listbox->postInit(); listbox->setActionEventId("sel"); listbox->addActionListener(this); scroll = new ScrollArea(listbox, false); diff --git a/src/gui/windows/socialwindow.cpp b/src/gui/windows/socialwindow.cpp index e54d0bf55..74b01ef27 100644 --- a/src/gui/windows/socialwindow.cpp +++ b/src/gui/windows/socialwindow.cpp @@ -189,6 +189,7 @@ public: &getThemeColor(Theme::GUILD_SOCIAL_TAB_SELECTED_OUTLINE)); mList = new AvatarListBox(this, guild); + mList->postInit(); mScroll = new ScrollArea(mList, showBackground, "social_background.xml"); @@ -322,6 +323,7 @@ public: &getThemeColor(Theme::GUILD_SOCIAL_TAB_SELECTED_OUTLINE)); mList = new AvatarListBox(this, guild); + mList->postInit(); mScroll = new ScrollArea(mList, showBackground, "social_background.xml"); @@ -389,6 +391,7 @@ public: &getThemeColor(Theme::PARTY_SOCIAL_TAB_SELECTED_OUTLINE)); mList = new AvatarListBox(this, party); + mList->postInit(); mScroll = new ScrollArea(mList, showBackground, "social_background.xml"); @@ -537,6 +540,7 @@ public: mBeings(new BeingsListModal) { mList = new AvatarListBox(this, mBeings); + mList->postInit(); mScroll = new ScrollArea(mList, showBackground, "social_background.xml"); @@ -702,6 +706,7 @@ public: mBeings(new BeingsListModal) { mList = new AvatarListBox(this, mBeings); + mList->postInit(); mScroll = new ScrollArea(mList, showBackground, "social_background.xml"); @@ -1030,6 +1035,7 @@ public: mBeings(new BeingsListModal) { mList = new AvatarListBox(this, mBeings); + mList->postInit(); mScroll = new ScrollArea(mList, showBackground, "social_background.xml"); @@ -1076,6 +1082,7 @@ public: mBeings(new BeingsListModal) { mList = new AvatarListBox(this, mBeings); + mList->postInit(); mScroll = new ScrollArea(mList, showBackground, "social_background.xml"); @@ -1121,6 +1128,7 @@ public: mBeings(new BeingsListModal) { mList = new AvatarListBox(this, mBeings); + mList->postInit(); mScroll = new ScrollArea(mList, showBackground, "social_background.xml"); diff --git a/src/gui/windows/worldselectdialog.cpp b/src/gui/windows/worldselectdialog.cpp index bd46df9a1..3d9581164 100644 --- a/src/gui/windows/worldselectdialog.cpp +++ b/src/gui/windows/worldselectdialog.cpp @@ -91,6 +91,7 @@ WorldSelectDialog::WorldSelectDialog(Worlds worlds): // TRANSLATORS: world dialog button mChooseWorld(new Button(this, _("Choose World"), "world", this)) { + mWorldList->postInit(); ScrollArea *const worldsScroll = new ScrollArea(mWorldList, getOptionBool("showbackground"), "world_background.xml"); |