Changeset 27 in chevmsgr


Ignore:
Timestamp:
11/29/15 21:05:47 (8 years ago)
Author:
cheese
Message:

UI
1:1 구현

Location:
trunk/msvc14/ChevMsgrClient_MFC
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/msvc14/ChevMsgrClient_MFC/AddFriendDlg.cpp

    r26 r27  
    66#include "AddFriendDlg.h"
    77#include "afxdialogex.h"
    8 #include "ChevMsgrClient_MFCDlg.h"
    98
    109
     
    4140    // TODO: ¿©±â¿¡ ÄÁÆ®·Ñ ¾Ë¸² 󸮱â Äڵ带 Ãß°¡ÇÕ´Ï´Ù.
    4241    CString friendId;
    43     CChevMsgrClient_MFCDlg MsgrClntDlg;
    44    
     42       
    4543    GetDlgItemText(IDC_EDIT_FRIEND_ID, friendId);
    4644    chev->addFriend(cstr2str(friendId));
    4745
    48     MsgrClntDlg.mFriendListBox.InsertString(MsgrClntDlg.mFriendListBox.GetCount(), friendId);
     46    mMsgrClntDlg->mFriendListBox.InsertString(mMsgrClntDlg->mFriendListBox.GetCount(), friendId);
    4947
    5048    CDialogEx::OnOK();
  • trunk/msvc14/ChevMsgrClient_MFC/AddFriendDlg.h

    r26 r27  
    11#pragma once
    22#include "msgclnt.h"
     3#include "ChevMsgrClient_MFCDlg.h"
     4
    35
    46// CAddFriendDlg ´ëÈ­ »óÀÚÀÔ´Ï´Ù.
     
    1214    virtual ~CAddFriendDlg();
    1315    chev *chev;
     16    CChevMsgrClient_MFCDlg *mMsgrClntDlg;
    1417
    1518// ´ëÈ­ »óÀÚ µ¥ÀÌÅÍÀÔ´Ï´Ù.
  • trunk/msvc14/ChevMsgrClient_MFC/AddGroupChat.cpp

    r26 r27  
    2525{
    2626    CDialogEx::DoDataExchange(pDX);
     27    DDX_Control(pDX, IDC_LIST_FRIEND_TO_CHAT, mFriendListToChat);
     28    DDX_Control(pDX, IDC_LIST_SELECTED_FRIEND, mListSelectFriend);
    2729}
    2830
    2931
    3032BEGIN_MESSAGE_MAP(CAddGroupChatDlg, CDialogEx)
    31     ON_LBN_SELCHANGE(IDC_LIST_FRIEND_TO_CHAT, &CAddGroupChatDlg::OnLbnSelchangeListFriendToChat)
    3233    ON_BN_CLICKED(IDC_ADD_LIST, &CAddGroupChatDlg::OnBnClickedAddList)
     34    ON_BN_CLICKED(IDOK, &CAddGroupChatDlg::OnBnClickedOk)
     35    ON_BN_CLICKED(IDC_REMOVE_LIST, &CAddGroupChatDlg::OnBnClickedRemoveList)
    3336END_MESSAGE_MAP()
    3437
    3538
    3639// CAddGroupChat ¸Þ½ÃÁö 󸮱âÀÔ´Ï´Ù.
    37 
    38 
    39 void CAddGroupChatDlg::OnLbnSelchangeListFriendToChat()
     40void CAddGroupChatDlg::OnBnClickedAddList()
    4041{
    4142    // TODO: ¿©±â¿¡ ÄÁÆ®·Ñ ¾Ë¸² 󸮱â Äڵ带 Ãß°¡ÇÕ´Ï´Ù.
     
    4445
    4546
    46 void CAddGroupChatDlg::OnBnClickedAddList()
     47void CAddGroupChatDlg::OnBnClickedOk()
     48{
     49    // TODO: ¿©±â¿¡ ÄÁÆ®·Ñ ¾Ë¸² 󸮱â Äڵ带 Ãß°¡ÇÕ´Ï´Ù.
     50
     51    CDialogEx::OnOK();
     52}
     53
     54
     55void CAddGroupChatDlg::OnBnClickedRemoveList()
    4756{
    4857    // TODO: ¿©±â¿¡ ÄÁÆ®·Ñ ¾Ë¸² 󸮱â Äڵ带 Ãß°¡ÇÕ´Ï´Ù.
  • trunk/msvc14/ChevMsgrClient_MFC/AddGroupChat.h

    r26 r27  
    11#pragma once
    22#include "msgclnt.h"
     3#include "afxwin.h"
    34
    45// CAddGroupChat ´ëÈ­ »óÀÚÀÔ´Ï´Ù.
     
    2324    DECLARE_MESSAGE_MAP()
    2425public:
    25     afx_msg void OnLbnSelchangeListFriendToChat();
    2626    afx_msg void OnBnClickedAddList();
     27    afx_msg void OnBnClickedOk();
     28    afx_msg void OnBnClickedRemoveList();
     29    CListBox mFriendListToChat;
     30    CListBox mListSelectFriend;
    2731};
  • trunk/msvc14/ChevMsgrClient_MFC/ChevMsgrClient_MFCDlg.cpp

    r25 r27  
    222222int cb_listen(SConversation & chat)
    223223{
    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);
    226228
    227229    return 0;
     
    239241    CString receiver;
    240242    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;
    243260    conversation.from = this->mId;
    244 
    245     GetDlgItemText(IDC_EDIT_INPUT, chat);
    246261    conversation.message = cstr2str(chat);
    247 
    248     UpdateData(TRUE);
    249262    conversation.sensitive = mCheckedSensitive ? true : false;
    250 
    251     // Ä£±¸ ¼±ÅÃµÈ ¾Öµé ¸®½ºÆ®·Î ³Ñ°Ü¹ÞÀ» °Í.
    252     //conversation.sessid = chev.getSessionID( ´ëÈ­¹æ ÃÊ´ëÇÑ ¾ÆÀ̵𸮽ºÆ® );
    253263
    254264    if (chev.tell(conversation))
    255265        mChatListBox.InsertString(mChatListBox.GetCount(), chat);
     266   
     267    SetDlgItemText(IDC_EDIT_INPUT, _T(""));
    256268}
    257269
     
    263275
    264276    AFDlg.chev = &this->chev;
     277    AFDlg.mMsgrClntDlg = this;
    265278
    266279    AFDlg.DoModal();
  • trunk/msvc14/ChevMsgrClient_MFC/ChevMsgrClient_MFCDlg.h

    r25 r27  
    88
    99// CChevMsgrClient_MFCDlg ´ëÈ­ »óÀÚ
     10typedef struct {
     11    std::string sessionId;
     12    std::list<SConversation> chatList;
     13} Session;
     14
    1015class CChevMsgrClient_MFCDlg : public CDialogEx
    1116{
     
    1419    CChevMsgrClient_MFCDlg(CWnd* pParent = NULL);   // Ç¥ÁØ »ý¼ºÀÚÀÔ´Ï´Ù.
    1520    chev chev;
    16 
     21    std::vector<Session> scl;
     22   
    1723// ´ëÈ­ »óÀÚ µ¥ÀÌÅÍÀÔ´Ï´Ù.
    1824#ifdef AFX_DESIGN_TIME
     
    2329    virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV Áö¿øÀÔ´Ï´Ù.
    2430   
    25 
    2631// ±¸ÇöÀÔ´Ï´Ù.
    2732protected:
Note: See TracChangeset for help on using the changeset viewer.