SendMsgDlg.h
上传用户:zslianheng
上传日期:2013-04-03
资源大小:946k
文件大小:3k
源码类别:

Linux/Unix编程

开发平台:

Visual C++

  1. /***************************************************************************
  2.  *                                                                         *
  3.  *   This program is free software; you can redistribute it and/or modify  *
  4.  *   it under the terms of the GNU General Public License as published by  *
  5.  *   the Free Software Foundation; either version 2 of the License, or     *
  6.  *   (at your option) any later version.                                   *
  7.  *                                                                         *
  8.  *   copyright            : (C) 2002 by Zhang Yong                         *
  9.  *   email                : z-yong163@163.com                              *
  10.  ***************************************************************************/
  11. #if !defined(AFX_SENDMSGDLG_H__1C2AA9F5_40EE_416A_9BA5_6E0EF34A9B23__INCLUDED_)
  12. #define AFX_SENDMSGDLG_H__1C2AA9F5_40EE_416A_9BA5_6E0EF34A9B23__INCLUDED_
  13. #if _MSC_VER > 1000
  14. #pragma once
  15. #endif // _MSC_VER > 1000
  16. // SendMsgDlg.h : header file
  17. //
  18. #include "MyDlg.h"
  19. #include "icqwindow.h"
  20. #include "BtnST.h"
  21. #include "HistoryListBox.h"
  22. struct SEQ {
  23. uint32 seq;
  24. uint32 uin;
  25. };
  26. /////////////////////////////////////////////////////////////////////////////
  27. // CSendMsgDlg dialog
  28. class CSendMsgDlg : public CMyDlg, public IcqWindow
  29. {
  30. // Construction
  31. public:
  32. CSendMsgDlg(IcqContact *c, CWnd* pParent = NULL);   // standard constructor
  33. // Dialog Data
  34. //{{AFX_DATA(CSendMsgDlg)
  35. enum { IDD = IDD_SEND_MESSAGE };
  36. CTreeCtrl m_recipients;
  37. CEdit m_edtMsg;
  38. CHistoryListBox m_lstHistory;
  39. CRichEditCtrl m_ctlMsgView;
  40. CButtonST m_btnPic;
  41. CString m_msgText;
  42. CString m_uin;
  43. CString m_ipport;
  44. CString m_nick;
  45. CString m_email;
  46. //}}AFX_DATA
  47. public:
  48. virtual bool isSeq(uint32 seq);
  49. virtual void onAck(uint32 seq);
  50. virtual void onSendError(uint32 seq);
  51. void onRecvMessage(IcqMsg &msg);
  52. void sendMessage(const char *text);
  53. void loadHistory();
  54. private:
  55. void enableControls(BOOL enable = TRUE);
  56. void setChatMode(BOOL moveControls = TRUE);
  57. void resize();
  58. void appendMsg(IcqMsg &msg, COLORREF color);
  59. void saveWindowPos();
  60. void initTree();
  61. BOOL onGroupSend();
  62. CSize wholeSize;
  63. int upperHeight, lowerHeight;
  64. int frame;
  65. CImageList imageList;
  66. IcqContact *contact;
  67. IcqMsg msgSent;
  68. BOOL viewHistory;
  69. BOOL groupSend;
  70. list<SEQ> seqList;
  71. // ClassWizard generated virtual function overrides
  72. //{{AFX_VIRTUAL(CSendMsgDlg)
  73. public:
  74. virtual BOOL PreTranslateMessage(MSG* pMsg);
  75. protected:
  76. virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  77. virtual void PostNcDestroy();
  78. //}}AFX_VIRTUAL
  79. // Implementation
  80. protected:
  81. // Generated message map functions
  82. //{{AFX_MSG(CSendMsgDlg)
  83. virtual void OnCancel();
  84. virtual BOOL OnInitDialog();
  85. afx_msg void OnPic();
  86. afx_msg void OnHistory();
  87. afx_msg void OnChatMode();
  88. afx_msg void OnEnter();
  89. afx_msg void OnCtrlEnter();
  90. afx_msg void OnSend();
  91. afx_msg void OnDblclkHistory();
  92. afx_msg void OnTimer(UINT nIDEvent);
  93. afx_msg void OnGroupSend();
  94. //}}AFX_MSG
  95. DECLARE_MESSAGE_MAP()
  96. };
  97. //{{AFX_INSERT_LOCATION}}
  98. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  99. #endif // !defined(AFX_SENDMSGDLG_H__1C2AA9F5_40EE_416A_9BA5_6E0EF34A9B23__INCLUDED_)