diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-03-18 16:59:18 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-03-18 16:59:18 +0000 |
commit | d5e9f527c4113dfa196448d5f8ca9e63774ab691 (patch) | |
tree | eb501806f2258e0132b1cc3a6af91069b014a70f /src/gui | |
parent | 2e749068a812e75abb86abd7840723ef0ad4f813 (diff) | |
download | mana-d5e9f527c4113dfa196448d5f8ca9e63774ab691.tar.gz mana-d5e9f527c4113dfa196448d5f8ca9e63774ab691.tar.bz2 mana-d5e9f527c4113dfa196448d5f8ca9e63774ab691.tar.xz mana-d5e9f527c4113dfa196448d5f8ca9e63774ab691.zip |
Use the window container instead of the graphics class to calculate window positions.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/chat.cpp | 6 | ||||
-rw-r--r-- | src/gui/menuwindow.cpp | 6 | ||||
-rw-r--r-- | src/gui/skill.cpp | 6 | ||||
-rw-r--r-- | src/gui/status.cpp | 9 |
4 files changed, 9 insertions, 18 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp index 7e0e4849..64b56caf 100644 --- a/src/gui/chat.cpp +++ b/src/gui/chat.cpp @@ -31,17 +31,15 @@ #include "browserbox.h" #include "chatinput.h" #include "scrollarea.h" +#include "windowcontainer.h" #include "../game.h" -#include "../graphics.h" #include "../localplayer.h" #include "../log.h" #include "../net/messageout.h" #include "../net/protocol.h" -extern Graphics *graphics; - ChatWindow::ChatWindow(const std::string &logfile, Network *network): Window(""), mNetwork(network), @@ -53,7 +51,7 @@ ChatWindow::ChatWindow(const std::string &logfile, Network *network): mItemsKeep = 20; setResizable(true); - setDefaultSize(0, (graphics->getHeight() - 123), 600, 100); + setDefaultSize(0, (windowContainer->getHeight() - 123), 600, 100); loadWindowState(); mChatInput = new ChatInput(); diff --git a/src/gui/menuwindow.cpp b/src/gui/menuwindow.cpp index 871a50d3..503f7ba8 100644 --- a/src/gui/menuwindow.cpp +++ b/src/gui/menuwindow.cpp @@ -28,10 +28,8 @@ #include <guichan/actionlistener.hpp> #include "button.h" +#include "windowcontainer.h" -#include "../graphics.h" - -extern Graphics *graphics; extern Window *setupWindow, *inventoryWindow, *equipmentWindow, *skillDialog, *statusWindow; @@ -68,7 +66,7 @@ MenuWindow::MenuWindow(): h = btn->getHeight(); } - setDefaultSize((graphics->getWidth() - x - 2), 0, x, (y + h)); + setDefaultSize((windowContainer->getWidth() - x - 2), 0, x, (y + h)); } void MenuWindow::draw(gcn::Graphics *g) diff --git a/src/gui/skill.cpp b/src/gui/skill.cpp index 0af8511b..604a19cc 100644 --- a/src/gui/skill.cpp +++ b/src/gui/skill.cpp @@ -28,14 +28,12 @@ #include "button.h" #include "listbox.h" #include "scrollarea.h" +#include "windowcontainer.h" #include "../localplayer.h" -#include "../graphics.h" #include "../utils/dtor.h" -extern Graphics *graphics; - const char *skill_db[] = { // 0-99 "", "Basic", "Sword", "Two hand", "HP regeneration", "Bash", "Provoke", "Magnum", "Endure", "MP regeneration", @@ -66,7 +64,7 @@ SkillDialog::SkillDialog(): Window("Skills") { setWindowName("Skills"); - setDefaultSize(graphics->getWidth() - 255, 25, 240, 240); + setDefaultSize(windowContainer->getWidth() - 255, 25, 240, 240); mSkillListBox = new ListBox(this); ScrollArea *skillScrollArea = new ScrollArea(mSkillListBox); diff --git a/src/gui/status.cpp b/src/gui/status.cpp index d7cae2f0..7d6cabac 100644 --- a/src/gui/status.cpp +++ b/src/gui/status.cpp @@ -27,23 +27,20 @@ #include "button.h" #include "progressbar.h" +#include "windowcontainer.h" #include "../localplayer.h" -#include "../graphics.h" - #include "../utils/tostring.h" -extern Graphics *graphics; - StatusWindow::StatusWindow(LocalPlayer *player): Window(player->getName()), mPlayer(player) { setWindowName("Status"); setResizable(true); - setDefaultSize((graphics->getWidth() - 365) / 2, - (graphics->getHeight() - 255) / 2, 365, 255); + setDefaultSize((windowContainer->getWidth() - 365) / 2, + (windowContainer->getHeight() - 255) / 2, 365, 255); loadWindowState(); // ---------------------- |