📄 contentview.cpp
字号:
// contentView.cpp : implementation file
//
#include "stdafx.h"
#include "testCard.h"
#include "contentView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// contentView
IMPLEMENT_DYNCREATE(contentView, CView)
contentView::contentView() : m_sheet("")
{
}
contentView::~contentView()
{
}
BEGIN_MESSAGE_MAP(contentView, CView)
//{{AFX_MSG_MAP(contentView)
ON_WM_SIZE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// contentView drawing
void contentView::OnDraw(CDC* pDC)
{
CDocument* pDoc = GetDocument();
// TODO: add draw code here
}
/////////////////////////////////////////////////////////////////////////////
// contentView diagnostics
#ifdef _DEBUG
void contentView::AssertValid() const
{
CView::AssertValid();
}
void contentView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// contentView message handlers
void contentView::OnInitialUpdate()
{
CView::OnInitialUpdate();
m_sheet.Create(this, WS_CHILD | WS_VISIBLE, 0);
//使选项卡的按钮在下面
// ::SetWindowLong(m_messageSheet.GetTabControl()->m_hWnd, GWL_STYLE,
// ::GetWindowLong(m_messageSheet.GetTabControl()->m_hWnd, GWL_STYLE) | TCS_BOTTOM);
if(m_sheet.m_hWnd)
m_sheet.ShowWindow(SW_MAXIMIZE);//显示选项卡
}
void contentView::OnSize(UINT nType, int cx, int cy)
{
// CView::OnSize(nType, cx, cy);
this->ShowWindow(SW_MAXIMIZE);
CWnd *psheet = this->GetWindow(GW_CHILD);//m_messageSheet是resultview的唯一顶层子窗口
if(psheet != NULL){
CRect rect;
this->GetWindowRect(&rect);
psheet->ScreenToClient(&rect);
psheet->SetWindowPos(NULL, 0, 0, rect.Width() , rect.Height() ,
SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE);
CWnd *ptab = this->m_sheet.GetTabControl();
if(ptab != NULL){
ptab->ScreenToClient(&rect);
ptab->SetWindowPos(NULL, 0, 0, rect.Width(), rect.Height(),
SWP_NOZORDER | SWP_NOACTIVATE);
//让PropertySheet自动调整page的大小
this->m_sheet.SetActivePage(this->m_sheet.GetActiveIndex());
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -