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

📄 insupdntext.cpp

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

#include "stdafx.h"
#include "Wediter.h"
#include "insupdntext.h"

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

/////////////////////////////////////////////////////////////////////////////
// Cinsupdntext dialog


Cinsupdntext::Cinsupdntext(CWnd* pParent /*=NULL*/)
	: CDialog(Cinsupdntext::IDD, pParent)
{
	//{{AFX_DATA_INIT(Cinsupdntext)
	m_dntext = _T("");
	m_uptext = _T("");
	//}}AFX_DATA_INIT
}


void Cinsupdntext::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(Cinsupdntext)
	DDX_Text(pDX, IDC_DOWNEDIT, m_dntext);
	DDX_Text(pDX, IDC_UPEDIT, m_uptext);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(Cinsupdntext, CDialog)
	//{{AFX_MSG_MAP(Cinsupdntext)
	ON_WM_DESTROY()
	ON_BN_CLICKED(IDC_CHECK_UPDN, OnCheckUpdn)
	ON_WM_SHOWWINDOW()
	ON_BN_CLICKED(IDC_STATIC_UPDN, OnStaticUpdn)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// Cinsupdntext message handlers

void Cinsupdntext::OnDestroy() 
{
	CDialog::OnDestroy();
	pview->m_nundown=m_undown;
	delete this;
	
	// TODO: Add your message handler code here
	
}

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

void Cinsupdntext::OnOK() 
{
	// TODO: Add extra validation here
	UpdateData();
	CString mstr;
	if((!m_dntext.IsEmpty()) && (!m_uptext.IsEmpty()))
	{
		if(m_undown==1)
			mstr="{\\H0.625x;\\S"+m_uptext+"/"+m_dntext+";\\H1.6x;}";
		else
			mstr="{\\H0.625x;\\S"+m_uptext+"^"+m_dntext+";\\H1.6x;}";
		pview->GetEditCtrl().ReplaceSel(mstr,TRUE);
	}
	//CDialog::OnOK();
}

void Cinsupdntext::OnCheckUpdn() 
{
	// TODO: Add your control notification handler code here
	CButton* pButton=(CButton*)
		this->GetDescendantWindow(IDC_CHECK_UPDN);
	m_undown=pButton->GetCheck();
	pButton=NULL;
	delete pButton;
}

void Cinsupdntext::OnShowWindow(BOOL bShow, UINT nStatus) 
{
	CDialog::OnShowWindow(bShow, nStatus);
	
	// TODO: Add your message handler code here
	CButton* pButton=(CButton*)
		this->GetDescendantWindow(IDC_CHECK_UPDN);
	pButton->SetCheck(m_undown);
	pButton=NULL;
	delete pButton;
}

void Cinsupdntext::OnStaticUpdn() 
{
	// TODO: Add your control notification handler code here
	CButton* pButton=(CButton*)
		this->GetDescendantWindow(IDC_CHECK_UPDN);
	if(pButton->GetCheck()==1)
		m_undown=0;
	else
		m_undown=1;
	pButton->SetCheck(m_undown);
	pButton=NULL;
	delete pButton;
}

⌨️ 快捷键说明

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