diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-02-18 00:45:23 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-02-18 00:45:23 +0300 |
commit | 14a0a04b2bb3928f7429fd748dd40e1843fca571 (patch) | |
tree | 28f772d80afd66838b0123efeac005f445a39bce /src | |
parent | 1d71d02a40dc1f4c50572bf0681bbc2907a3c361 (diff) | |
download | plus-14a0a04b2bb3928f7429fd748dd40e1843fca571.tar.gz plus-14a0a04b2bb3928f7429fd748dd40e1843fca571.tar.bz2 plus-14a0a04b2bb3928f7429fd748dd40e1843fca571.tar.xz plus-14a0a04b2bb3928f7429fd748dd40e1843fca571.zip |
Remove default constructor from Widget2.
Diffstat (limited to 'src')
31 files changed, 88 insertions, 65 deletions
diff --git a/src/game.cpp b/src/game.cpp index 26807b8b6..e0957b57d 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -236,7 +236,7 @@ static void createGuiWindows() for (unsigned f = 0; f < SHORTCUT_TABS; f ++) { itemShortcutWindow->addTab(toString(f + 1), - new ItemShortcutContainer(f)); + new ItemShortcutContainer(nullptr, f)); } if (config.getBoolValue("showDidYouKnow")) { @@ -245,20 +245,23 @@ static void createGuiWindows() } emoteShortcutWindow = new ShortcutWindow("EmoteShortcut", - new EmoteShortcutContainer, "emotes.xml", 130, 480); + new EmoteShortcutContainer(nullptr), + "emotes.xml", + 130, 480); outfitWindow = new OutfitWindow(); #ifdef MANASERV_SUPPORT specialsWindow = new SpecialsWindow(); #endif dropShortcutWindow = new ShortcutWindow("DropShortcut", - new DropShortcutContainer, "drops.xml"); + new DropShortcutContainer(nullptr), + "drops.xml"); spellShortcutWindow = new ShortcutWindow("SpellShortcut", "spells.xml", 265, 328); for (unsigned f = 0; f < SPELL_SHORTCUT_TABS; f ++) { spellShortcutWindow->addTab(toString(f + 1), - new SpellShortcutContainer(f)); + new SpellShortcutContainer(nullptr, f)); } botCheckerWindow = new BotCheckerWindow; diff --git a/src/gui/widgets/dropshortcutcontainer.cpp b/src/gui/widgets/dropshortcutcontainer.cpp index bca1f1e12..fcb0f8ea1 100644 --- a/src/gui/widgets/dropshortcutcontainer.cpp +++ b/src/gui/widgets/dropshortcutcontainer.cpp @@ -40,8 +40,8 @@ #include "debug.h" -DropShortcutContainer::DropShortcutContainer(): - ShortcutContainer(), +DropShortcutContainer::DropShortcutContainer(Widget2 *const widget): + ShortcutContainer(widget), mItemClicked(false), mItemPopup(new ItemPopup), mEquipedColor(getThemeColor(Theme::ITEM_EQUIPPED)), diff --git a/src/gui/widgets/dropshortcutcontainer.h b/src/gui/widgets/dropshortcutcontainer.h index 9880f526d..dbaac1d9c 100644 --- a/src/gui/widgets/dropshortcutcontainer.h +++ b/src/gui/widgets/dropshortcutcontainer.h @@ -38,7 +38,7 @@ class DropShortcutContainer final : public ShortcutContainer /** * Constructor. Initializes the graphic. */ - DropShortcutContainer(); + DropShortcutContainer(Widget2 *const widget); A_DELETE_COPY(DropShortcutContainer) diff --git a/src/gui/widgets/emoteshortcutcontainer.cpp b/src/gui/widgets/emoteshortcutcontainer.cpp index f5d1c19f0..47c45c2dd 100644 --- a/src/gui/widgets/emoteshortcutcontainer.cpp +++ b/src/gui/widgets/emoteshortcutcontainer.cpp @@ -38,8 +38,8 @@ static const int MAX_ITEMS = 48; -EmoteShortcutContainer::EmoteShortcutContainer(): - ShortcutContainer(), +EmoteShortcutContainer::EmoteShortcutContainer(Widget2 *const widget) : + ShortcutContainer(widget), mEmoteImg(), mEmotePopup(new TextPopup), mEmoteClicked(false), diff --git a/src/gui/widgets/emoteshortcutcontainer.h b/src/gui/widgets/emoteshortcutcontainer.h index ed6b4c8b3..ec0e98675 100644 --- a/src/gui/widgets/emoteshortcutcontainer.h +++ b/src/gui/widgets/emoteshortcutcontainer.h @@ -41,7 +41,7 @@ class EmoteShortcutContainer final : public ShortcutContainer /** * Constructor. Initializes the graphic. */ - EmoteShortcutContainer(); + EmoteShortcutContainer(Widget2 *const widget); A_DELETE_COPY(EmoteShortcutContainer) diff --git a/src/gui/widgets/itemshortcutcontainer.cpp b/src/gui/widgets/itemshortcutcontainer.cpp index 2496beaa6..83c8820ae 100644 --- a/src/gui/widgets/itemshortcutcontainer.cpp +++ b/src/gui/widgets/itemshortcutcontainer.cpp @@ -48,8 +48,9 @@ #include "debug.h" -ItemShortcutContainer::ItemShortcutContainer(const unsigned number) : - ShortcutContainer(), +ItemShortcutContainer::ItemShortcutContainer(Widget2 *const widget, + const unsigned number) : + ShortcutContainer(widget), mItemClicked(false), mNumber(number), mItemPopup(new ItemPopup), diff --git a/src/gui/widgets/itemshortcutcontainer.h b/src/gui/widgets/itemshortcutcontainer.h index f01c2779c..dd95851a6 100644 --- a/src/gui/widgets/itemshortcutcontainer.h +++ b/src/gui/widgets/itemshortcutcontainer.h @@ -39,7 +39,8 @@ class ItemShortcutContainer final : public ShortcutContainer /** * Constructor. Initializes the graphic. */ - explicit ItemShortcutContainer(const unsigned number); + ItemShortcutContainer(Widget2 *const widget, + const unsigned number); A_DELETE_COPY(ItemShortcutContainer) diff --git a/src/gui/widgets/playerbox.cpp b/src/gui/widgets/playerbox.cpp index 3bcb8476e..97fd4a713 100644 --- a/src/gui/widgets/playerbox.cpp +++ b/src/gui/widgets/playerbox.cpp @@ -30,9 +30,11 @@ #include "debug.h" -PlayerBox::PlayerBox(Being *const being, const std::string &skin, +PlayerBox::PlayerBox(Widget2 *const widget, + Being *const being, + const std::string &skin, const std::string &selectedSkin) : - Widget2(), + Widget2(widget), ScrollArea(), mBeing(being), mAlpha(1.0), @@ -48,8 +50,10 @@ PlayerBox::PlayerBox(Being *const being, const std::string &skin, init(skin, selectedSkin); } -PlayerBox::PlayerBox(const std::string &skin, +PlayerBox::PlayerBox(Widget2 *const widget, + const std::string &skin, const std::string &selectedSkin) : + Widget2(widget), ScrollArea(), mBeing(nullptr), mAlpha(1.0), diff --git a/src/gui/widgets/playerbox.h b/src/gui/widgets/playerbox.h index 30d79ff2f..3669a23a9 100644 --- a/src/gui/widgets/playerbox.h +++ b/src/gui/widgets/playerbox.h @@ -45,10 +45,13 @@ class PlayerBox final : public Widget2, * Constructor. Takes the initial player character that this box should * display, which defaults to <code>NULL</code>. */ - explicit PlayerBox(Being *const being, const std::string &skin = "", + explicit PlayerBox(Widget2 *const widget, + Being *const being, + const std::string &skin = "", const std::string &selectedSkin = ""); - explicit PlayerBox(const std::string &skin = "", + explicit PlayerBox(Widget2 *const widget, + const std::string &skin = "", const std::string &selectedSkin = ""); A_DELETE_COPY(PlayerBox) diff --git a/src/gui/widgets/progressindicator.cpp b/src/gui/widgets/progressindicator.cpp index b3f5b0e54..198094b6d 100644 --- a/src/gui/widgets/progressindicator.cpp +++ b/src/gui/widgets/progressindicator.cpp @@ -28,9 +28,9 @@ #include "debug.h" -ProgressIndicator::ProgressIndicator() : +ProgressIndicator::ProgressIndicator(Widget2 *const widget) : gcn::Widget(), - Widget2(), + Widget2(widget), mIndicator(nullptr) { ImageSet *const images = Theme::getImageSetFromTheme( diff --git a/src/gui/widgets/progressindicator.h b/src/gui/widgets/progressindicator.h index 8dd33bf4d..7357931e9 100644 --- a/src/gui/widgets/progressindicator.h +++ b/src/gui/widgets/progressindicator.h @@ -38,7 +38,7 @@ class ProgressIndicator final : public gcn::Widget, public Widget2 { public: - ProgressIndicator(); + ProgressIndicator(Widget2 *const widget); A_DELETE_COPY(ProgressIndicator) diff --git a/src/gui/widgets/scrollarea.cpp b/src/gui/widgets/scrollarea.cpp index 0ee2c3357..708949f9c 100644 --- a/src/gui/widgets/scrollarea.cpp +++ b/src/gui/widgets/scrollarea.cpp @@ -45,8 +45,11 @@ static std::string const buttonFiles[2] = "scrollbuttons_pressed.xml" }; -ScrollArea::ScrollArea(const bool opaque, const std::string &skin) : +ScrollArea::ScrollArea(Widget2 *const widget, + const bool opaque, + const std::string &skin) : gcn::ScrollArea(), + Widget2(widget), WidgetListener(), mX(0), mY(0), @@ -66,9 +69,12 @@ ScrollArea::ScrollArea(const bool opaque, const std::string &skin) : init(skin); } -ScrollArea::ScrollArea(gcn::Widget *const widget, const bool opaque, +ScrollArea::ScrollArea(Widget2 *const widget2, + gcn::Widget *const widget, + const bool opaque, const std::string &skin) : gcn::ScrollArea(widget), + Widget2(widget2), WidgetListener(), mX(0), mY(0), diff --git a/src/gui/widgets/scrollarea.h b/src/gui/widgets/scrollarea.h index 3f6195271..bc25baa27 100644 --- a/src/gui/widgets/scrollarea.h +++ b/src/gui/widgets/scrollarea.h @@ -52,7 +52,8 @@ class ScrollArea final : public gcn::ScrollArea, * Constructor that takes no content. Needed for use with the DropDown * class. */ - explicit ScrollArea(const bool opaque = true, + explicit ScrollArea(Widget2 *const widget, + const bool opaque = true, const std::string &skin = ""); /** @@ -60,7 +61,8 @@ class ScrollArea final : public gcn::ScrollArea, * * @param content the initial content to show in the scroll area */ - explicit ScrollArea(gcn::Widget *const widget, + explicit ScrollArea(Widget2 *const widget2, + gcn::Widget *const widget, const bool opaque = true, const std::string &skin = ""); diff --git a/src/gui/widgets/setupitem.cpp b/src/gui/widgets/setupitem.cpp index aeeb8e4bc..649388d04 100644 --- a/src/gui/widgets/setupitem.cpp +++ b/src/gui/widgets/setupitem.cpp @@ -50,7 +50,7 @@ SetupItem::SetupItem(const std::string &restrict text, const std::string &restrict eventName, const bool mainConfig) : ActionListener(), - Widget2(), + Widget2(parent), mText(text), mDescription(description), mKeyName(keyName), @@ -74,7 +74,7 @@ SetupItem::SetupItem(const std::string &restrict text, const std::string &restrict def, const bool mainConfig) : ActionListener(), - Widget2(), + Widget2(parent), mText(text), mDescription(description), mKeyName(keyName), @@ -762,7 +762,7 @@ void SetupItemSlider::createControls() mHorizont = new HorizontContainer(this, 32, 2); mLabel = new Label(this, mText); - mSlider = new Slider(mMin, mMax); + mSlider = new Slider(this, mMin, mMax); mSlider->setActionEventId(mEventName); mSlider->addActionListener(mParent); mSlider->setValue2(atof(mValue.c_str())); @@ -886,7 +886,7 @@ void SetupItemSlider2::createControls() mLabel = new Label(this, mText); mLabel2 = new Label(this, ""); mLabel2->setWidth(width); - mSlider = new Slider(mMin, mMax); + mSlider = new Slider(this, mMin, mMax); mSlider->setActionEventId(mEventName); mSlider->addActionListener(mParent); mSlider->setValue2(atof(mValue.c_str())); diff --git a/src/gui/widgets/shortcutcontainer.cpp b/src/gui/widgets/shortcutcontainer.cpp index 767a32974..866dde6f1 100644 --- a/src/gui/widgets/shortcutcontainer.cpp +++ b/src/gui/widgets/shortcutcontainer.cpp @@ -28,9 +28,9 @@ float ShortcutContainer::mAlpha = 1.0; -ShortcutContainer::ShortcutContainer() : +ShortcutContainer::ShortcutContainer(Widget2 *const widget) : gcn::Widget(), - Widget2(), + Widget2(widget), WidgetListener(), MouseListener(), mBackgroundImg(nullptr), diff --git a/src/gui/widgets/shortcutcontainer.h b/src/gui/widgets/shortcutcontainer.h index e7ec2ff62..8df401775 100644 --- a/src/gui/widgets/shortcutcontainer.h +++ b/src/gui/widgets/shortcutcontainer.h @@ -102,7 +102,7 @@ class ShortcutContainer : public gcn::Widget, /** * Constructor. Initializes the shortcut container. */ - explicit ShortcutContainer(); + explicit ShortcutContainer(Widget2 *const widget); /** * Gets the index from the grid provided the point is in an item box. diff --git a/src/gui/widgets/slider.cpp b/src/gui/widgets/slider.cpp index 02ebc2ccb..c5988ff54 100644 --- a/src/gui/widgets/slider.cpp +++ b/src/gui/widgets/slider.cpp @@ -43,9 +43,10 @@ static std::string const data[2] = "slider_highlighted.xml" }; -Slider::Slider(const double scaleEnd) : +Slider::Slider(Widget2 *const widget, + const double scaleEnd) : gcn::Slider(scaleEnd), - Widget2(), + Widget2(widget), mVertexes(new ImageCollection), mHasMouse(false), mRedraw(true) @@ -53,9 +54,11 @@ Slider::Slider(const double scaleEnd) : init(); } -Slider::Slider(const double scaleStart, const double scaleEnd) : +Slider::Slider(Widget2 *const widget, + const double scaleStart, + const double scaleEnd) : gcn::Slider(scaleStart, scaleEnd), - Widget2(), + Widget2(widget), mVertexes(new ImageCollection), mHasMouse(false), mRedraw(true) diff --git a/src/gui/widgets/slider.h b/src/gui/widgets/slider.h index 2d4853539..27b03976d 100644 --- a/src/gui/widgets/slider.h +++ b/src/gui/widgets/slider.h @@ -43,12 +43,15 @@ class Slider final : public gcn::Slider, /** * Constructor with scale start equal to 0. */ - explicit Slider(const double scaleEnd = 1.0); + explicit Slider(Widget2 *const widget, + const double scaleEnd = 1.0); /** * Constructor. */ - Slider(const double scaleStart, const double scaleEnd); + Slider(Widget2 *const widget, + const double scaleStart, + const double scaleEnd); A_DELETE_COPY(Slider) diff --git a/src/gui/widgets/spellshortcutcontainer.cpp b/src/gui/widgets/spellshortcutcontainer.cpp index e8d34c9d8..5441c4d8a 100644 --- a/src/gui/widgets/spellshortcutcontainer.cpp +++ b/src/gui/widgets/spellshortcutcontainer.cpp @@ -39,8 +39,9 @@ #include "debug.h" -SpellShortcutContainer::SpellShortcutContainer(const unsigned number) : - ShortcutContainer(), +SpellShortcutContainer::SpellShortcutContainer(Widget2 *const widget, + const unsigned number) : + ShortcutContainer(widget), mSpellPopup(new SpellPopup), mNumber(number), mSpellClicked(false) diff --git a/src/gui/widgets/spellshortcutcontainer.h b/src/gui/widgets/spellshortcutcontainer.h index d8f5d22b4..afff6dcf9 100644 --- a/src/gui/widgets/spellshortcutcontainer.h +++ b/src/gui/widgets/spellshortcutcontainer.h @@ -38,7 +38,8 @@ class SpellShortcutContainer final : public ShortcutContainer /** * Constructor. Initializes the graphic. */ - explicit SpellShortcutContainer(const unsigned number); + explicit SpellShortcutContainer(Widget2 *const widget, + const unsigned number); A_DELETE_COPY(SpellShortcutContainer) diff --git a/src/gui/widgets/tabs/setup_colors.cpp b/src/gui/widgets/tabs/setup_colors.cpp index d29c56c85..8ea9d5fbb 100644 --- a/src/gui/widgets/tabs/setup_colors.cpp +++ b/src/gui/widgets/tabs/setup_colors.cpp @@ -58,23 +58,23 @@ Setup_Colors::Setup_Colors(const Widget2 *const widget) : mSelected(-1), // TRANSLATORS: colors tab. label. mGradTypeLabel(new Label(this, _("Type:"))), - mGradTypeSlider(new Slider(0, 3)), + mGradTypeSlider(new Slider(this, 0, 3)), mGradTypeText(new Label(this)), // TRANSLATORS: colors tab. label. mGradDelayLabel(new Label(this, _("Delay:"))), - mGradDelaySlider(new Slider(20, 100)), + mGradDelaySlider(new Slider(this, 20, 100)), mGradDelayText(new TextField(this)), // TRANSLATORS: colors tab. label. mRedLabel(new Label(this, _("Red:"))), - mRedSlider(new Slider(0, 255)), + mRedSlider(new Slider(this, 0, 255)), mRedText(new TextField(this)), // TRANSLATORS: colors tab. label. mGreenLabel(new Label(this, _("Green:"))), - mGreenSlider(new Slider(0, 255)), + mGreenSlider(new Slider(this, 0, 255)), mGreenText(new TextField(this)), // TRANSLATORS: colors tab. label. mBlueLabel(new Label(this, _("Blue:"))), - mBlueSlider(new Slider(0, 255)), + mBlueSlider(new Slider(this, 0, 255)), mBlueText(new TextField(this)) { mColorBox->postInit(); diff --git a/src/gui/widgets/tabs/setup_video.cpp b/src/gui/widgets/tabs/setup_video.cpp index 589b08e5e..be00937f2 100644 --- a/src/gui/widgets/tabs/setup_video.cpp +++ b/src/gui/widgets/tabs/setup_video.cpp @@ -191,9 +191,9 @@ Setup_Video::Setup_Video(const Widget2 *const widget) : mOpenGLDropDown(new DropDown(widget, mOpenGLListModel)), // TRANSLATORS: video settings checkbox mFpsCheckBox(new CheckBox(this, _("FPS limit:"))), - mFpsSlider(new Slider(2, 160)), + mFpsSlider(new Slider(this, 2, 160)), mFpsLabel(new Label(this)), - mAltFpsSlider(new Slider(2, 160)), + mAltFpsSlider(new Slider(this, 2, 160)), // TRANSLATORS: video settings label mAltFpsLabel(new Label(this, _("Alt FPS limit: "))), #if !defined(ANDROID) && !defined(__APPLE__) diff --git a/src/gui/widgets/widget2.h b/src/gui/widgets/widget2.h index f6e94556a..a57ccbb41 100644 --- a/src/gui/widgets/widget2.h +++ b/src/gui/widgets/widget2.h @@ -78,12 +78,6 @@ class Widget2 } protected: - Widget2() : - mPaletteOffset(0), - mForegroundColor2() - { - } - explicit Widget2(const Widget2 *const widget) : mPaletteOffset(widget ? widget->mPaletteOffset : 0), mForegroundColor2() diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp index 2ea86f9df..82c2d91f8 100644 --- a/src/gui/widgets/window.cpp +++ b/src/gui/widgets/window.cpp @@ -49,7 +49,7 @@ int Window::mouseResize = 0; Window::Window(const std::string &caption, const bool modal, Window *const parent, std::string skin) : gcn::Window(caption), - Widget2(), + Widget2(nullptr), WidgetListener(), mSkin(nullptr), mDefaultX(0), diff --git a/src/gui/windows/buydialog.cpp b/src/gui/windows/buydialog.cpp index 19a46b9b8..4d2acfac9 100644 --- a/src/gui/windows/buydialog.cpp +++ b/src/gui/windows/buydialog.cpp @@ -244,7 +244,7 @@ void BuyDialog::init() getOptionBool("showbackground"), "buy_background.xml"); mScrollArea->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER); - mSlider = new Slider(1.0); + mSlider = new Slider(this, 1.0); mQuantityLabel = new Label(this, strprintf( "%d / %d", mAmountItems, mMaxItems)); mQuantityLabel->setAlignment(Graphics::CENTER); diff --git a/src/gui/windows/charcreatedialog.cpp b/src/gui/windows/charcreatedialog.cpp index a3fdcde3a..d6b572d40 100644 --- a/src/gui/windows/charcreatedialog.cpp +++ b/src/gui/windows/charcreatedialog.cpp @@ -124,7 +124,7 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *const parent, mMaxLook(CharDB::getMaxLook()), mPlayer(new Being(0, ActorSprite::PLAYER, static_cast<uint16_t>(mRace), nullptr)), - mPlayerBox(new PlayerBox(mPlayer, "charcreate_playerbox.xml", + mPlayerBox(new PlayerBox(this, mPlayer, "charcreate_playerbox.xml", "charcreate_selectedplayerbox.xml")), mHairStyle(0), mHairColor(0), @@ -528,7 +528,7 @@ void CharCreateDialog::setAttributes(const StringVect &labels, mAttributeLabel[i]->adjustSize(); add(mAttributeLabel[i]); - mAttributeSlider[i] = new Slider(min, max); + mAttributeSlider[i] = new Slider(this, min, max); mAttributeSlider[i]->setDimension(gcn::Rectangle(140, y + i * 24, 150, 12)); mAttributeSlider[i]->setActionEventId("statslider"); diff --git a/src/gui/windows/connectiondialog.cpp b/src/gui/windows/connectiondialog.cpp index 0d0633ff8..1a7c23187 100644 --- a/src/gui/windows/connectiondialog.cpp +++ b/src/gui/windows/connectiondialog.cpp @@ -41,7 +41,7 @@ ConnectionDialog::ConnectionDialog(const std::string &text, setMovable(false); setMinWidth(0); - ProgressIndicator *const progressIndicator = new ProgressIndicator; + ProgressIndicator *const progressIndicator = new ProgressIndicator(this); Label *const label = new Label(this, text); Button *const cancelButton = new Button( // TRANSLATORS: connection dialog button diff --git a/src/gui/windows/emotewindow.cpp b/src/gui/windows/emotewindow.cpp index 5f3aa1bb1..d94344090 100644 --- a/src/gui/windows/emotewindow.cpp +++ b/src/gui/windows/emotewindow.cpp @@ -51,10 +51,10 @@ EmoteWindow::EmoteWindow() : mEmotePage(new EmotePage(this)), mColorModel(ColorModel::createDefault(this)), mColorPage(new ColorPage(this, mColorModel, "colorpage.xml")), - mScrollColorPage(new ScrollArea(mColorPage, false, "emotepage.xml")), + mScrollColorPage(new ScrollArea(this, mColorPage, false, "emotepage.xml")), mFontModel(new NamesModel), mFontPage(new ListBox(this, mFontModel, "")), - mScrollFontPage(new ScrollArea(mFontPage, false, "fontpage.xml")), + mScrollFontPage(new ScrollArea(this, mFontPage, false, "fontpage.xml")), mImageSet(Theme::getImageSetFromThemeXml("emotetabs.xml", "", 17, 16)) { mTabs->postInit(); diff --git a/src/gui/windows/equipmentwindow.cpp b/src/gui/windows/equipmentwindow.cpp index 6f2bb3b3d..01f74c50d 100644 --- a/src/gui/windows/equipmentwindow.cpp +++ b/src/gui/windows/equipmentwindow.cpp @@ -59,7 +59,8 @@ EquipmentWindow::EquipmentWindow(Equipment *const equipment, ActionListener(), mEquipment(equipment), mItemPopup(new ItemPopup), - mPlayerBox(new PlayerBox("equipment_playerbox.xml", + mPlayerBox(new PlayerBox(this, + "equipment_playerbox.xml", "equipment_selectedplayerbox.xml")), // TRANSLATORS: equipment window button mUnequip(new Button(this, _("Unequip"), "unequip", this)), diff --git a/src/gui/windows/itemamountwindow.cpp b/src/gui/windows/itemamountwindow.cpp index 6b7d10173..8e981ae96 100644 --- a/src/gui/windows/itemamountwindow.cpp +++ b/src/gui/windows/itemamountwindow.cpp @@ -148,7 +148,7 @@ ItemAmountWindow::ItemAmountWindow(const Usage usage, Window *const parent, mMax(maxRange), mUsage(usage), mItemPopup(new ItemPopup), - mItemAmountSlide(new Slider(1.0, mMax)), + mItemAmountSlide(new Slider(this, 1.0, mMax)), mItemPriceSlide(nullptr), mItemDropDown(nullptr), mItemsModal(nullptr), @@ -182,7 +182,7 @@ ItemAmountWindow::ItemAmountWindow(const Usage usage, Window *const parent, mItemPriceTextField->setWidth(35); mItemPriceTextField->addKeyListener(this); - mItemPriceSlide = new Slider(1.0, 10000000); + mItemPriceSlide = new Slider(this, 1.0, 10000000); mItemPriceSlide->setHeight(10); mItemPriceSlide->setActionEventId("slidePrice"); mItemPriceSlide->addActionListener(this); diff --git a/src/gui/windows/selldialog.cpp b/src/gui/windows/selldialog.cpp index aad3619ba..b79d18dcf 100644 --- a/src/gui/windows/selldialog.cpp +++ b/src/gui/windows/selldialog.cpp @@ -90,7 +90,7 @@ void SellDialog::init() getOptionBool("showbackground"), "sell_background.xml"); mScrollArea->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER); - mSlider = new Slider(1.0); + mSlider = new Slider(this, 1.0); mQuantityLabel = new Label(this, strprintf( "%d / %d", mAmountItems, mMaxItems)); |