📄 childview.cpp
字号:
// ChildView.cpp : implementation of the CChildView class
//
#include "stdafx.h"
#include "ChooseFont.h"
#include "ChildView.h"
#include "CePropertySheet.h"
#include "ChooseFontPage.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CChildView
CChildView::CChildView()
{
}
CChildView::~CChildView()
{
}
BEGIN_MESSAGE_MAP(CChildView,CWnd )
//{{AFX_MSG_MAP(CChildView)
ON_WM_PAINT()
ON_COMMAND(ID_CHOOSE_FONT, OnChooseFont)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CChildView message handlers
BOOL CChildView::PreCreateWindow(CREATESTRUCT& cs)
{
if (!CWnd::PreCreateWindow(cs))
return FALSE;
cs.style &= ~WS_BORDER;
cs.lpszClass = AfxRegisterWndClass(CS_HREDRAW|CS_VREDRAW|CS_DBLCLKS,
NULL, HBRUSH(COLOR_WINDOW+1), NULL);
return TRUE;
}
void CChildView::OnPaint()
{
CPaintDC dc(this); // device context for painting
// TODO: Add your message handler code here
// Do not call CWnd::OnPaint() for painting messages
}
// CChildView::OnChooseFont
//
// Shows the choose font dialog
//
void CChildView::OnChooseFont()
{
CCePropertySheet sheet(_T("Choose Font"));
CChooseFontPage page;
//
// Create the default font
//
page.m_logFont.lfHeight = -11;
page.m_logFont.lfWidth = 0;
page.m_logFont.lfEscapement = 0;
page.m_logFont.lfOrientation = 0;
page.m_logFont.lfWeight = FW_NORMAL;
page.m_logFont.lfItalic = FALSE;
page.m_logFont.lfUnderline = FALSE;
page.m_logFont.lfStrikeOut = 0;
page.m_logFont.lfCharSet = ANSI_CHARSET;
page.m_logFont.lfOutPrecision = OUT_DEFAULT_PRECIS;
page.m_logFont.lfClipPrecision = CLIP_DEFAULT_PRECIS;
page.m_logFont.lfQuality = DEFAULT_QUALITY;
page.m_logFont.lfPitchAndFamily = DEFAULT_PITCH | FF_SWISS;
_tcscpy(page.m_logFont.lfFaceName, TEXT("Tahoma"));
sheet.AddPage(&page);
sheet.DoModal();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -