home *** CD-ROM | disk | FTP | other *** search
- // MinSplitSizeView.cpp : implementation of the CMinSplitSizeView class
- //
-
- #include "stdafx.h"
- #include "MinSplitSize.h"
-
- #include "MinSplitSizeDoc.h"
- #include "MinSplitSizeView.h"
-
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
- // CMinSplitSizeView
-
- IMPLEMENT_DYNCREATE(CMinSplitSizeView, CView)
-
- BEGIN_MESSAGE_MAP(CMinSplitSizeView, CView)
- //{{AFX_MSG_MAP(CMinSplitSizeView)
- // 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
- END_MESSAGE_MAP()
-
- /////////////////////////////////////////////////////////////////////////////
- // CMinSplitSizeView construction/destruction
-
- CMinSplitSizeView::CMinSplitSizeView()
- {
- // TODO: add construction code here
-
- }
-
- CMinSplitSizeView::~CMinSplitSizeView()
- {
- }
-
- BOOL CMinSplitSizeView::PreCreateWindow(CREATESTRUCT& cs)
- {
- // TODO: Modify the Window class or styles here by modifying
- // the CREATESTRUCT cs
-
- return CView::PreCreateWindow(cs);
- }
-
- /////////////////////////////////////////////////////////////////////////////
- // CMinSplitSizeView drawing
-
- void CMinSplitSizeView::OnDraw(CDC* pDC)
- {
- CMinSplitSizeDoc* pDoc = GetDocument();
- ASSERT_VALID(pDoc);
-
- CRect rcClient;
- GetClientRect( rcClient );
-
- CRect rcDraw( rcClient );
-
- int xCenter = rcDraw.right / 2;
- rcDraw.left = xCenter - 20;
- rcDraw.right = xCenter + 20;
-
- int yCenter = rcDraw.bottom / 2;
- rcDraw.top = yCenter - 20;
- rcDraw.bottom = yCenter + 20;
-
- CBrush brushGUI(GetSysColor(COLOR_3DFACE));
- pDC->FillRect( rcDraw, &brushGUI );
-
- CString str;
- str.Format( "%d x %d", rcClient.Width(), rcClient.Height() );
- pDC->DrawText( str, rcDraw, DT_CENTER | DT_VCENTER | DT_NOCLIP );
- }
-
- /////////////////////////////////////////////////////////////////////////////
- // CMinSplitSizeView diagnostics
-
- #ifdef _DEBUG
- void CMinSplitSizeView::AssertValid() const
- {
- CView::AssertValid();
- }
-
- void CMinSplitSizeView::Dump(CDumpContext& dc) const
- {
- CView::Dump(dc);
- }
-
- CMinSplitSizeDoc* CMinSplitSizeView::GetDocument() // non-debug version is inline
- {
- ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMinSplitSizeDoc)));
- return (CMinSplitSizeDoc*)m_pDocument;
- }
- #endif //_DEBUG
-
- /////////////////////////////////////////////////////////////////////////////
- // CMinSplitSizeView message handlers
-