This commit is contained in:
119
StockServer/MessageView.cpp
Normal file
119
StockServer/MessageView.cpp
Normal file
@@ -0,0 +1,119 @@
|
||||
// MessagesView.cpp : implementation of the CMessagesView class
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "StockServer.h"
|
||||
|
||||
#include "DocumentHelper.h"
|
||||
#include "MessagesView.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMessagesView
|
||||
|
||||
IMPLEMENT_DYNCREATE(CMessagesView, CListView)
|
||||
|
||||
BEGIN_MESSAGE_MAP(CMessagesView, CListView)
|
||||
//{{AFX_MSG_MAP(CMessagesView)
|
||||
// NOTE - the ClassWizard will add and remove mapping macros here.
|
||||
// DO NOT EDIT what you see in these blocks of generated code!
|
||||
//}}AFX_MSG_MAP
|
||||
// Standard printing commands
|
||||
ON_COMMAND(ID_FILE_PRINT, CListView::OnFilePrint)
|
||||
ON_COMMAND(ID_FILE_PRINT_DIRECT, CListView::OnFilePrint)
|
||||
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CListView::OnFilePrintPreview)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMessagesView construction/destruction
|
||||
|
||||
CMessagesView::CMessagesView()
|
||||
{
|
||||
// TODO: add construction code here
|
||||
|
||||
}
|
||||
|
||||
CMessagesView::~CMessagesView()
|
||||
{
|
||||
}
|
||||
|
||||
BOOL CMessagesView::PreCreateWindow(CREATESTRUCT& cs)
|
||||
{
|
||||
// TODO: Modify the Window class or styles here by modifying
|
||||
// the CREATESTRUCT cs
|
||||
|
||||
return CListView::PreCreateWindow(cs);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMessagesView drawing
|
||||
|
||||
void CMessagesView::OnDraw(CDC* pDC)
|
||||
{
|
||||
CDocumentHelper* pDoc = GetDocument();
|
||||
ASSERT_VALID(pDoc);
|
||||
CListCtrl& refCtrl = GetListCtrl();
|
||||
refCtrl.InsertItem(0, "Item!");
|
||||
// TODO: add draw code for native data here
|
||||
}
|
||||
|
||||
void CMessagesView::OnInitialUpdate()
|
||||
{
|
||||
CListView::OnInitialUpdate();
|
||||
|
||||
|
||||
// TODO: You may populate your ListView with items by directly accessing
|
||||
// its list control through a call to GetListCtrl().
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMessagesView printing
|
||||
|
||||
BOOL CMessagesView::OnPreparePrinting(CPrintInfo* pInfo)
|
||||
{
|
||||
// default preparation
|
||||
return DoPreparePrinting(pInfo);
|
||||
}
|
||||
|
||||
void CMessagesView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
|
||||
{
|
||||
// TODO: add extra initialization before printing
|
||||
}
|
||||
|
||||
void CMessagesView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
|
||||
{
|
||||
// TODO: add cleanup after printing
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMessagesView diagnostics
|
||||
|
||||
#ifdef _DEBUG
|
||||
void CMessagesView::AssertValid() const
|
||||
{
|
||||
CListView::AssertValid();
|
||||
}
|
||||
|
||||
void CMessagesView::Dump(CDumpContext& dc) const
|
||||
{
|
||||
CListView::Dump(dc);
|
||||
}
|
||||
|
||||
CDocumentHelper* CMessagesView::GetDocument() // non-debug version is inline
|
||||
{
|
||||
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CDocumentHelper)));
|
||||
return (CDocumentHelper*)m_pDocument;
|
||||
}
|
||||
#endif //_DEBUG
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMessagesView message handlers
|
||||
void CMessagesView::OnStyleChanged(int nStyleType, LPSTYLESTRUCT lpStyleStruct)
|
||||
{
|
||||
//TODO: add code to react to the user changing the view style of your window
|
||||
}
|
||||
Reference in New Issue
Block a user