ChatPanel Class Reference

wxPanel that contains a chat. More...

#include <chatpanel.h>

Inherits wxPanel, and OnLoginSink< ChatPanel >.

Collaboration diagram for ChatPanel:
Collaboration graph
[legend]

Public Member Functions

 ChatPanel (wxWindow *parent, Channel &chan, wxImageList *imaglist)
 ChatPanel (wxWindow *parent, const User &user, wxImageList *imaglist)
 ChatPanel (wxWindow *parent, Server &serv, wxImageList *imaglist)
 ChatPanel (wxWindow *parent, Battle *battle)
 ~ChatPanel ()
 ChatPanel destructor.
void Said (const wxString &who, const wxString &message)
 Output a message said in the channel.
void DidAction (const wxString &who, const wxString &action)
void Motd (const wxString &message)
 Output motd sent by server.
void StatusMessage (const wxString &message)
void ClientMessage (const wxString &message)
void UnknownCommand (const wxString &command, const wxString &params)
void Joined (User &who)
void Parted (User &who, const wxString &message)
void SetTopic (const wxString &who, const wxString &message)
void UserStatusUpdated (User &who)
void OnChannelJoin (User &who)
const ChannelGetChannel () const
void SetChannel (Channel *chan)
const ServerGetServer () const
void SetServer (Server *serv)
const UserGetUser () const
void SetUser (const User *usr)
bool IsServerPanel () const
ChatPanelType GetPanelType () const
void SetBattle (Battle *battle)
bool Say (const wxString &message)
void Part ()
void FocusInputBox ()
wxString GetChatTypeStr () const
size_t GetIconIndex () const
void SetIconIndex (size_t index)
const UserGetMe () const
const UserGetSelectedUser () const
bool IsOk () const
void OnUserDisconnected ()
void OnUserConnected ()
void OnChanOpts (wxCommandEvent &event)
void OnSay (wxCommandEvent &event)
void OnPaste (wxClipboardTextEvent &event)
void OnLinkEvent (wxTextUrlEvent &event)
void OnMouseDown (wxMouseEvent &event)
void OnKeyPressed (wxKeyEvent &keyevent)
void OnKeyReleased (wxKeyEvent &keyevent)
void UpdateNicklistHighlights ()
void SortNickList ()
void OnMenuItem (wxCommandEvent &event)
void OnLogin (OnLoginSink< ChatPanel >::EventDataType data)
void OnLogin (EventDataType data)

Protected Types

typedef
GlobalEvents::GlobalEventData 
EventDataType
typedef OnLoginSink< ChatPanelBaseType
typedef EventReceiverFunc
< OnLoginSink, EventDataType,&OnLoginSink::OnLogin > 
EventReceiverFunction

Protected Member Functions

void _SetChannel (Channel *channel)
 Set the Channel object.
void OutputLine (const wxString &message, const wxColour &col, const wxFont &fon)
void OutputLine (const ChatLine &line)
void SetIconHighlight (HighlightType highlight)
wxString FindUrl (const long pos) const
bool ContainsWordToHighlight (const wxString &message) const
void LogTime ()
void CreateControls ()
void CreatePopup ()
void LoadLastLines ()
ChatPanelasImp ()
const ChatPanelasImp () const

Protected Attributes

bool m_show_nick_list
 If the nicklist should be shown or not.
wxBoxSizer * m_main_sizer
 Main sizer containing all other sizers.
wxBoxSizer * m_chat_sizer
 Sizer containing the chat messages, and send input and button.
wxBoxSizer * m_say_sizer
 Sizer containing send input and button.
wxBoxSizer * m_nick_sizer
 Sizer containing the nicklist.
wxSplitterWindow * m_splitter
 The splitter.
wxPanelm_chat_panel
 Panel containing the chat. Only used when nicklist is visible.
wxPanelm_nick_panel
 Panel containing the nicklist.
wxTextCtrl * m_chatlog_text
 The chat log textcontrol.
wxTextCtrlHistm_say_text
 The say textcontrol.
wxBitmapButton * m_chan_opts_button
 The channel options button.
NickListCtrlm_nicklist
 The nicklist.
wxComboBox * m_nick_filter
 The filter combo.
wxButton * m_say_button
 The say button.
SLNotebookm_chat_tabs
Channelm_channel
 Channel object.
Serverm_server
 Server object.
const Userm_user
 User object.
Battlem_battle
 User object.
wxStaticText * m_usercount_label
const ChatPanelType m_type
 Channel object.
wxString m_chan_pass
ChatPanelMenum_popup_menu
ChatLog m_chat_log
size_t m_icon_index
wxImageListm_imagelist
TextCompletionDatabase textcompletiondatabase
std::vector< ChatLinem_buffer
bool m_disable_append
wxString m_url_at_pos
bool m_topic_set
EventReceiverFunction m_OnLoginSink

Static Protected Attributes

static const int m_groupMenu_baseID = 6798

Friends

class ChatPanelMenu
 the mouse event sink sets this

Detailed Description

wxPanel that contains a chat.

This panel contains a chat with a multiline TextCtrl for the messages, a signle line TextCtrl for messages to send, a send button and a nick list.

The nick list is optional and can be removed by setting show_nick_list in the constructor to false.

Definition at line 68 of file chatpanel.h.


Member Typedef Documentation

typedef OnLoginSink<ChatPanel > OnLoginSink< ChatPanel >::BaseType [protected, inherited]

Definition at line 101 of file isink.h.

Definition at line 99 of file isink.h.

typedef EventReceiverFunc<OnLoginSink, EventDataType, &OnLoginSink::OnLogin> OnLoginSink< ChatPanel >::EventReceiverFunction [protected, inherited]

Definition at line 109 of file isink.h.


Constructor & Destructor Documentation

ChatPanel::ChatPanel ( wxWindow *  parent,
Channel chan,
wxImageList imaglist 
)

Definition at line 93 of file chatpanel.cpp.

ChatPanel::ChatPanel ( wxWindow *  parent,
const User user,
wxImageList imaglist 
)

Definition at line 121 of file chatpanel.cpp.

ChatPanel::ChatPanel ( wxWindow *  parent,
Server serv,
wxImageList imaglist 
)

Definition at line 147 of file chatpanel.cpp.

ChatPanel::ChatPanel ( wxWindow *  parent,
Battle battle 
)

Definition at line 174 of file chatpanel.cpp.

ChatPanel::~ChatPanel (  ) 

ChatPanel destructor.

Definition at line 204 of file chatpanel.cpp.


Member Function Documentation

void ChatPanel::_SetChannel ( Channel channel  )  [protected]

Set the Channel object.

Parameters:
channel the Channel object.

Definition at line 939 of file chatpanel.cpp.

const ChatPanel & CRTPbase< ChatPanel >::asImp (  )  const [inline, protected, inherited]

Definition at line 10 of file crtpbase.h.

ChatPanel & CRTPbase< ChatPanel >::asImp (  )  [inline, protected, inherited]

Definition at line 9 of file crtpbase.h.

void ChatPanel::ClientMessage ( const wxString message  ) 

Definition at line 702 of file chatpanel.cpp.

bool ChatPanel::ContainsWordToHighlight ( const wxString message  )  const [protected]

Definition at line 652 of file chatpanel.cpp.

void ChatPanel::CreateControls (  )  [protected]

Definition at line 233 of file chatpanel.cpp.

void ChatPanel::CreatePopup (  )  [protected]

Definition at line 342 of file chatpanel.cpp.

void ChatPanel::DidAction ( const wxString who,
const wxString action 
)

Definition at line 665 of file chatpanel.cpp.

wxString ChatPanel::FindUrl ( const long  pos  )  const [protected]

Todo:
there's prolly some smarter way to capture a more flexible range of url types

Definition at line 1113 of file chatpanel.cpp.

void ChatPanel::FocusInputBox (  ) 

Definition at line 1108 of file chatpanel.cpp.

const Channel * ChatPanel::GetChannel (  )  const

Definition at line 842 of file chatpanel.cpp.

wxString ChatPanel::GetChatTypeStr (  )  const

Definition at line 718 of file chatpanel.cpp.

size_t ChatPanel::GetIconIndex (  )  const [inline]

Definition at line 113 of file chatpanel.h.

const User & ChatPanel::GetMe (  )  const

Definition at line 361 of file chatpanel.cpp.

ChatPanelType ChatPanel::GetPanelType (  )  const

Definition at line 931 of file chatpanel.cpp.

const User * ChatPanel::GetSelectedUser (  )  const

Definition at line 350 of file chatpanel.cpp.

const Server * ChatPanel::GetServer (  )  const

Definition at line 873 of file chatpanel.cpp.

const User * ChatPanel::GetUser (  )  const

Definition at line 901 of file chatpanel.cpp.

bool ChatPanel::IsOk (  )  const

Definition at line 1080 of file chatpanel.cpp.

bool ChatPanel::IsServerPanel (  )  const

Definition at line 926 of file chatpanel.cpp.

void ChatPanel::Joined ( User who  ) 

Definition at line 727 of file chatpanel.cpp.

void ChatPanel::LoadLastLines (  )  [protected]

Definition at line 1248 of file chatpanel.cpp.

void ChatPanel::LogTime (  )  [protected]
void ChatPanel::Motd ( const wxString message  ) 

Output motd sent by server.

Parameters:
message The MOTD message to output

Definition at line 681 of file chatpanel.cpp.

void ChatPanel::OnChannelJoin ( User who  ) 

Definition at line 750 of file chatpanel.cpp.

void ChatPanel::OnChanOpts ( wxCommandEvent &  event  ) 

Definition at line 560 of file chatpanel.cpp.

void ChatPanel::OnKeyPressed ( wxKeyEvent &  keyevent  ) 
void ChatPanel::OnKeyReleased ( wxKeyEvent &  keyevent  ) 
void ChatPanel::OnLinkEvent ( wxTextUrlEvent &  event  ) 

Definition at line 551 of file chatpanel.cpp.

void OnLoginSink< ChatPanel >::OnLogin ( EventDataType  data  )  [inline, inherited]

Definition at line 105 of file isink.h.

void ChatPanel::OnLogin ( OnLoginSink< ChatPanel >::EventDataType  data  ) 

Definition at line 1268 of file chatpanel.cpp.

void ChatPanel::OnMenuItem ( wxCommandEvent &  event  ) 

Definition at line 1226 of file chatpanel.cpp.

void ChatPanel::OnMouseDown ( wxMouseEvent &  event  ) 

Definition at line 1135 of file chatpanel.cpp.

void ChatPanel::OnPaste ( wxClipboardTextEvent &  event  ) 

Definition at line 573 of file chatpanel.cpp.

void ChatPanel::OnSay ( wxCommandEvent &  event  ) 

Definition at line 568 of file chatpanel.cpp.

void ChatPanel::OnUserConnected (  ) 

Definition at line 1096 of file chatpanel.cpp.

void ChatPanel::OnUserDisconnected (  ) 

Definition at line 1089 of file chatpanel.cpp.

void ChatPanel::OutputLine ( const ChatLine line  )  [protected]

Definition at line 399 of file chatpanel.cpp.

void ChatPanel::OutputLine ( const wxString message,
const wxColour &  col,
const wxFont &  fon 
) [protected]

Definition at line 366 of file chatpanel.cpp.

void ChatPanel::Part (  ) 

Definition at line 1069 of file chatpanel.cpp.

void ChatPanel::Parted ( User who,
const wxString message 
)

Definition at line 766 of file chatpanel.cpp.

void ChatPanel::Said ( const wxString who,
const wxString message 
)

Output a message said in the channel.

Parameters:
who nick of the person who said something.
message the message to be outputted.

Definition at line 599 of file chatpanel.cpp.

bool ChatPanel::Say ( const wxString message  ) 
Returns:
true on success ( blank line ), false otherwise

this instance is not replaced with GetAppname for sake of help/debug online

Definition at line 953 of file chatpanel.cpp.

void ChatPanel::SetBattle ( Battle battle  ) 

Definition at line 1231 of file chatpanel.cpp.

void ChatPanel::SetChannel ( Channel chan  ) 

Definition at line 847 of file chatpanel.cpp.

void ChatPanel::SetIconHighlight ( HighlightType  highlight  )  [protected]

TODO: return afterwards?

Definition at line 1162 of file chatpanel.cpp.

void ChatPanel::SetIconIndex ( size_t  index  )  [inline]

Definition at line 114 of file chatpanel.h.

void ChatPanel::SetServer ( Server serv  ) 

Definition at line 878 of file chatpanel.cpp.

void ChatPanel::SetTopic ( const wxString who,
const wxString message 
)

Definition at line 801 of file chatpanel.cpp.

void ChatPanel::SetUser ( const User usr  ) 

Definition at line 906 of file chatpanel.cpp.

void ChatPanel::SortNickList (  ) 

Definition at line 1157 of file chatpanel.cpp.

void ChatPanel::StatusMessage ( const wxString message  ) 

Definition at line 690 of file chatpanel.cpp.

void ChatPanel::UnknownCommand ( const wxString command,
const wxString params 
)

Definition at line 709 of file chatpanel.cpp.

void ChatPanel::UpdateNicklistHighlights (  ) 

Definition at line 1150 of file chatpanel.cpp.

void ChatPanel::UserStatusUpdated ( User who  ) 

Definition at line 828 of file chatpanel.cpp.


Friends And Related Function Documentation

friend class ChatPanelMenu [friend]

the mouse event sink sets this

Definition at line 205 of file chatpanel.h.


Field Documentation

User object.

Definition at line 176 of file chatpanel.h.

std::vector<ChatLine> ChatPanel::m_buffer [protected]

Definition at line 200 of file chatpanel.h.

wxBitmapButton* ChatPanel::m_chan_opts_button [protected]

The channel options button.

Definition at line 165 of file chatpanel.h.

Definition at line 182 of file chatpanel.h.

Channel object.

Definition at line 173 of file chatpanel.h.

Definition at line 186 of file chatpanel.h.

Panel containing the chat. Only used when nicklist is visible.

Definition at line 160 of file chatpanel.h.

wxBoxSizer* ChatPanel::m_chat_sizer [protected]

Sizer containing the chat messages, and send input and button.

Definition at line 155 of file chatpanel.h.

Definition at line 171 of file chatpanel.h.

wxTextCtrl* ChatPanel::m_chatlog_text [protected]

The chat log textcontrol.

Definition at line 163 of file chatpanel.h.

bool ChatPanel::m_disable_append [protected]

Definition at line 201 of file chatpanel.h.

const int ChatPanel::m_groupMenu_baseID = 6798 [static, protected]

Definition at line 197 of file chatpanel.h.

size_t ChatPanel::m_icon_index [protected]

Definition at line 193 of file chatpanel.h.

Definition at line 195 of file chatpanel.h.

wxBoxSizer* ChatPanel::m_main_sizer [protected]

Main sizer containing all other sizers.

Definition at line 154 of file chatpanel.h.

wxComboBox* ChatPanel::m_nick_filter [protected]

The filter combo.

Definition at line 168 of file chatpanel.h.

Panel containing the nicklist.

Definition at line 161 of file chatpanel.h.

wxBoxSizer* ChatPanel::m_nick_sizer [protected]

Sizer containing the nicklist.

Definition at line 157 of file chatpanel.h.

The nicklist.

Definition at line 167 of file chatpanel.h.

Definition at line 110 of file isink.h.

Definition at line 184 of file chatpanel.h.

wxButton* ChatPanel::m_say_button [protected]

The say button.

Definition at line 170 of file chatpanel.h.

wxBoxSizer* ChatPanel::m_say_sizer [protected]

Sizer containing send input and button.

Definition at line 156 of file chatpanel.h.

The say textcontrol.

Definition at line 164 of file chatpanel.h.

Server object.

Definition at line 174 of file chatpanel.h.

bool ChatPanel::m_show_nick_list [protected]

If the nicklist should be shown or not.

Definition at line 152 of file chatpanel.h.

wxSplitterWindow* ChatPanel::m_splitter [protected]

The splitter.

Definition at line 159 of file chatpanel.h.

bool ChatPanel::m_topic_set [protected]

Definition at line 208 of file chatpanel.h.

const ChatPanelType ChatPanel::m_type [protected]

Channel object.

Definition at line 180 of file chatpanel.h.

Definition at line 203 of file chatpanel.h.

const User* ChatPanel::m_user [protected]

User object.

Definition at line 175 of file chatpanel.h.

wxStaticText* ChatPanel::m_usercount_label [protected]

Definition at line 178 of file chatpanel.h.

Definition at line 198 of file chatpanel.h.


The documentation for this class was generated from the following files:

Generated on Thu Dec 29 00:11:43 2011 for SpringLobby by doxygen 1.6.3