📄 help.cpp
字号:
// Help.cpp : implementation file
//
#include "stdafx.h"
#include "PicImg.h"
#include "Help.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// Help dialog
Help::Help(CWnd* pParent /*=NULL*/)
: CDialog(Help::IDD, pParent)
{
//{{AFX_DATA_INIT(Help)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void Help::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(Help)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(Help, CDialog)
//{{AFX_MSG_MAP(Help)
ON_WM_LBUTTONUP()
ON_WM_PAINT()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// Help message handlers
void Help::OnLButtonUp(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
if(InRect(m_rtsure.left,m_rtsure.top,m_rtsure.right,m_rtsure.bottom,point.x,point.y))
OnOK();
CDialog::OnLButtonUp(nFlags, point);
}
void Help::OnPaint()
{
CPaintDC dc(this); // device context for painting
// TODO: Add your message handler code here
CDC memdc;
memdc.CreateCompatibleDC(&dc);
memdc.SelectObject(m_bg);
dc.BitBlt(0,0,480,320,&memdc,0,0,SRCCOPY);
memdc.DeleteDC();
// Do not call CDialog::OnPaint() for painting messages
}
BOOL Help::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
this->SetWindowPos(NULL, 0, 0, 480, 320, SWP_SHOWWINDOW);
m_bg.LoadBitmap( IDB_HELP );
m_rtsure = CRect(400,250,460,300);
CenterWindow( NULL ); // center to the hpc screen
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
BOOL Help::InRect(int left, int top, int right, int bottom, int px, int py)
{
if((left < 0) || (left > 640))
return FALSE;
if((right < 0) || (right > 640))
return FALSE;
if((top < 0) || (top > 480))
return FALSE;
if((bottom < 0) || (bottom > 480))
return FALSE;
if((px < 0) || (px > 640))
return FALSE;
if((py < 0) || (py > 480))
return FALSE;
if((px>=left)&&(px<=right) && (py>=top)&&(py<=bottom))
return TRUE;
return FALSE;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -