TabView.cpp
资源名称:TabSample.rar [点击查看]
上传用户:sz86035077
上传日期:2013-02-27
资源大小:40k
文件大小:2k
源码类别:
Tab控件
开发平台:
Visual C++
- // TabView.cpp : implementation of the CTabView class
- //
- #include "stdafx.h"
- #include "Tab.h"
- #include "TabDoc.h"
- #include "TabView.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CTabView
- IMPLEMENT_DYNCREATE(CTabView, CView)
- BEGIN_MESSAGE_MAP(CTabView, CView)
- //{{AFX_MSG_MAP(CTabView)
- ON_WM_CREATE()
- //}}AFX_MSG_MAP
- // Standard printing commands
- ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
- ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
- ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CTabView construction/destruction
- CTabView::CTabView()
- {
- // TODO: add construction code here
- }
- CTabView::~CTabView()
- {
- }
- BOOL CTabView::PreCreateWindow(CREATESTRUCT& cs)
- {
- // TODO: Modify the Window class or styles here by modifying
- // the CREATESTRUCT cs
- return CView::PreCreateWindow(cs);
- }
- /////////////////////////////////////////////////////////////////////////////
- // CTabView drawing
- void CTabView::OnDraw(CDC* pDC)
- {
- CTabDoc* pDoc = GetDocument();
- ASSERT_VALID(pDoc);
- // TODO: add draw code for native data here
- }
- /////////////////////////////////////////////////////////////////////////////
- // CTabView printing
- BOOL CTabView::OnPreparePrinting(CPrintInfo* pInfo)
- {
- // default preparation
- return DoPreparePrinting(pInfo);
- }
- void CTabView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
- {
- // TODO: add extra initialization before printing
- }
- void CTabView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
- {
- // TODO: add cleanup after printing
- }
- /////////////////////////////////////////////////////////////////////////////
- // CTabView diagnostics
- #ifdef _DEBUG
- void CTabView::AssertValid() const
- {
- CView::AssertValid();
- }
- void CTabView::Dump(CDumpContext& dc) const
- {
- CView::Dump(dc);
- }
- CTabDoc* CTabView::GetDocument() // non-debug version is inline
- {
- ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CTabDoc)));
- return (CTabDoc*)m_pDocument;
- }
- #endif //_DEBUG
- /////////////////////////////////////////////////////////////////////////////
- // CTabView message handlers
- int CTabView::OnCreate(LPCREATESTRUCT lpCreateStruct)
- {
- if (CView::OnCreate(lpCreateStruct) == -1)
- return -1;
- // TODO: Add your specialized creation code here
- return 0;
- }