[Gcblue-commits] gcb_wx/src/graphics tcChatBox.cpp,1.6,1.7
Status: Alpha
Brought to you by:
ddcforge
From: Dewitt C. <ddc...@us...> - 2006-12-20 01:39:23
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv14177/src/graphics Modified Files: tcChatBox.cpp Log Message: Index: tcChatBox.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcChatBox.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcChatBox.cpp 2 Dec 2006 02:23:48 -0000 1.6 --- tcChatBox.cpp 20 Dec 2006 01:39:20 -0000 1.7 *************** *** 40,43 **** --- 40,45 ---- EVT_COMMAND(1, wxEVT_COMMAND_TEXT_UPDATED, tcChatBox::SendChatText) EVT_COMMAND(86, wxEVT_COMMAND_BUTTON_CLICKED, tcChatBox::OnCloseCommand) + EVT_COMMAND(10, wxEVT_COMMAND_BUTTON_CLICKED, tcChatBox::OnChatModeAll) + EVT_COMMAND(20, wxEVT_COMMAND_BUTTON_CLICKED, tcChatBox::OnChatModeTeam) END_EVENT_TABLE() *************** *** 69,72 **** --- 71,86 ---- } + void tcChatBox::OnChatModeAll(wxCommandEvent& event) + { + chatModeTeam = false; + UpdateChatModeButtons(); + } + + void tcChatBox::OnChatModeTeam(wxCommandEvent& event) + { + chatModeTeam = true; + UpdateChatModeButtons(); + } + /** * Close and destroy window at next safe opportunity *************** *** 127,130 **** --- 141,160 ---- } + void tcChatBox::UpdateChatModeButtons() + { + tcButton* all = GetButtonWithCommand(10); + tcButton* team = GetButtonWithCommand(20); + + if ((all == 0) || (team == 0)) + { + wxASSERT(false); + fprintf(stderr, "tcChatBox::UpdateChatModeButtons - buttons not found\n"); + return; + } + + all->SetOn(!chatModeTeam); + team->SetOn(chatModeTeam); + } + /** *************** *** 134,138 **** const wxPoint& pos, const wxSize& size, const wxString& name, const wxString& configFile) ! : tcXmlWindow(parent, pos, size, configFile, name) { --- 164,169 ---- const wxPoint& pos, const wxSize& size, const wxString& name, const wxString& configFile) ! : tcXmlWindow(parent, pos, size, configFile, name), ! chatModeTeam(false) { *************** *** 167,170 **** --- 198,203 ---- chatEntry->SetClearOnReturn(true); chatEntry->SetBuffer("Enter chat text here"); + + UpdateChatModeButtons(); } |