summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ManaWorld.vcproj2
-rw-r--r--file.list2
-rw-r--r--src/Makefile.am2
-rw-r--r--src/gui/buy.cpp3
-rw-r--r--src/gui/listbox.cpp60
-rw-r--r--src/gui/listbox.h54
-rw-r--r--src/gui/npc.cpp3
-rw-r--r--src/gui/npc_text.cpp3
-rw-r--r--src/gui/sell.cpp3
-rw-r--r--src/gui/textbox.cpp38
-rw-r--r--src/gui/textbox.h49
-rw-r--r--src/sound/sound.cpp2
-rw-r--r--src/sound/sound.h6
13 files changed, 220 insertions, 7 deletions
diff --git a/ManaWorld.vcproj b/ManaWorld.vcproj
index bf7b644c..815f914f 100644
--- a/ManaWorld.vcproj
+++ b/ManaWorld.vcproj
@@ -80,7 +80,7 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="SDL.lib"
- AdditionalDependencies="alleg.lib guichan.lib guichan_allegro.lib libjgmod.lib alfont.lib ws2_32.lib "
+ AdditionalDependencies="alleg.lib guichan.lib guichan_allegro.lib ws2_32.lib "
OutputFile="tmw.exe"
LinkIncremental="1"
GenerateDebugInformation="TRUE"
diff --git a/file.list b/file.list
index 523a5352..e71473da 100644
--- a/file.list
+++ b/file.list
@@ -11,6 +11,7 @@ MODULES = src/sound/sound.cpp \
src/gui/checkbox.cpp \
src/gui/gui.cpp \
src/gui/inventory.cpp \
+ src/gui/listbox.cpp \
src/gui/login.cpp \
src/gui/npc.cpp \
src/gui/npc_text.cpp \
@@ -26,6 +27,7 @@ MODULES = src/sound/sound.cpp \
src/gui/slider.cpp \
src/gui/stats.cpp \
src/gui/status.cpp \
+ src/gui/textbox.cpp \
src/gui/textfield.cpp \
src/gui/window.cpp \
src/net/network.cpp \
diff --git a/src/Makefile.am b/src/Makefile.am
index 51d8b71b..7c8923b7 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -12,6 +12,7 @@ tmw_SOURCES = sound/sound.cpp \
gui/checkbox.cpp \
gui/gui.cpp \
gui/inventory.cpp \
+ gui/listbox.cpp \
gui/login.cpp \
gui/npc.cpp \
gui/npc_text.cpp \
@@ -27,6 +28,7 @@ tmw_SOURCES = sound/sound.cpp \
gui/slider.cpp \
gui/status.cpp \
gui/stats.cpp \
+ gui/textbox.cpp \
gui/textfield.cpp \
gui/window.cpp \
net/network.cpp \
diff --git a/src/gui/buy.cpp b/src/gui/buy.cpp
index 2f2e01ef..8eefa503 100644
--- a/src/gui/buy.cpp
+++ b/src/gui/buy.cpp
@@ -25,6 +25,7 @@
#include "button.h"
#include "slider.h"
#include "scrollarea.h"
+#include "listbox.h"
#include <sstream>
@@ -32,7 +33,7 @@ BuyDialog::BuyDialog(gcn::Container *parent):
Window(parent, "Buy"),
money(0)
{
- itemList = new gcn::ListBox(this);
+ itemList = new ListBox(this);
scrollArea = new ScrollArea(itemList);
slider = new Slider(1.0);
quantityLabel = new gcn::Label("0");
diff --git a/src/gui/listbox.cpp b/src/gui/listbox.cpp
new file mode 100644
index 00000000..b45823a6
--- /dev/null
+++ b/src/gui/listbox.cpp
@@ -0,0 +1,60 @@
+/*
+ * The Mana World
+ * Copyright 2004 The Mana World Development Team
+ *
+ * This file is part of The Mana World.
+ *
+ * The Mana World is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * The Mana World is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with The Mana World; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id$
+ */
+
+#include "listbox.h"
+
+ListBox::ListBox():
+ gcn::ListBox()
+{
+}
+
+ListBox::ListBox(gcn::ListModel *listModel):
+ gcn::ListBox(listModel)
+{
+}
+
+void ListBox::draw(gcn::Graphics *graphics)
+{
+ if (mListModel == NULL) {
+ return;
+ }
+
+ graphics->setColor(gcn::Color(110, 160, 255));
+ graphics->setFont(getFont());
+
+ int i;
+ int fontHeight = getFont()->getHeight();
+ int y = 0;
+
+ for (i = 0; i < mListModel->getNumberOfElements(); ++i)
+ {
+ if (i == mSelected) {
+ graphics->fillRectangle(
+ gcn::Rectangle(0, y, getWidth(), fontHeight));
+ }
+
+ graphics->drawText(mListModel->getElementAt(i), 1, y);
+
+ y += fontHeight;
+ }
+}
diff --git a/src/gui/listbox.h b/src/gui/listbox.h
new file mode 100644
index 00000000..2238bffb
--- /dev/null
+++ b/src/gui/listbox.h
@@ -0,0 +1,54 @@
+/*
+ * The Mana World
+ * Copyright 2004 The Mana World Development Team
+ *
+ * This file is part of The Mana World.
+ *
+ * The Mana World is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * The Mana World is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with The Mana World; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id$
+ */
+
+#ifndef __TMW_LISTBOX_H__
+#define __TMW_LISTBOX_H__
+
+#include <guichan.hpp>
+
+/**
+ * A list box, meant to be used inside a scroll area. Same as the Guichan list
+ * box except this one doesn't have a background, instead completely relying
+ * on the scroll area.
+ *
+ * \ingroup GUI
+ */
+class ListBox : public gcn::ListBox {
+ public:
+ /**
+ * Constructor.
+ */
+ ListBox();
+
+ /**
+ * Constructor.
+ */
+ ListBox(gcn::ListModel *listModel);
+
+ /**
+ * Draws the list box.
+ */
+ void draw(gcn::Graphics *graphics);
+};
+
+#endif
diff --git a/src/gui/npc.cpp b/src/gui/npc.cpp
index 80d55c73..95180356 100644
--- a/src/gui/npc.cpp
+++ b/src/gui/npc.cpp
@@ -24,12 +24,13 @@
#include "npc.h"
#include "button.h"
#include "scrollarea.h"
+#include "listbox.h"
#include "../game.h"
NpcListDialog::NpcListDialog(gcn::Container *parent):
Window(parent, "NPC")
{
- itemList = new gcn::ListBox(this);
+ itemList = new ListBox(this);
scrollArea = new ScrollArea(itemList);
okButton = new Button("OK");
cancelButton = new Button("Cancel");
diff --git a/src/gui/npc_text.cpp b/src/gui/npc_text.cpp
index 38c29688..dc70927c 100644
--- a/src/gui/npc_text.cpp
+++ b/src/gui/npc_text.cpp
@@ -24,12 +24,13 @@
#include "npc_text.h"
#include "scrollarea.h"
#include "button.h"
+#include "textbox.h"
#include "../game.h"
NpcTextDialog::NpcTextDialog(gcn::Container *parent):
Window(parent, "NPC")
{
- textBox = new gcn::TextBox();
+ textBox = new TextBox();
textBox->setEditable(false);
scrollArea = new ScrollArea(textBox);
okButton = new Button("OK");
diff --git a/src/gui/sell.cpp b/src/gui/sell.cpp
index 4dc210a4..bdf6ec6d 100644
--- a/src/gui/sell.cpp
+++ b/src/gui/sell.cpp
@@ -25,6 +25,7 @@
#include "button.h"
#include "slider.h"
#include "scrollarea.h"
+#include "listbox.h"
#include "../graphic/graphic.h"
#include <sstream>
@@ -32,7 +33,7 @@
SellDialog::SellDialog(gcn::Container *parent):
Window(parent, "Sell")
{
- itemList = new gcn::ListBox(this);
+ itemList = new ListBox(this);
scrollArea = new ScrollArea(itemList);
slider = new Slider(1.0);
quantityLabel = new gcn::Label("0");
diff --git a/src/gui/textbox.cpp b/src/gui/textbox.cpp
new file mode 100644
index 00000000..a620f29f
--- /dev/null
+++ b/src/gui/textbox.cpp
@@ -0,0 +1,38 @@
+/*
+ * The Mana World
+ * Copyright 2004 The Mana World Development Team
+ *
+ * This file is part of The Mana World.
+ *
+ * The Mana World is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * The Mana World is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with The Mana World; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id$
+ */
+
+#include "textbox.h"
+
+TextBox::TextBox():
+ gcn::TextBox()
+{
+ setOpaque(false);
+ setBorderSize(0);
+}
+
+TextBox::TextBox(const std::string& text):
+ gcn::TextBox(text)
+{
+ setOpaque(false);
+ setBorderSize(0);
+}
diff --git a/src/gui/textbox.h b/src/gui/textbox.h
new file mode 100644
index 00000000..8f5d910f
--- /dev/null
+++ b/src/gui/textbox.h
@@ -0,0 +1,49 @@
+/*
+ * The Mana World
+ * Copyright 2004 The Mana World Development Team
+ *
+ * This file is part of The Mana World.
+ *
+ * The Mana World is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * The Mana World is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with The Mana World; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id$
+ */
+
+#ifndef __TMW_TEXTBOX_H__
+#define __TMW_TEXTBOX_H__
+
+#include <guichan.hpp>
+
+/**
+ * A text box, meant to be used inside a scroll area. Same as the Guichan text
+ * box except this one doesn't have a background or border, instead completely
+ * relying on the scroll area.
+ *
+ * \ingroup GUI
+ */
+class TextBox : public gcn::TextBox {
+ public:
+ /**
+ * Constructor.
+ */
+ TextBox();
+
+ /**
+ * Constructor.
+ */
+ TextBox(const std::string& text);
+};
+
+#endif
diff --git a/src/sound/sound.cpp b/src/sound/sound.cpp
index 8ec29d7b..7d2ba834 100644
--- a/src/sound/sound.cpp
+++ b/src/sound/sound.cpp
@@ -17,6 +17,8 @@
* You should have received a copy of the GNU General Public License
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id$
*/
#ifndef WIN32
diff --git a/src/sound/sound.h b/src/sound/sound.h
index 95e8b7b8..1404ba48 100644
--- a/src/sound/sound.h
+++ b/src/sound/sound.h
@@ -17,10 +17,12 @@
* You should have received a copy of the GNU General Public License
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id$
*/
-#ifndef __SOUND_H
-#define __SOUND_H
+#ifndef _TMW_SOUND_H
+#define _TMW_SOUND_H
#ifndef WIN32