summaryrefslogtreecommitdiff
path: root/src/gui/chat.h
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2010-08-29 09:01:27 -0600
committerJared Adams <jaxad0127@gmail.com>2010-08-29 22:19:24 -0600
commitd55c1345449a34adb3192c23fe3760bd0aae645b (patch)
tree0dfe78eba2571b2f156c14deafe375d3f3241164 /src/gui/chat.h
parentb61faa43db7a48c6a6871fb94dce2de2abd79dfe (diff)
downloadmana-client-d55c1345449a34adb3192c23fe3760bd0aae645b.tar.gz
mana-client-d55c1345449a34adb3192c23fe3760bd0aae645b.tar.bz2
mana-client-d55c1345449a34adb3192c23fe3760bd0aae645b.tar.xz
mana-client-d55c1345449a34adb3192c23fe3760bd0aae645b.zip
Move handling of autocomplete and input history into TextField
Reviewed-by: Freeyorp
Diffstat (limited to 'src/gui/chat.h')
-rw-r--r--src/gui/chat.h25
1 files changed, 6 insertions, 19 deletions
diff --git a/src/gui/chat.h b/src/gui/chat.h
index b0d91556..1c673556 100644
--- a/src/gui/chat.h
+++ b/src/gui/chat.h
@@ -23,6 +23,7 @@
#define CHAT_H
#include "gui/widgets/window.h"
+#include "gui/widgets/textfield.h"
#include <guichan/actionlistener.hpp>
#include <guichan/keylistener.hpp>
@@ -61,8 +62,7 @@ struct CHATLOG
* \ingroup Interface
*/
class ChatWindow : public Window,
- public gcn::ActionListener,
- public gcn::KeyListener
+ public gcn::ActionListener
{
public:
/**
@@ -131,9 +131,6 @@ class ChatWindow : public Window,
*/
void chatInput(const std::string &msg);
- /** Called when key is pressed */
- void keyPressed(gcn::KeyEvent &event);
-
/** Add the given text to the chat input. */
void addInputText(const std::string &text);
@@ -143,11 +140,9 @@ class ChatWindow : public Window,
/** Override to reset mTmpVisible */
void setVisible(bool visible);
-
void mousePressed(gcn::MouseEvent &event);
void mouseDragged(gcn::MouseEvent &event);
-
/**
* Scrolls the chat window
*
@@ -177,7 +172,7 @@ class ChatWindow : public Window,
protected:
friend class ChatTab;
friend class WhisperTab;
- friend class TextField;
+ friend class ChatAutoComplete;
/** Remove the given tab from the window */
void removeTab(ChatTab *tab);
@@ -189,13 +184,6 @@ class ChatWindow : public Window,
void removeAllWhispers();
- void autoComplete();
-
- std::string autoCompleteHistory(std::string partName);
-
- std::string autoComplete(std::vector<std::string> &names,
- std::string partName) const;
-
/** Used for showing item popup on clicking links **/
ItemLinkHandler *mItemLinkHandler;
Recorder *mRecorder;
@@ -203,6 +191,9 @@ class ChatWindow : public Window,
/** Input box for typing chat messages. */
ChatInput *mChatInput;
+ TextHistory *mHistory;
+ AutoCompleteLister *mAutoComplete;
+
private:
bool mTmpVisible;
@@ -213,10 +204,6 @@ class ChatWindow : public Window,
/** Manage whisper tabs */
TabMap mWhispers;
- typedef std::list<std::string> History;
- typedef History::iterator HistoryIterator;
- History mHistory; /**< Command history. */
- HistoryIterator mCurHist; /**< History iterator. */
bool mReturnToggles; /**< Marks whether <Return> toggles the chat log
or not */
};