summaryrefslogtreecommitdiff
path: root/src/gui/windowmenu.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-10-31 01:20:34 +0300
committerAndrei Karas <akaras@inbox.ru>2012-10-31 02:57:08 +0300
commit3bcb4a9850ac7ae81d5548d40c831f6699cdc866 (patch)
tree9e6660a7405af777808c864bf3839a5e66efe870 /src/gui/windowmenu.h
parentdf348716dbdfec7ec7d1c721fb87d637063a10b8 (diff)
downloadmanaverse-3bcb4a9850ac7ae81d5548d40c831f6699cdc866.tar.gz
manaverse-3bcb4a9850ac7ae81d5548d40c831f6699cdc866.tar.bz2
manaverse-3bcb4a9850ac7ae81d5548d40c831f6699cdc866.tar.xz
manaverse-3bcb4a9850ac7ae81d5548d40c831f6699cdc866.zip
Simplify screen buttons handling.
Diffstat (limited to 'src/gui/windowmenu.h')
-rw-r--r--src/gui/windowmenu.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/gui/windowmenu.h b/src/gui/windowmenu.h
index fb5d3af10..1ee485a8d 100644
--- a/src/gui/windowmenu.h
+++ b/src/gui/windowmenu.h
@@ -37,6 +37,19 @@
#include <vector>
class TextPopup;
+class Window;
+
+struct ButtonInfo final
+{
+ ButtonInfo(Button *button0, Window *window0) :
+ button(button0),
+ window(window0)
+ {
+ }
+
+ Button *button;
+ Window *window;
+};
/**
* The window menu. Allows showing and hiding many of the different windows
@@ -65,7 +78,7 @@ class WindowMenu final : public Container,
void mouseExited(gcn::MouseEvent& mouseEvent A_UNUSED) override;
- std::map <std::string, Button*> &getButtonNames() A_WARN_UNUSED
+ std::map <std::string, ButtonInfo*> &getButtonNames() A_WARN_UNUSED
{ return mButtonNames; }
std::vector <Button*> &getButtons() A_WARN_UNUSED
@@ -86,13 +99,14 @@ class WindowMenu final : public Container,
inline void addButton(const char *const text,
const std::string &description,
int &x, int &h, const int key,
+ Window *window,
const bool visible = true);
void updateButtons();
TextPopup *mTextPopup;
std::vector <Button*> mButtons;
- std::map <std::string, Button*> mButtonNames;
+ std::map <std::string, ButtonInfo*> mButtonNames;
bool mHaveMouse;
int mAutoHide;
};