summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--src/gui/chat.cpp6
-rw-r--r--src/gui/menuwindow.cpp6
-rw-r--r--src/gui/skill.cpp6
-rw-r--r--src/gui/status.cpp9
5 files changed, 12 insertions, 18 deletions
diff --git a/ChangeLog b/ChangeLog
index 92f8f28c..0528fdc9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2006-03-18 Björn Steinbrink <B.Steinbrink@gmx.de>
+ * src/gui/chat.cpp, src/gui/menuwindow.cpp, src/gui/skill.cpp,
+ src/gui/status.cpp: Use the window container instead of the graphics
+ class to calculate window positions.
* src/utils/dtor.h: Fixed indentation.
* src/configuration.cpp, src/log.cpp, src/main.cpp, src/being.cpp,
src/monster.cpp, src/gui/equipmentwindow.cpp, src/gui/sell.cpp,
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();
// ----------------------