Changeset 27 in chevmsgr
- Timestamp:
- 11/29/15 21:05:47 (8 years ago)
- Location:
- trunk/msvc14/ChevMsgrClient_MFC
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/msvc14/ChevMsgrClient_MFC/AddFriendDlg.cpp
r26 r27 6 6 #include "AddFriendDlg.h" 7 7 #include "afxdialogex.h" 8 #include "ChevMsgrClient_MFCDlg.h"9 8 10 9 … … 41 40 // TODO: ¿©±â¿¡ ÄÁÆ®·Ñ ¾Ë¸² 󸮱â Äڵ带 Ãß°¡ÇÕ´Ï´Ù. 42 41 CString friendId; 43 CChevMsgrClient_MFCDlg MsgrClntDlg; 44 42 45 43 GetDlgItemText(IDC_EDIT_FRIEND_ID, friendId); 46 44 chev->addFriend(cstr2str(friendId)); 47 45 48 MsgrClntDlg.mFriendListBox.InsertString(MsgrClntDlg.mFriendListBox.GetCount(), friendId);46 mMsgrClntDlg->mFriendListBox.InsertString(mMsgrClntDlg->mFriendListBox.GetCount(), friendId); 49 47 50 48 CDialogEx::OnOK(); -
trunk/msvc14/ChevMsgrClient_MFC/AddFriendDlg.h
r26 r27 1 1 #pragma once 2 2 #include "msgclnt.h" 3 #include "ChevMsgrClient_MFCDlg.h" 4 3 5 4 6 // CAddFriendDlg ´ëÈ »óÀÚÀÔ´Ï´Ù. … … 12 14 virtual ~CAddFriendDlg(); 13 15 chev *chev; 16 CChevMsgrClient_MFCDlg *mMsgrClntDlg; 14 17 15 18 // ´ëÈ »óÀÚ µ¥ÀÌÅÍÀÔ´Ï´Ù. -
trunk/msvc14/ChevMsgrClient_MFC/AddGroupChat.cpp
r26 r27 25 25 { 26 26 CDialogEx::DoDataExchange(pDX); 27 DDX_Control(pDX, IDC_LIST_FRIEND_TO_CHAT, mFriendListToChat); 28 DDX_Control(pDX, IDC_LIST_SELECTED_FRIEND, mListSelectFriend); 27 29 } 28 30 29 31 30 32 BEGIN_MESSAGE_MAP(CAddGroupChatDlg, CDialogEx) 31 ON_LBN_SELCHANGE(IDC_LIST_FRIEND_TO_CHAT, &CAddGroupChatDlg::OnLbnSelchangeListFriendToChat)32 33 ON_BN_CLICKED(IDC_ADD_LIST, &CAddGroupChatDlg::OnBnClickedAddList) 34 ON_BN_CLICKED(IDOK, &CAddGroupChatDlg::OnBnClickedOk) 35 ON_BN_CLICKED(IDC_REMOVE_LIST, &CAddGroupChatDlg::OnBnClickedRemoveList) 33 36 END_MESSAGE_MAP() 34 37 35 38 36 39 // CAddGroupChat ¸Þ½ÃÁö 󸮱âÀÔ´Ï´Ù. 37 38 39 void CAddGroupChatDlg::OnLbnSelchangeListFriendToChat() 40 void CAddGroupChatDlg::OnBnClickedAddList() 40 41 { 41 42 // TODO: ¿©±â¿¡ ÄÁÆ®·Ñ ¾Ë¸² 󸮱â Äڵ带 Ãß°¡ÇÕ´Ï´Ù. … … 44 45 45 46 46 void CAddGroupChatDlg::OnBnClickedAddList() 47 void CAddGroupChatDlg::OnBnClickedOk() 48 { 49 // TODO: ¿©±â¿¡ ÄÁÆ®·Ñ ¾Ë¸² 󸮱â Äڵ带 Ãß°¡ÇÕ´Ï´Ù. 50 51 CDialogEx::OnOK(); 52 } 53 54 55 void CAddGroupChatDlg::OnBnClickedRemoveList() 47 56 { 48 57 // TODO: ¿©±â¿¡ ÄÁÆ®·Ñ ¾Ë¸² 󸮱â Äڵ带 Ãß°¡ÇÕ´Ï´Ù. -
trunk/msvc14/ChevMsgrClient_MFC/AddGroupChat.h
r26 r27 1 1 #pragma once 2 2 #include "msgclnt.h" 3 #include "afxwin.h" 3 4 4 5 // CAddGroupChat ´ëÈ »óÀÚÀÔ´Ï´Ù. … … 23 24 DECLARE_MESSAGE_MAP() 24 25 public: 25 afx_msg void OnLbnSelchangeListFriendToChat();26 26 afx_msg void OnBnClickedAddList(); 27 afx_msg void OnBnClickedOk(); 28 afx_msg void OnBnClickedRemoveList(); 29 CListBox mFriendListToChat; 30 CListBox mListSelectFriend; 27 31 }; -
trunk/msvc14/ChevMsgrClient_MFC/ChevMsgrClient_MFCDlg.cpp
r25 r27 222 222 int cb_listen(SConversation & chat) 223 223 { 224 //gDlg->mChatListBox.InsertString(gDlg->mListBox.GetCount(), ); 225 //gDlg->mChatListBox.InsertString(gDlg->mListBox.GetCount(), ); 224 gDlg->mChatListBox.InsertString(gDlg->mChatListBox.GetCount(), str2cstr(chat.from)); 225 gDlg->mChatListBox.InsertString(gDlg->mChatListBox.GetCount(), str2cstr(chat.message)); 226 227 gDlg->scl[gDlg->mFriendListBox.GetCurSel()].chatList.push_back(chat); 226 228 227 229 return 0; … … 239 241 CString receiver; 240 242 SConversation conversation; 241 242 mFriendListBox.GetText(mFriendListBox.GetCurSel(), receiver); 243 int idx = mFriendListBox.GetCurSel(); 244 245 if (idx < 0) 246 return; 247 248 mFriendListBox.GetText(idx, receiver); 249 GetDlgItemText(IDC_EDIT_INPUT, chat); 250 UpdateData(TRUE); 251 252 if(scl[idx].sessionId == "") 253 { 254 std::vector<std::string> idList; 255 idList.push_back(cstr2str(receiver)); 256 scl[idx].sessionId = chev.getSessionID(idList); 257 } 258 259 conversation.sessid = scl[idx].sessionId; 243 260 conversation.from = this->mId; 244 245 GetDlgItemText(IDC_EDIT_INPUT, chat);246 261 conversation.message = cstr2str(chat); 247 248 UpdateData(TRUE);249 262 conversation.sensitive = mCheckedSensitive ? true : false; 250 251 // Ä£±¸ ¼±ÅÃµÈ ¾Öµé ¸®½ºÆ®·Î ³Ñ°Ü¹ÞÀ» °Í.252 //conversation.sessid = chev.getSessionID( ´ëȹæ ÃÊ´ëÇÑ ¾ÆÀ̵𸮽ºÆ® );253 263 254 264 if (chev.tell(conversation)) 255 265 mChatListBox.InsertString(mChatListBox.GetCount(), chat); 266 267 SetDlgItemText(IDC_EDIT_INPUT, _T("")); 256 268 } 257 269 … … 263 275 264 276 AFDlg.chev = &this->chev; 277 AFDlg.mMsgrClntDlg = this; 265 278 266 279 AFDlg.DoModal(); -
trunk/msvc14/ChevMsgrClient_MFC/ChevMsgrClient_MFCDlg.h
r25 r27 8 8 9 9 // CChevMsgrClient_MFCDlg ´ëÈ »óÀÚ 10 typedef struct { 11 std::string sessionId; 12 std::list<SConversation> chatList; 13 } Session; 14 10 15 class CChevMsgrClient_MFCDlg : public CDialogEx 11 16 { … … 14 19 CChevMsgrClient_MFCDlg(CWnd* pParent = NULL); // Ç¥ÁØ »ý¼ºÀÚÀÔ´Ï´Ù. 15 20 chev chev; 16 21 std::vector<Session> scl; 22 17 23 // ´ëÈ »óÀÚ µ¥ÀÌÅÍÀÔ´Ï´Ù. 18 24 #ifdef AFX_DESIGN_TIME … … 23 29 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV Áö¿øÀÔ´Ï´Ù. 24 30 25 26 31 // ±¸ÇöÀÔ´Ï´Ù. 27 32 protected:
Note:
See TracChangeset
for help on using the changeset viewer.