View2.cpp
上传用户:szled88
上传日期:2015-04-09
资源大小:43957k
文件大小:3k
- // View2.cpp : implementation file
- //
- // This file is a part of the XTREME TOOLKIT PRO MFC class library.
- // (c)1998-2008 Codejock Software, All Rights Reserved.
- //
- // THIS SOURCE FILE IS THE PROPERTY OF CODEJOCK SOFTWARE AND IS NOT TO BE
- // RE-DISTRIBUTED BY ANY MEANS WHATSOEVER WITHOUT THE EXPRESSED WRITTEN
- // CONSENT OF CODEJOCK SOFTWARE.
- //
- // THIS SOURCE CODE CAN ONLY BE USED UNDER THE TERMS AND CONDITIONS OUTLINED
- // IN THE XTREME TOOLKIT PRO LICENSE AGREEMENT. CODEJOCK SOFTWARE GRANTS TO
- // YOU (ONE SOFTWARE DEVELOPER) THE LIMITED RIGHT TO USE THIS SOFTWARE ON A
- // SINGLE COMPUTER.
- //
- // CONTACT INFORMATION:
- // support@codejock.com
- // http://www.codejock.com
- //
- /////////////////////////////////////////////////////////////////////////////
- #include "stdafx.h"
- #include "SplitterWindow.h"
- #include "View2.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CView2
- IMPLEMENT_DYNCREATE(CView2, CView)
- CView2::CView2()
- {
- }
- CView2::~CView2()
- {
- }
- BEGIN_MESSAGE_MAP(CView2, CView)
- //{{AFX_MSG_MAP(CView2)
- ON_WM_PAINT()
- ON_WM_ERASEBKGND()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CView2 drawing
- void CView2::OnDraw(CDC* pDC)
- {
- // TODO: add draw code here
- CRect r;
- GetClientRect(&r);
- pDC->SetBkMode(TRANSPARENT);
- int x = r.Width()/2 -50;
- int y = r.Height()/2-25;
- CRect rcSquare(x,y,x+100,y+50);
- int iSavedDC = pDC->SaveDC();
- pDC->FillSolidRect(&rcSquare, GetXtremeColor(XPCOLOR_HIGHLIGHT));
- pDC->Draw3dRect(&rcSquare, GetXtremeColor(COLOR_HIGHLIGHT), GetXtremeColor(COLOR_HIGHLIGHT));
- pDC->SelectObject(&XTAuxData().fontBold);
- pDC->SetTextColor(GetXtremeColor(XPCOLOR_HIGHLIGHT_TEXT));
- pDC->SetBkMode(TRANSPARENT);
- pDC->DrawText(_T("View Two"), &r, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
- pDC->RestoreDC(iSavedDC);
- }
- /////////////////////////////////////////////////////////////////////////////
- // CView2 diagnostics
- #ifdef _DEBUG
- void CView2::AssertValid() const
- {
- CView::AssertValid();
- }
- void CView2::Dump(CDumpContext& dc) const
- {
- CView::Dump(dc);
- }
- #endif //_DEBUG
- /////////////////////////////////////////////////////////////////////////////
- // CView2 message handlers
- void CView2::OnPaint()
- {
- // standard paint routine
- CPaintDC dc(this);
- // Get the client rect.
- CRect rectClient;
- GetClientRect(&rectClient);
- // Paint to a memory device context to reduce screen flicker.
- CXTMemDC memDC(&dc, rectClient, GetXtremeColor(COLOR_WINDOW));
- OnPrepareDC(&memDC);
- OnDraw(&memDC);
- }
- BOOL CView2::OnEraseBkgnd(CDC* pDC)
- {
- UNUSED_ALWAYS(pDC);
- return FALSE;
- }