📄 mainpage.cpp
字号:
// MainPage.cpp : implementation file
//
#include "stdafx.h"
#include "bookMan.h"
#include "MainPage.h"
#include "bookManView.h"
#include "MainFrm.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMainPage dialog
CMainPage::CMainPage(CWnd* pParent /*=NULL*/)
: CDialog(CMainPage::IDD, pParent)
{
//{{AFX_DATA_INIT(CMainPage)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CMainPage::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CMainPage)
DDX_Control(pDX, IDC_LOGO, m_logo);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CMainPage, CDialog)
//{{AFX_MSG_MAP(CMainPage)
ON_WM_CTLCOLOR()
ON_WM_PAINT()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMainPage message handlers
BOOL CMainPage::OnInitDialog()
{
CDialog::OnInitDialog();
//bitmap.LoadBitmap(IDB_LOGO);
//bitmap.GetBitmap(&bm);
brush.CreateSolidBrush(RGB(255,224,240));
CRect logoRect; //LOGO圖片的大小
m_logo.GetClientRect(&logoRect); //得到LOGO圖片的位置大小
((CBookManView *)((CMainFrame *)AfxGetMainWnd())->GetActiveView())->m_tabCtrl.GetClientRect(&tabRect);
SetWindowPos(NULL,0,0,tabRect.Width()-SP_RIGHT,tabRect.Height()-SP_BOTTOM,SWP_NOMOVE);
//設置標簽對話框大小
m_logo.SetWindowPos(NULL,(tabRect.Width()-logoRect.Width()-SP_RIGHT)/2,(tabRect.Height()-logoRect.Height()-SP_BOTTOM)/2,0,0,SWP_NOSIZE);
//設置LOGO圖片位置大小
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
HBRUSH CMainPage::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
return hbr;
}
void CMainPage::OnPaint()
{
CPaintDC dc(this); // device context for painting
//CDC mem;
//mem.CreateCompatibleDC(&dc);
//mem.SelectObject(&bitmap);
//dc.BitBlt((tabRect.Width()-bm.bmWidth)/2,(tabRect.Height()-bm.bmHeight)/2,bm.bmWidth,
// bm.bmHeight,&mem,0,0,SRCCOPY);
}
void CMainPage::OnOK()
{
}
void CMainPage::OnCancel()
{
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -