myedit.cpp
来自「ebook实现上下翻页」· C++ 代码 · 共 69 行
CPP
69 行
// Myedit.cpp : implementation file
//
#include "stdafx.h"
#include "ebook.h"
#include "Myedit.h"
#include "ebookDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// Myedit
int ydown;
int yup;
Myedit::Myedit()
{
}
Myedit::~Myedit()
{
}
BEGIN_MESSAGE_MAP(Myedit, CEdit)
//{{AFX_MSG_MAP(Myedit)
ON_WM_LBUTTONDBLCLK()
ON_WM_LBUTTONDOWN()
ON_WM_LBUTTONUP()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// Myedit message handlers
void Myedit::OnLButtonDblClk(UINT nFlags, CPoint point)//封装一个Edit
{
// TODO: Add your message handler code here and/or call default
SetWindowPos(NULL,28,20,622,355,SWP_SHOWWINDOW );
CEdit::OnLButtonDblClk(nFlags, point);
}
void Myedit::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
ydown=point.y;
CEdit::OnLButtonDown(nFlags, point);
}
void Myedit::OnLButtonUp(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CEbookDlg *MyCEbook;
MyCEbook=( CEbookDlg *)GetParent();//得到父亲窗口
yup=point.y;
if (ydown<yup)
{
MyCEbook->Down();
}
if (ydown>yup)
{
MyCEbook->Up();
}
CEdit::OnLButtonUp(nFlags, point);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?