📄 clockview.h
字号:
// ClockView.h : interface of the CClockView class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_CLOCKVIEW_H__06331F4D_6C94_459F_A2EA_93881C7A5376__INCLUDED_)
#define AFX_CLOCKVIEW_H__06331F4D_6C94_459F_A2EA_93881C7A5376__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "math.h"
class CClockView : public CView
{
protected: // create from serialization only
CClockView();
DECLARE_DYNCREATE(CClockView)
// Attributes
public:
/* 分离当前时间的时、分、秒 */
int hour, minute, second;
/* 设置钟表半径为窗体宽度和高度的最小值的一半的90% */
int ClockRadius;
/* 计算钟表中心位置 */
int CenterX;
int CenterY;
CClockDoc* GetDocument();
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CClockView)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
//}}AFX_VIRTUAL
// Implementation
public:
void DrawNumber(CPaintDC &dc);
virtual ~CClockView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CClockView)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnTimer(UINT nIDEvent);
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
CBitmap m_bTimeBitmap;
};
#ifndef _DEBUG // debug version in ClockView.cpp
inline CClockDoc* CClockView::GetDocument()
{ return (CClockDoc*)m_pDocument; }
#endif
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_CLOCKVIEW_H__06331F4D_6C94_459F_A2EA_93881C7A5376__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -