summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/buysell.cpp15
-rw-r--r--src/gui/buysell.h2
2 files changed, 9 insertions, 8 deletions
diff --git a/src/gui/buysell.cpp b/src/gui/buysell.cpp
index 3032b7b1..53c2419a 100644
--- a/src/gui/buysell.cpp
+++ b/src/gui/buysell.cpp
@@ -31,10 +31,11 @@
#include "utils/gettext.h"
BuySellDialog::BuySellDialog():
- Window(_("Shop"))
+ Window(_("Shop")),
+ mBuyButton(0)
{
setWindowName("BuySell");
- buyButton = 0;
+
static const char *buttonNames[] = {
N_("Buy"), N_("Sell"), N_("Cancel"), 0
};
@@ -43,15 +44,15 @@ BuySellDialog::BuySellDialog():
for (const char **curBtn = buttonNames; *curBtn; curBtn++)
{
Button *btn = new Button(gettext(*curBtn), *curBtn, this);
- if (!buyButton)
- buyButton = btn; // For focus request
+ if (!mBuyButton)
+ mBuyButton = btn; // For focus request
btn->setPosition(x, y);
add(btn);
x += btn->getWidth() + 10;
}
- buyButton->requestFocus();
+ mBuyButton->requestFocus();
- setContentSize(x, 2 * y + buyButton->getHeight());
+ setContentSize(x, 2 * y + mBuyButton->getHeight());
center();
setDefaultSize();
@@ -71,7 +72,7 @@ void BuySellDialog::setVisible(bool visible)
Window::setVisible(visible);
if (visible)
- buyButton->requestFocus();
+ mBuyButton->requestFocus();
}
void BuySellDialog::action(const gcn::ActionEvent &event)
diff --git a/src/gui/buysell.h b/src/gui/buysell.h
index 13fbea8c..185a103d 100644
--- a/src/gui/buysell.h
+++ b/src/gui/buysell.h
@@ -55,7 +55,7 @@ class BuySellDialog : public Window, public gcn::ActionListener
void action(const gcn::ActionEvent &event);
private:
- gcn::Button* buyButton;
+ gcn::Button *mBuyButton;
};
extern BuySellDialog *buySellDialog;