Files
geomative/GeomativeStudio/cpp/Views/opcreatesptgndlg.cpp
T
coco df489d5640 a
2026-07-03 16:05:30 +08:00

169 lines
4.2 KiB
C++

// opcreatesptgndlg.cpp : implementation file
//
#include "stdafx.h"
#include "geomative.h"
#include "opcreatesptgndlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
extern int g_iUILanguage;
/////////////////////////////////////////////////////////////////////////////
// COpCreateSptGNDlg dialog
COpCreateSptGNDlg::COpCreateSptGNDlg(CWnd* pParent /*=NULL*/)
: CDialog(COpCreateSptGNDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(COpCreateSptGNDlg)
m_iEf = -1;
//}}AFX_DATA_INIT
m_iMaxLevel = (int)VAL_ZERO;
m_iCurLevel = (int)VAL_ZERO;
m_iSelLevel = (int)VAL_ZERO;
m_iN = (int)VAL_ZERO;
}
void COpCreateSptGNDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(COpCreateSptGNDlg)
DDX_Control(pDX, IDC_CB_LEVEL, m_cbLevel);
DDX_Radio(pDX, IDC_RDO1_EF, m_iEf);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(COpCreateSptGNDlg, CDialog)
//{{AFX_MSG_MAP(COpCreateSptGNDlg)
ON_BN_CLICKED(IDC_RDO3_EF, OnRdo3Ef)
ON_BN_CLICKED(IDC_RDO1_EF, OnRdo1Ef)
ON_BN_CLICKED(IDC_RDO2_EF, OnRdo2Ef)
ON_BN_CLICKED(IDC_RDO4_EF, OnRdo4Ef)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// COpCreateSptGNDlg message handlers
BOOL COpCreateSptGNDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
CString szLabel = _T("");
int iCurLevel = (int)VAL_ZERO;
int iN = (int)VAL_ZERO;
m_iEf = (int)VAL_ZERO;
UpdateData(FALSE);
iCurLevel = m_iCurLevel;
m_cbLevel.Clear();
while (iCurLevel <= m_iMaxLevel)
{
szLabel.Empty();
szLabel.Format(_T("%d"), iCurLevel);
m_cbLevel.AddString(szLabel);
m_cbLevel.SetItemData(iCurLevel-m_iCurLevel, iCurLevel);
iCurLevel++;
}
m_cbLevel.SetCurSel((int)m_iCurLevel-1);
((CComboBox*)GetDlgItem(IDC_CB_N))->Clear();
iN = 1;
while (iN <= MAXN)
{
szLabel.Empty();
szLabel.Format(_T("%d"), iN);
((CComboBox*)GetDlgItem(IDC_CB_N))->AddString(szLabel);
iN++;
}
((CComboBox*)GetDlgItem(IDC_CB_N))->SetCurSel((int)m_iN);
InitUIByLanguage(g_iUILanguage);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void COpCreateSptGNDlg::OnRdo3Ef()
{
// TODO: Add your control notification handler code here
m_cbLevel.SetCurSel((int)VAL_ZERO);
this->m_cbLevel.EnableWindow();
}
void COpCreateSptGNDlg::OnRdo1Ef()
{
// TODO: Add your control notification handler code here
this->m_cbLevel.SetCurSel((int)VAL_ZERO);
this->m_cbLevel.EnableWindow(FALSE);
}
void COpCreateSptGNDlg::OnRdo2Ef()
{
// TODO: Add your control notification handler code here
this->m_cbLevel.SetCurSel((int)VAL_ZERO);
this->m_cbLevel.EnableWindow(FALSE);
}
void COpCreateSptGNDlg::OnRdo4Ef()
{
// TODO: Add your control notification handler code here
this->m_cbLevel.SetCurSel((int)VAL_ZERO);
this->m_cbLevel.EnableWindow(FALSE);
}
void COpCreateSptGNDlg::OnOK()
{
// TODO: Add extra validation here
UpdateData();
if (3 == m_iEf)
{
this->m_iSelLevel = (int)(m_cbLevel.GetItemData(m_cbLevel.GetCurSel()));
}
this->m_iN = (int)((CComboBox*)GetDlgItem(IDC_CB_N))->GetCurSel()+1;
CDialog::OnOK();
}
BOOL COpCreateSptGNDlg::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
if(pMsg->message==WM_KEYDOWN && pMsg->wParam==VK_RETURN)
{
return TRUE;
}
if(pMsg->message==WM_KEYDOWN && pMsg->wParam==VK_ESCAPE)
{
return TRUE;
}
return CDialog::PreTranslateMessage(pMsg);
}
void COpCreateSptGNDlg::InitUIByLanguage(int iLanguage)
{
if (LANG_ZHCN == iLanguage)
{
SetWindowText(_T("迭代信息"));
GetDlgItem(IDC_STATIC_EFFECT_RANGER)->SetWindowText(_T("有效范围"));
GetDlgItem(IDC_RDO1_EF)->SetWindowText(_T(" 当前点"));
GetDlgItem(IDC_RDO2_EF)->SetWindowText(_T(" 当前层"));
GetDlgItem(IDC_RDO4_EF)->SetWindowText(_T(" 当前层以及之后的层"));
GetDlgItem(IDC_RDO3_EF)->SetWindowText(_T(" 当前所处的层到"));
GetDlgItem(IDC_STATIC_END_LAYERS)->SetWindowText(_T("层"));
GetDlgItem(IDC_STATIC_STACKING)->SetWindowText(_T(" 迭代数"));
GetDlgItem(IDOK)->SetWindowText(_T("确定"));
GetDlgItem(IDCANCEL)->SetWindowText(_T("取消"));
}
}