From b4ddbd772ae2039ec9e23ce85f16f07f3533edd4 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Fri, 29 Apr 2005 14:38:59 +0000 Subject: *** empty log message *** --- src/gui/chat.h | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) (limited to 'src/gui/chat.h') diff --git a/src/gui/chat.h b/src/gui/chat.h index 574accab..b078e952 100644 --- a/src/gui/chat.h +++ b/src/gui/chat.h @@ -88,7 +88,8 @@ /** should always be zero if failed */ #define SKILL_FAILED 0x00 -struct CHATSKILL { +struct CHATSKILL +{ short skill; short bskill; short unused; @@ -99,7 +100,9 @@ struct CHATSKILL { /** * Simple chatlog object. */ -class ChatWindow : public Window, public gcn::ActionListener { +class ChatWindow : public Window, public gcn::ActionListener, + public gcn::KeyListener +{ public: /** * Constructor. @@ -170,14 +173,14 @@ class ChatWindow : public Window, public gcn::ActionListener { */ char *chat_send(std::string nick, std::string msg); - /** History */ - void update_history(const char *ptr); - void arrow_up(void); - void arrow_down(void); + /** History */ + void updateHistory(const char *ptr); + void arrowUp(void); + void arrowDown(void); + + /** Called when key is pressed */ + void keyPress(const gcn::Key& key); - /** Called when key is pressed */ - void keyPress(const gcn::Key& key); - private : std::ofstream chatlog_file; @@ -197,20 +200,19 @@ class ChatWindow : public Window, public gcn::ActionListener { std::string const_msg(CHATSKILL); /** - * Cuts a string into two on a per word basis - * @param value The string to be cut, it may be modified - * in the function. + * Cuts a string into two on a per word basis. + * + * @param value The string to be cut, it may be modified + * in the function. * @param maximumLength The length after which the string - * should be cut. + * should be cut. * @return The cut off section of the string */ - std::string cut_string(std::string& value, unsigned int maximumLength); - - /** Input box for chat messages */ - gcn::TextField *chatInput; - gcn::TextBox *textOutput; - ScrollArea *scrollArea; + std::string cutString(std::string& value, unsigned int maximumLength); + gcn::TextField *chatInput; /**< Input box for typing chat messages */ + gcn::TextBox *textOutput; /**< Text box for displaying chat history */ + ScrollArea *scrollArea; /**< Scroll area around text output */ }; #endif -- cgit v1.2.3-60-g2f50