📄 gotodalg.cpp
字号:
// GotoDalg.cpp : implementation file
//
#include "stdafx.h"
#include "Wediter.h"
#include "GotoDalg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CGotoDalg dialog
CGotoDalg::CGotoDalg(CWnd* pParent /*=NULL*/)
: CDialog(CGotoDalg::IDD, pParent)
{
//{{AFX_DATA_INIT(CGotoDalg)
m_gotonumber = 1;
//}}AFX_DATA_INIT
}
void CGotoDalg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CGotoDalg)
DDX_Text(pDX, IDC_GOTOEDIT, m_gotonumber);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CGotoDalg, CDialog)
//{{AFX_MSG_MAP(CGotoDalg)
ON_WM_DESTROY()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CGotoDalg message handlers
BOOL CGotoDalg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
CenterWindow();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CGotoDalg::OnDestroy()
{
CDialog::OnDestroy();
// TODO: Add your message handler code here
delete this;
}
void CGotoDalg::OnCancel()
{
// TODO: Add extra cleanup here
CDialog::OnCancel();
CDialog::DestroyWindow();
}
void CGotoDalg::OnOK()
{
// TODO: Add extra validation here
if(UpdateData())
{
int nFrom,nTo;
nFrom=pview->GetEditCtrl().GetLineCount();
if (m_gotonumber>nFrom)
m_gotonumber=nFrom;
else if(m_gotonumber<1)
m_gotonumber=1;
//pview->GetEditCtrl().LineScroll(m_gotonumber-1);
nFrom=pview->GetEditCtrl().LineIndex(m_gotonumber-1);
pview->GetEditCtrl().SetSel(nFrom,nFrom);
nTo=pview->GetEditCtrl().LineLength();
pview->GetEditCtrl().SetSel(nFrom,nFrom+nTo);
pview->SetFocus();
}
else
ShowmessgeBar("输入错误!");
//CDialog::OnOK();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -