16,550
社区成员
发帖
与我相关
我的任务
分享
lass CReceive_Note : public CDialog
{
// Construction
public:
CReceive_Note(CWnd* pParent = NULL); // standard constructor
DECLARE_DYNCREATE(CReceive_Note)
// Dialog Data
//{{AFX_DATA(CReceive_Note)
enum { IDD = IDD_RECEIVENOTE };
//}}AFX_DATA
CListCtrl m_receivenote;
void InitListCtrl();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CReceive_Note)
public:
// virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CReceive_Note)
afx_msg void OnPaint();
virtual BOOL OnInitDialog();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_RECEIVE_NOTE_H__74D495D8_E246_48CD_A514_BC4781D4B774__INCLUDED_)
// Receive_Note.cpp : implementation file
//
#include "stdafx.h"
#include "BarDemo.h"
#include "Receive_Note.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CReceive_Note dialog
IMPLEMENT_DYNCREATE(CReceive_Note, CDialog)
CReceive_Note::CReceive_Note(CWnd* pParent /*=NULL*/)
: CDialog(CReceive_Note::IDD, pParent)
{
//{{AFX_DATA_INIT(CReceive_Note)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CReceive_Note::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CReceive_Note)
DDX_Control(pDX, IDC_LIST1, m_receivenote);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CReceive_Note, CDialog)
//{{AFX_MSG_MAP(CReceive_Note)
ON_WM_PAINT()
ON_WM_CREATE()
ON_WM_SHOWWINDOW()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CReceive_Note message handlers
void CReceive_Note::InitListCtrl()
{///////////////////////////////////////////////////////////////////////////////
// Name: InitListCtrl
// Description:
// Initialize the list control style and the list control header.
// Effect:
// Call by OnInitDialog()
// Parameters: None
// Return: void
// Author: L.F.
// Date: 2005.9.30
///////////////////////////////////////////////////////////////////////////////
DWORD dwExStyle = LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES;
m_receivenote.SetExtendedStyle( dwExStyle );
// m_receivenote.SetBkColor( RGB(0xe6,0xe6,0xfa) );
m_receivenote.SetTextBkColor( RGB( 100, 180, 250 ) );
// m_receivenote.SetTextBkColor( RGB(0xe6,0xe6,0xfa) );
LVCOLUMN lvcol;
lvcol.mask = LVCF_FMT | LVCF_SUBITEM | LVCF_TEXT | LVCF_WIDTH;
lvcol.fmt = LVCFMT_CENTER;
lvcol.iSubItem = 1;
lvcol.cx = 160;
lvcol.pszText = _T( "到达时间" );
m_receivenote.InsertColumn( 0, & lvcol );
lvcol.pszText = _T( "消息类型" );
m_receivenote.InsertColumn( 1, & lvcol );
lvcol.cx = 420;
lvcol.pszText = _T( "消息内容" );
m_receivenote.InsertColumn( 2, & lvcol );
lvcol.cx = 200;
lvcol.pszText = _T( "其它" );
m_receivenote.InsertColumn( 3, & lvcol );
lvcol.cx = 300;
lvcol.pszText = _T( "" );
m_receivenote.InsertColumn( 4, & lvcol );
CFont m_Font;
VERIFY(m_Font.CreateFont(
//(15,0,0,0,0,FALSE,FALSE,0,0,0,0,0,0,_TEXT("宋体"))); // lpszFacename
// 20,0,0,0,FW_NORMAL,FALSE,FALSE,0,GB2312_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,DEFAULT_PITCH | FF_SWISS,_T("黑体")));
15, // nHeight
0, // nWidth
0, // nEscapement
0, // nOrientation
0, // nWeight
FALSE, // bItalic
FALSE, // bUnderline
0, // cStrikeOut
ANSI_CHARSET, // nCharSet
OUT_DEFAULT_PRECIS, // nOutPrecision
CLIP_DEFAULT_PRECIS, // nClipPrecision
DEFAULT_QUALITY, // nQuality
DEFAULT_PITCH | FF_SWISS, // nPitchAndFamily
"Arial"));
m_receivenote.GetHeaderCtrl()->SetFont(&m_Font);
// CDC* pDC=GetDC();
// pDC-> SelectObject(&m_Font);
m_receivenote.InsertItem(0, "china ");
// m_receivenote.SetFont(&m_Font);
// m_receivenote.InsertItem(0, "china ");
}
void CReceive_Note::OnPaint()
{
CPaintDC dc(this); // device context for painting
// InitListCtrl();
// TODO: Add your message handler code here
// Do not call CDialog::OnPaint() for painting messages
}
BOOL CReceive_Note::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
InitListCtrl();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
class CSend_Note : public CDialog
{
// Construction
public:
CSend_Note(CWnd* pParent = NULL); // standard constructor
DECLARE_DYNCREATE(CSend_Note)
// Dialog Data
//{{AFX_DATA(CSend_Note)
enum { IDD = IDD_SENDNOTE };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
CListCtrl m_sendnote;
void InitListCtrl();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CSend_Note)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CSend_Note)
virtual BOOL OnInitDialog();
afx_msg void OnPaint();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
// Send_Note.cpp : implementation file
//
#include "stdafx.h"
#include "BarDemo.h"
#include "Send_Note.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CSend_Note dialog
IMPLEMENT_DYNCREATE(CSend_Note, CDialog)
CSend_Note::CSend_Note(CWnd* pParent /*=NULL*/)
: CDialog(CSend_Note::IDD, pParent)
{
//{{AFX_DATA_INIT(CSend_Note)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CSend_Note::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CSend_Note)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CSend_Note, CDialog)
//{{AFX_MSG_MAP(CSend_Note)
ON_WM_PAINT()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSend_Note message handlers
BOOL CSend_Note::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
InitListCtrl();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CSend_Note::InitListCtrl()
{///////////////////////////////////////////////////////////////////////////////
// Name: InitListCtrl
// Description:
// Initialize the list control style and the list control header.
// Effect:
// Call by OnInitDialog()
// Parameters: None
// Return: void
// Author: L.F.
// Date: 2005.9.30
///////////////////////////////////////////////////////////////////////////////
DWORD dwExStyle = LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES;
m_sendnote.SetExtendedStyle( dwExStyle );
// m_receivenote.SetBkColor( RGB(0xe6,0xe6,0xfa) );
m_sendnote.SetTextBkColor( RGB( 100, 180, 250 ) );
// m_receivenote.SetTextBkColor( RGB(0xe6,0xe6,0xfa) );
LVCOLUMN lvcol;
lvcol.mask = LVCF_FMT | LVCF_SUBITEM | LVCF_TEXT | LVCF_WIDTH;
lvcol.fmt = LVCFMT_CENTER;
lvcol.iSubItem = 1;
lvcol.cx = 160;
lvcol.pszText = _T( "到达时间" );
m_sendnote.InsertColumn( 0, & lvcol );
lvcol.pszText = _T( "消息类型" );
m_sendnote.InsertColumn( 1, & lvcol );
lvcol.cx = 420;
lvcol.pszText = _T( "消息内容" );
m_sendnote.InsertColumn( 2, & lvcol );
lvcol.cx = 200;
lvcol.pszText = _T( "其它" );
m_sendnote.InsertColumn( 3, & lvcol );
lvcol.cx = 300;
lvcol.pszText = _T( "" );
m_sendnote.InsertColumn( 4, & lvcol );
CFont m_Font;
VERIFY(m_Font.CreateFont(
//(15,0,0,0,0,FALSE,FALSE,0,0,0,0,0,0,_TEXT("宋体"))); // lpszFacename
// 20,0,0,0,FW_NORMAL,FALSE,FALSE,0,GB2312_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,DEFAULT_PITCH | FF_SWISS,_T("黑体")));
15, // nHeight
0, // nWidth
0, // nEscapement
0, // nOrientation
0, // nWeight
FALSE, // bItalic
FALSE, // bUnderline
0, // cStrikeOut
ANSI_CHARSET, // nCharSet
OUT_DEFAULT_PRECIS, // nOutPrecision
CLIP_DEFAULT_PRECIS, // nClipPrecision
DEFAULT_QUALITY, // nQuality
DEFAULT_PITCH | FF_SWISS, // nPitchAndFamily
"Arial"));
m_sendnote.GetHeaderCtrl()->SetFont(&m_Font);
// CDC* pDC=GetDC();
// pDC-> SelectObject(&m_Font);
m_sendnote.InsertItem(0, "china ");
// m_receivenote.SetFont(&m_Font);
// m_receivenote.InsertItem(0, "china ");
}
void CSend_Note::OnPaint()
{
CPaintDC dc(this); // device context for painting
// TODO: Add your message handler code here
// Do not call CDialog::OnPaint() for painting messages
}