diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2005-07-14 18:37:44 +0000 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2005-07-14 18:37:44 +0000 |
commit | f39c10eb760c5f283b9a999eddb0418efa462732 (patch) | |
tree | 85ad8f90c879f123587332339bff511ac52a7f88 /cppe/demo/IceE/chat/ChatClientDlg.cpp | |
parent | More mods to the chat demo (diff) | |
download | ice-f39c10eb760c5f283b9a999eddb0418efa462732.tar.bz2 ice-f39c10eb760c5f283b9a999eddb0418efa462732.tar.xz ice-f39c10eb760c5f283b9a999eddb0418efa462732.zip |
Make hitting return send text
Diffstat (limited to 'cppe/demo/IceE/chat/ChatClientDlg.cpp')
-rw-r--r-- | cppe/demo/IceE/chat/ChatClientDlg.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/cppe/demo/IceE/chat/ChatClientDlg.cpp b/cppe/demo/IceE/chat/ChatClientDlg.cpp index d7b21177a63..a13fa3b8c9b 100644 --- a/cppe/demo/IceE/chat/ChatClientDlg.cpp +++ b/cppe/demo/IceE/chat/ChatClientDlg.cpp @@ -148,20 +148,18 @@ CChatClientDlg::OnSend() return; } - CString strText; + CString text; + _edit->GetWindowText(text); - int len = _edit->LineLength(); - _edit->GetLine(0, strText.GetBuffer(len), len); try { - _chat->say(std::string(strText)); + _chat->say(std::string(text)); } catch(const Ice::ConnectionLostException&) { AfxMessageBox(CString("Login timed out due to inactivity"), MB_OK|MB_ICONEXCLAMATION); EndDialog(0); } - strText.ReleaseBuffer(len); // // Clear text input and reset focus. @@ -204,5 +202,6 @@ CChatClientDlg::OnLogin() ((CButton*)GetDlgItem(IDC_SEND))->EnableWindow(TRUE); (CEdit*)GetDlgItem(IDC_LOG2)->EnableWindow(TRUE); ((CButton*)GetDlgItem(IDC_CONFIG))->SetWindowText("Logout"); + ((CEdit*)GetDlgItem(IDC_LOG))->SetFocus(); } }
|