Добавил:
Studfiles2
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:Курсовой проект / Kyrsovik / TheOne / TheOneView
.cpp// TheOneView.cpp : implementation of the CTheOneView class
//
#include "stdafx.h"
#include "TheOne.h"
#include "TheOneSet.h"
#include "TheOneDoc.h"
#include "TheOneView.h"
#include ".\theoneview.h"
#include "CinemaAddDialog.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CTheOneView
IMPLEMENT_DYNCREATE(CTheOneView, CRecordView)
BEGIN_MESSAGE_MAP(CTheOneView, CRecordView)
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CRecordView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CRecordView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CRecordView::OnFilePrintPreview)
ON_COMMAND(ID_CINEMA_ADD, OnCinemaAdd)
END_MESSAGE_MAP()
// CTheOneView construction/destruction
CTheOneView::CTheOneView()
: CRecordView(CTheOneView::IDD)
{
m_pSet = NULL;
// TODO: add construction code here
}
CTheOneView::~CTheOneView()
{
}
void CTheOneView::DoDataExchange(CDataExchange* pDX)
{
CRecordView::DoDataExchange(pDX);
// you can insert DDX_Field* functions here to 'connect' your controls to the database fields, ex.
// DDX_FieldText(pDX, IDC_MYEDITBOX, m_pSet->m_szColumn1, m_pSet);
// DDX_FieldCheck(pDX, IDC_MYCHECKBOX, m_pSet->m_bColumn2, m_pSet);
// See MSDN and ODBC samples for more information
}
BOOL CTheOneView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CRecordView::PreCreateWindow(cs);
}
void CTheOneView::OnInitialUpdate()
{
m_pSet = &GetDocument()->m_TheOneSet;
CRecordView::OnInitialUpdate();
}
// CTheOneView printing
BOOL CTheOneView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CTheOneView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CTheOneView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
// CTheOneView diagnostics
#ifdef _DEBUG
void CTheOneView::AssertValid() const
{
CRecordView::AssertValid();
}
void CTheOneView::Dump(CDumpContext& dc) const
{
CRecordView::Dump(dc);
}
CTheOneDoc* CTheOneView::GetDocument() const // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CTheOneDoc)));
return (CTheOneDoc*)m_pDocument;
}
#endif //_DEBUG
// CTheOneView database support
CRecordset* CTheOneView::OnGetRecordset()
{
return m_pSet;
}
// CTheOneView message handlers
void CTheOneView::OnCinemaAdd()
{
CCinemaAddDialog add;
add.DoModal();
}
Соседние файлы в папке TheOne