diff options
-rw-r--r-- | src/gui/buy.cpp | 2 | ||||
-rw-r--r-- | src/gui/buysell.cpp | 4 | ||||
-rw-r--r-- | src/gui/buysell.h | 3 | ||||
-rw-r--r-- | src/gui/sell.cpp | 2 |
4 files changed, 7 insertions, 4 deletions
diff --git a/src/gui/buy.cpp b/src/gui/buy.cpp index ea4bb49b..0f622aca 100644 --- a/src/gui/buy.cpp +++ b/src/gui/buy.cpp @@ -270,7 +270,7 @@ void BuyDialog::setVisible(bool visible) Window::setVisible(visible); if (visible) - requestFocus(); + mShopItemList->requestFocus(); } void BuyDialog::close() diff --git a/src/gui/buysell.cpp b/src/gui/buysell.cpp index e56b16b1..3032b7b1 100644 --- a/src/gui/buysell.cpp +++ b/src/gui/buysell.cpp @@ -34,7 +34,7 @@ BuySellDialog::BuySellDialog(): Window(_("Shop")) { setWindowName("BuySell"); - Button *buyButton = 0; + buyButton = 0; static const char *buttonNames[] = { N_("Buy"), N_("Sell"), N_("Cancel"), 0 }; @@ -71,7 +71,7 @@ void BuySellDialog::setVisible(bool visible) Window::setVisible(visible); if (visible) - requestFocus(); + buyButton->requestFocus(); } void BuySellDialog::action(const gcn::ActionEvent &event) diff --git a/src/gui/buysell.h b/src/gui/buysell.h index ab6d0c92..13fbea8c 100644 --- a/src/gui/buysell.h +++ b/src/gui/buysell.h @@ -53,6 +53,9 @@ class BuySellDialog : public Window, public gcn::ActionListener * Called when receiving actions from the widgets. */ void action(const gcn::ActionEvent &event); + + private: + gcn::Button* buyButton; }; extern BuySellDialog *buySellDialog; diff --git a/src/gui/sell.cpp b/src/gui/sell.cpp index f940856d..f7762144 100644 --- a/src/gui/sell.cpp +++ b/src/gui/sell.cpp @@ -292,7 +292,7 @@ void SellDialog::setVisible(bool visible) Window::setVisible(visible); if (visible) - requestFocus(); + mShopItemList->requestFocus(); } void SellDialog::close() |