?? stackstyledlg.cpp
字號:
// StackStyleDlg.cpp : implementation file
//
#include "stdafx.h"
#include "StackStyleDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMTextStackStyleDlg dialog
CMTextStackStyleDlg::CMTextStackStyleDlg(CWnd* pParent /*=NULL*/)
: CDialog(CMTextStackStyleDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CMTextStackStyleDlg)
m_strDownString = _T("");
m_strUpString = _T("");
m_strSizeScale = _T("");
//}}AFX_DATA_INIT
m_fSizeScale=1.0;
}
void CMTextStackStyleDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CMTextStackStyleDlg)
DDX_Control(pDX, IDC_RICHEDIT_UP, m_ctrlRichEditUpString);
DDX_Control(pDX, IDC_RICHEDIT_Down, m_ctrlRichEditDownString);
DDX_Control(pDX, IDC_COMBO_Style, m_ctrlComStyle);
DDX_Control(pDX, IDC_COMBO_Size, m_ctrlComSize);
DDX_Control(pDX, IDC_COMBO_Align, m_ctrlComAlign);
DDX_Text(pDX, IDC_RICHEDIT_Down, m_strDownString);
DDX_Text(pDX, IDC_RICHEDIT_UP, m_strUpString);
DDX_CBString(pDX, IDC_COMBO_Size, m_strSizeScale);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CMTextStackStyleDlg, CDialog)
//{{AFX_MSG_MAP(CMTextStackStyleDlg)
ON_CBN_SELCHANGE(IDC_COMBO_Style, OnSelchangeCOMBOStyle)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMTextStackStyleDlg message handlers
BOOL CMTextStackStyleDlg::OnInitDialog()
{
CDialog::OnInitDialog();
CString strLoad;
///////////////////////////////////////////////////////////
strLoad.LoadString(IDS_StackStyle_H);
char*stringA;
stringA=strLoad.GetBuffer(0);
char seps[] = " ,\t\n";
char *token;
token = strtok( stringA, seps );
while( token != NULL )
{
m_ctrlComStyle.AddString(token);
token = strtok( NULL, seps );
}
strLoad.ReleaseBuffer(-1);
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
strLoad.LoadString(IDS_Stack_Align_T);
stringA=strLoad.GetBuffer(0);
token = strtok( stringA, seps );
while( token != NULL )
{
m_ctrlComAlign.AddString(token);
token = strtok( NULL, seps );
}
strLoad.ReleaseBuffer(-1);
///////////////////////////////////////////////////////////
// TODO: Add extra initialization here
m_ctrlComStyle.SetCurSel(m_iStackStyle);
m_ctrlComAlign.SetCurSel(m_iAlign);
CString strSizeCale;
int iCurrentScale;
iCurrentScale=int(m_fSizeScale*100+0.5);
strSizeCale.Format("%d%%",iCurrentScale);
m_strSizeScale=strSizeCale;
UpdateData(FALSE);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CMTextStackStyleDlg::OnSelchangeCOMBOStyle()
{
// TODO: Add your control notification handler code here
m_iStackStyle=m_ctrlComStyle.GetCurSel();
}
void CMTextStackStyleDlg::OnOK()
{
// TODO: Add extra validation here
UpdateData();
m_fSizeScale=float(atof(m_strSizeScale));
m_fSizeScale/=100;
m_iAlign=m_ctrlComAlign.GetCurSel();
if (m_fSizeScale<=0)
{
AfxMessageBox(IDS_Stack_Scale_Prompt,MB_ICONINFORMATION);
return;
}
CDialog::OnOK();
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -