You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
202 lines
4.8 KiB
C++
202 lines
4.8 KiB
C++
// DlgValStrFixed.cpp : ʵÏÖÎļþ
|
|
//
|
|
|
|
#include "stdafx.h"
|
|
#include "LaiPuLaser.h"
|
|
#include "DlgFontset.h"
|
|
#include "afxdialogex.h"
|
|
#include "CommandModifiFont.h"
|
|
#include "GlobalFunction.h"
|
|
#include "CommandMgr.h"
|
|
// CDlgValStrFixed ¶Ô»°¿ò
|
|
|
|
IMPLEMENT_DYNAMIC(CDlgFontSet, CDialogEx)
|
|
BEGIN_MESSAGE_MAP(CDlgFontSet, CDialogEx)
|
|
ON_BN_CLICKED(IDOK,OnBnClickedOk)
|
|
ON_BN_CLICKED(IDC_ARC_TXT_CHECK, &CDlgFontSet::OnBnClickedArcTxtCheck)
|
|
ON_BN_CLICKED(IDC_GAP_TYPE1, &CDlgFontSet::OnBnClickedGapType1)
|
|
ON_BN_CLICKED(IDC_GAP_TYPE2, &CDlgFontSet::OnBnClickedGapType2)
|
|
END_MESSAGE_MAP()
|
|
|
|
CDlgFontSet::CDlgFontSet(SFontPar FontPar,CWnd* pParent)
|
|
: CDialogEx(CDlgFontSet::IDD,pParent),m_FontPar(FontPar)
|
|
{
|
|
m_FontParTmp = m_FontPar;
|
|
}
|
|
CDlgFontSet::~CDlgFontSet()
|
|
{
|
|
}
|
|
void CDlgFontSet::DoDataExchange(CDataExchange* pDX)
|
|
{
|
|
CDialogEx::DoDataExchange(pDX);
|
|
DDX_Text(pDX, IDC_CHAR_GAP, m_FontParTmp.m_CharGap);
|
|
DDX_Text(pDX, IDC_ARC_RADIUS, m_FontParTmp.m_ArcRadius);
|
|
DDX_Text(pDX, IDC_CHAR_HEIGHT, m_FontParTmp.m_CharHeight);
|
|
DDX_Text(pDX, IDC_ITALIC_ANGLE, m_FontParTmp.m_ItalicAngle);
|
|
DDX_Text(pDX, IDC_ARC_ANGLE, m_FontParTmp.m_ArcAngle);
|
|
|
|
DDX_Control(pDX, IDC_ARC_TXT_CHECK, m_bArcCheck);
|
|
DDX_Control(pDX, IDC_REVERSE_COMBO, m_bReverseComb);
|
|
DDX_Control(pDX, IDC_DIR_COMBO, m_bDirectComb);
|
|
|
|
DDX_Control(pDX, IDC_IN_OUT_SIDE_COB, m_bOutDirComb);
|
|
DDX_Control(pDX, IDC_ARC_RADIUS, m_ArcRadiusEdit);
|
|
DDX_Control(pDX, IDC_ARC_ANGLE, m_ArcAngleEdit);
|
|
|
|
|
|
}
|
|
BOOL CDlgFontSet::OnInitDialog()
|
|
{
|
|
CDialogEx::OnInitDialog();
|
|
|
|
m_bArcCheck.SetCheck(m_FontParTmp.m_bArc);
|
|
|
|
IniGapTypeRadio();
|
|
|
|
EnableArcTxtCtr(m_FontParTmp.m_bArc);
|
|
IniReverseComb(m_FontParTmp.m_bReverse);
|
|
IniOutDirComb(m_FontParTmp.m_bOutDir);
|
|
IniDirComb(m_FontParTmp.m_bVertical);
|
|
|
|
UpdateData(FALSE);
|
|
return TRUE;
|
|
}
|
|
void CDlgFontSet::IniGapTypeRadio()
|
|
{
|
|
if(m_FontParTmp.m_GapType ==SFontPar::_Center)
|
|
{
|
|
((CButton *)GetDlgItem(IDC_GAP_TYPE1))->SetCheck(TRUE);
|
|
}
|
|
else
|
|
{
|
|
((CButton *)GetDlgItem(IDC_GAP_TYPE2))->SetCheck(TRUE);
|
|
}
|
|
//ͼƬ
|
|
{
|
|
HBITMAP hBitmap;
|
|
hBitmap = LoadBitmap(AfxGetInstanceHandle(),MAKEINTRESOURCE(IDB_GAP_TYPE2));
|
|
((CButton *)GetDlgItem(IDC_GAP_TYPE1))->SetBitmap(hBitmap);
|
|
}
|
|
{
|
|
HBITMAP hBitmap;
|
|
hBitmap = LoadBitmap(AfxGetInstanceHandle(),MAKEINTRESOURCE(IDB_GAP_TYPE1));
|
|
((CButton *)GetDlgItem(IDC_GAP_TYPE2))->SetBitmap(hBitmap);
|
|
}
|
|
}
|
|
void CDlgFontSet::IniReverseComb(bool b)
|
|
{
|
|
m_bReverseComb.InsertString(0,"ÕýÐò");
|
|
m_bReverseComb.InsertString(1,"ÄæÐò");
|
|
if(b)
|
|
{
|
|
m_bReverseComb.SetCurSel(1);
|
|
}
|
|
else
|
|
{
|
|
m_bReverseComb.SetCurSel(0);
|
|
}
|
|
}
|
|
void CDlgFontSet::IniDirComb(bool b)
|
|
{
|
|
m_bDirectComb.InsertString(0,"ˮƽ");
|
|
m_bDirectComb.InsertString(1,"´¹Ö±");
|
|
if(b)
|
|
{
|
|
m_bDirectComb.SetCurSel(1);
|
|
}
|
|
else
|
|
{
|
|
m_bDirectComb.SetCurSel(0);
|
|
}
|
|
}
|
|
void CDlgFontSet::IniOutDirComb(bool b)
|
|
{
|
|
m_bOutDirComb.InsertString(0,"ÄÚÏò");
|
|
m_bOutDirComb.InsertString(1,"ÍâÏò");
|
|
if(b)
|
|
{
|
|
m_bOutDirComb.SetCurSel(1);
|
|
}
|
|
else
|
|
{
|
|
m_bOutDirComb.SetCurSel(0);
|
|
}
|
|
}
|
|
//¼ì²éÊäÈë
|
|
bool CDlgFontSet::CheckInput()
|
|
{
|
|
return true;
|
|
}
|
|
//ÉèÖÃÐ޸ĵIJÎÊýÖµ
|
|
void CDlgFontSet::SetFontPar()
|
|
{
|
|
if(m_bReverseComb.GetCurSel()==0)//ÊÇ·ñÄæÐò
|
|
{
|
|
m_FontParTmp.m_bReverse = false;
|
|
}
|
|
else
|
|
{
|
|
m_FontParTmp.m_bReverse = true;
|
|
}
|
|
if(m_bOutDirComb.GetCurSel()==0)//ÊÇ·ñΪÍâÏòÎı¾
|
|
{
|
|
m_FontParTmp.m_bOutDir = false;
|
|
}
|
|
else
|
|
{
|
|
m_FontParTmp.m_bOutDir = true;
|
|
}
|
|
if(m_bDirectComb.GetCurSel()==0)//×Ö·û·½Ïò
|
|
{
|
|
m_FontParTmp.m_bVertical = false;
|
|
}
|
|
else
|
|
{
|
|
m_FontParTmp.m_bVertical = true;
|
|
}
|
|
}
|
|
//´´½¨²¢Ö´ÐÐÐÞ¸ÄÖ¸Áî
|
|
void CDlgFontSet::AddModifiCmd()
|
|
{
|
|
CCommandModifiFont *pCmd = new CCommandModifiFont;
|
|
pCmd->SetStringPar(m_FontPar,true);//±£´æ¾ÉµÄ²ÎÊý
|
|
pCmd->SetStringPar(m_FontParTmp,false);//±£´æеIJÎÊý
|
|
|
|
gCommandMgr.AddUndoCommand(pCmd);
|
|
pCmd->Excute();
|
|
}
|
|
void CDlgFontSet::OnBnClickedArcTxtCheck()
|
|
{
|
|
UpdateData(TRUE);
|
|
m_FontParTmp.m_bArc = m_bArcCheck.GetCheck();
|
|
EnableArcTxtCtr(m_FontParTmp.m_bArc);
|
|
}
|
|
//ÊÇ·ñ½ûÓÃÔ²»¡Îı¾Ïà¹ØµÄ¿Ø¼þ
|
|
void CDlgFontSet::EnableArcTxtCtr(bool b)
|
|
{
|
|
m_ArcRadiusEdit.EnableWindow(b);
|
|
m_ArcAngleEdit.EnableWindow(b);
|
|
}
|
|
//ÒÔÖÐÐĵãΪ»ù×¼¼ÆËã¼ä¸ô
|
|
void CDlgFontSet::OnBnClickedGapType1()
|
|
{
|
|
m_FontParTmp.m_GapType = SFontPar::_Center;
|
|
}
|
|
//ÒÔÉÏÒ»¸ö×Ö·ûµÄ×îÓÒ±ßΪ»ù×¼
|
|
void CDlgFontSet::OnBnClickedGapType2()
|
|
{
|
|
m_FontParTmp.m_GapType = SFontPar::_Boundary;
|
|
}
|
|
void CDlgFontSet::OnBnClickedOk()
|
|
{
|
|
UpdateData(TRUE);
|
|
if(!CheckInput())
|
|
return;
|
|
|
|
//ÉèÖÃÐ޸ĵIJÎÊýÖµ
|
|
SetFontPar();
|
|
|
|
//´´½¨²¢Ö´ÐÐÐÞ¸ÄÖ¸Áî
|
|
AddModifiCmd();
|
|
OnOK();
|
|
} |