// PSMView.cpp : implementation of the CPSMView class
//

#include "stdafx.h"
#include "PSM.h"

#include "PSMDoc.h"
#include "PSMView.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CPSMView

IMPLEMENT_DYNCREATE(CPSMView, CListView)

BEGIN_MESSAGE_MAP(CPSMView, CListView)
	//{{AFX_MSG_MAP(CPSMView)
	//}}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()

/////////////////////////////////////////////////////////////////////////////
// CPSMView construction/destruction

CPSMView::CPSMView()
{
	// TODO: add construction code here
}

CPSMView::~CPSMView()
{
}

BOOL CPSMView::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs
	return CListView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CPSMView drawing

void CPSMView::OnDraw(CDC* pDC)
{
	CPSMDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	// TODO: add draw code for native data here
}

void CPSMView::OnInitialUpdate()
{
	CListView::OnInitialUpdate();
	GetListCtrl().ModifyStyle(0,LVS_REPORT|LVS_SINGLESEL);
/*	GetDocument()->m_list=&(GetListCtrl());
	while(GetListCtrl().DeleteColumn(0));
	GetListCtrl().InsertColumn(0,APL_T("Свойство"),LVCFMT_LEFT,150);
	GetListCtrl().InsertColumn(1,APL_T("Значение"),LVCFMT_LEFT,300);
	// TODO: You may populate your ListView with items by directly accessing
	//  its list control through a call to GetListCtrl().*/
}

/////////////////////////////////////////////////////////////////////////////
// CPSMView printing

BOOL CPSMView::OnPreparePrinting(CPrintInfo* pInfo)
{
	// default preparation
	return DoPreparePrinting(pInfo);
}

void CPSMView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add extra initialization before printing
}

void CPSMView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add cleanup after printing
}

/////////////////////////////////////////////////////////////////////////////
// CPSMView diagnostics

#ifdef _DEBUG
void CPSMView::AssertValid() const
{
	CListView::AssertValid();
}

void CPSMView::Dump(CDumpContext& dc) const
{
	CListView::Dump(dc);
}

CPSMDoc* CPSMView::GetDocument() // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CPSMDoc)));
	return (CPSMDoc*)m_pDocument;
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CPSMView message handlers
