summaryrefslogtreecommitdiff
path: root/src/gui/chat.h
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2008-04-20 17:48:45 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2008-04-20 17:48:45 +0000
commit1d30fc204176ff23a4a55e0319246ab530ae6454 (patch)
treeb3b8911af5e12910d2035bb686a124ffa3961ae8 /src/gui/chat.h
parent8d1299338e033e1de539dae36856e365855fabc1 (diff)
downloadmana-1d30fc204176ff23a4a55e0319246ab530ae6454.tar.gz
mana-1d30fc204176ff23a4a55e0319246ab530ae6454.tar.bz2
mana-1d30fc204176ff23a4a55e0319246ab530ae6454.tar.xz
mana-1d30fc204176ff23a4a55e0319246ab530ae6454.zip
Merged two maps into one, avoid non-const operator[] and check whether channel
was found.
Diffstat (limited to 'src/gui/chat.h')
-rw-r--r--src/gui/chat.h30
1 files changed, 24 insertions, 6 deletions
diff --git a/src/gui/chat.h b/src/gui/chat.h
index ab8c3985..08fed0be 100644
--- a/src/gui/chat.h
+++ b/src/gui/chat.h
@@ -234,20 +234,38 @@ class ChatWindow : public Window, public gcn::ActionListener,
int own;
};
+ /**
+ * A structure combining a BrowserBox with its ScrollArea.
+ */
+ struct ChatArea
+ {
+ ChatArea(BrowserBox *b, ScrollArea *s):
+ browser(b), scroll(s)
+ {}
+
+ BrowserBox *browser;
+ ScrollArea *scroll;
+ };
+
#if 0
/** Constructs failed messages for actions */
std::string const_msg(CHATSKILL);*/
#endif
- TabbedArea *mChatTabs; /** < Chat Tabbed area for holding each channel */
- gcn::TextField *mChatInput; /**< Input box for typing chat messages */
- std::map<std::string, BrowserBox*> mChannelOutput; /**< Map each TextOutput to a tab */
- std::map<std::string, ScrollArea*> mChannelScroll; /**< Map each ScrollArea to a tab */
+ /** Tabbed area for holding each channel. */
+ TabbedArea *mChatTabs;
+
+ /** Input box for typing chat messages. */
+ gcn::TextField *mChatInput;
+
+ typedef std::map<const std::string, ChatArea> ChannelMap;
+ /** Map each tab to its browser and scroll area. */
+ ChannelMap mChannels;
typedef std::list<std::string> History;
typedef History::iterator HistoryIterator;
- History mHistory; /**< Command history */
- HistoryIterator mCurHist; /**< History iterator */
+ History mHistory; /**< Command history. */
+ HistoryIterator mCurHist; /**< History iterator. */
};
extern ChatWindow *chatWindow;