summaryrefslogtreecommitdiff
path: root/src/gui/chat.h
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-03-13 11:37:47 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-03-13 11:37:47 +0000
commitcd2c4f5861c89f0925a1a706e38535d6c11cc3a0 (patch)
tree232273a1d853305deea6e3101dd7ceef9fb76930 /src/gui/chat.h
parenta03175439e5abaae8603a85be0db173daa543f6b (diff)
downloadmana-client-cd2c4f5861c89f0925a1a706e38535d6c11cc3a0.tar.gz
mana-client-cd2c4f5861c89f0925a1a706e38535d6c11cc3a0.tar.bz2
mana-client-cd2c4f5861c89f0925a1a706e38535d6c11cc3a0.tar.xz
mana-client-cd2c4f5861c89f0925a1a706e38535d6c11cc3a0.zip
Converted ChatBox into a proper ChatWindow in response to changes by Chetic.
Diffstat (limited to 'src/gui/chat.h')
-rw-r--r--src/gui/chat.h27
1 files changed, 19 insertions, 8 deletions
diff --git a/src/gui/chat.h b/src/gui/chat.h
index 39f9ab1c..3102e3bc 100644
--- a/src/gui/chat.h
+++ b/src/gui/chat.h
@@ -26,11 +26,12 @@
#include <guichan.hpp>
#include "../resources/image.h"
+#include "../net/network.h"
+#include "window.h"
#include <SDL.h>
#include <list>
#include <string>
#include <fstream>
-#include "../net/network.h"
#define BY_GM 0 // those should be self-explanatory =)
#define BY_PLAYER 1
@@ -96,17 +97,17 @@ struct CHATSKILL {
/**
* Simple chatlog object.
*/
-class ChatBox : public gcn::Widget {
+class ChatWindow : public Window, public gcn::ActionListener {
public:
/**
* Constructor.
*/
- ChatBox(const char *logfile, int item_num);
+ ChatWindow(const char *logfile, int item_num);
/**
* Destructor.
*/
- ~ChatBox();
+ ~ChatWindow();
/*
* Adds a line of text to our message list. Parameters:
@@ -126,6 +127,16 @@ class ChatBox : public gcn::Widget {
*/
void draw(gcn::Graphics *graphics);
+ /**
+ * Performs action.
+ */
+ void action(const std::string &actionId);
+
+ /**
+ * Request focus.
+ */
+ void requestFocus();
+
/*
* Determines wether to send a command or an ordinary message, then
* contructs packets & sends them
@@ -167,11 +178,11 @@ class ChatBox : public gcn::Widget {
int items;
int items_keep;
- /** constructs failed messages for actions */
+ /** Constructs failed messages for actions */
std::string const_msg(CHATSKILL);
-
- // The Alpha-Blended Surface for the background transluency effect.
- Image *chatBoxBackground;
+
+ /** Input box for chat messages */
+ gcn::TextField *chatInput;
};
#endif