⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 inschar.cpp

📁 微型文本编辑器. 多文档界面
💻 CPP
字号:
// InsChar.cpp : implementation file
//

#include "stdafx.h"
#include "Wediter.h"
#include "InsChar.h"

//#include<afxwin.h>

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CInsChar dialog


CInsChar::CInsChar(CWnd* pParent /*=NULL*/)
	: CDialog(CInsChar::IDD, pParent)
{
	//{{AFX_DATA_INIT(CInsChar)
	//}}AFX_DATA_INIT
}

void CInsChar::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CInsChar)
	DDX_Text(pDX, IDC_EDIT_INSCHAR, m_chars);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CInsChar, CDialog)
	//{{AFX_MSG_MAP(CInsChar)
	ON_WM_SHOWWINDOW()
	ON_WM_DESTROY()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CInsChar message handlers

void CInsChar::OnOK() 
{
	// TODO: Add extra validation here

	//CEdit* pEdit=pEdit=(CEdit*)
	//	AfxGetApp()->m_pMainWnd->GetTopWindow()->GetDescendantWindow(AfxGetApp()->m_pMainWnd->GetTopWindow()->GetDlgCtrlID());
	
	if(pview)
	{
		int nFrom, nTo;
		CString m_inchar;
		m_EditBox.GetSel(nFrom, nTo);
		m_inchar=m_chars.Mid(nFrom,2);
		pview->GetEditCtrl().ReplaceSel(m_inchar,TRUE);
	}

    this->m_EditBox.SetFocus();
	//CDialog::OnOK();
	//CDialog::DestroyWindow();
}

BOOL CInsChar::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	//IDC_EDIT_INSCHAR为编辑框控件的ID
	m_EditBox.SubclassDlgItem(IDC_EDIT_INSCHAR,this);
	CenterWindow();
	// TODO: Add extra initialization here
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CInsChar::OnShowWindow(BOOL bShow, UINT nStatus) 
{
	CDialog::OnShowWindow(bShow, nStatus);
	
	// TODO: Add your message handler code here
	m_EditBox.SetFocus();
}

void CInsChar::OnDestroy() 
{
	CDialog::OnDestroy();

	delete this;
	// TODO: Add your message handler code here
	
}

void CInsChar::OnCancel() 
{
	// TODO: Add extra cleanup here
	
	CDialog::OnCancel();
	CDialog::DestroyWindow();
}


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -