DragonNest/Client/EtActionTool/SignalListViewDlg.cpp

183 lines
4.4 KiB
C++
Raw Normal View History

2024-12-19 09:48:26 +08:00
// SignalListViewDlg.cpp : <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Դϴ<D4B4>.
//
#include "stdafx.h"
#include "EtActionTool.h"
#include "SignalListViewDlg.h"
#include "GlobalValue.h"
#include "ActionElement.h"
#include "ActionObject.h"
// SignalListViewDlg <20><>ȭ <20><><EFBFBD><EFBFBD><EFBFBD>Դϴ<D4B4>.
#ifdef _EXPORT_EXCEL_ACTION_SIGNAL
IMPLEMENT_DYNAMIC(SignalListViewDlg, CDialog)
SignalListViewDlg::SignalListViewDlg(CWnd* pParent /*=NULL*/)
: CDialog(SignalListViewDlg::IDD, pParent)
, m_EditCtrl_SignalCount(_T(""))
{
}
SignalListViewDlg::~SignalListViewDlg()
{
int c = 10;
}
void SignalListViewDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_COMBO1, m_SignalListComboBox);
DDX_Text(pDX, IDC_EDIT1, m_EditCtrl_SignalCount);
}
BEGIN_MESSAGE_MAP(SignalListViewDlg, CDialog)
ON_CBN_SELCHANGE(IDC_COMBO1, &SignalListViewDlg::OnSignalList)
END_MESSAGE_MAP()
// SignalListViewDlg <20>޽<EFBFBD><DEBD><EFBFBD> ó<><C3B3><EFBFBD><EFBFBD><EFBFBD>Դϴ<D4B4>.
void SignalListViewDlg::OnSignalList()
{
// TODO: <20><><EFBFBD><20><>Ʈ<EFBFBD><C6AE> <20>˸<EFBFBD> ó<><C3B3><EFBFBD><EFBFBD> <20>ڵ带 <20>߰<EFBFBD><DFB0>մϴ<D5B4>.
int nSelectedSel = m_SignalListComboBox.GetCurSel();
if( nSelectedSel < 0 ) {
::MessageBox(NULL, "<EFBFBD>ñ׳<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ּ<EFBFBD><D6BC><EFBFBD>", "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", MB_OK);
return;
}
CActionObject* pActionObject = NULL;
CActionElement* pActionElement = NULL;
pActionObject = dynamic_cast<CActionObject*> ( CGlobalValue::GetInstance().GetControlObject() );
DWORD i, j, n, nCount;
i = j = n = nCount = 0;
char buf[_MAX_PATH] = {0,};
char szSelecteditem[_MAX_PATH] = {0,};
m_EditCtrl_SignalCount.Empty();
m_SignalListComboBox.GetLBText( nSelectedSel, szSelecteditem ) ;
m_strSignalTypeName = szSelecteditem;
// <20>׼<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>
if( pActionObject ) {
for( i = 0; i < pActionObject->GetChildCount(); i++ )
{
pActionElement= dynamic_cast<CActionElement*>( pActionObject->GetChild( i ) );
if( ! pActionElement )
continue;
for( j = 0; j < pActionElement->GetChildCount(); j++ ) {
if( m_strSignalTypeName.Compare( pActionElement->GetChild( j )->GetProperty( 0 )->GetCategory() ) == 0 )
nCount++;
}
}
}
// <20>׼<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>
else {
pActionElement= dynamic_cast<CActionElement*>( CGlobalValue::GetInstance().GetControlObject() );
if( pActionElement == NULL )
return;
for( i = 0; i < pActionElement->GetChildCount(); i++ ) {
if( m_strSignalTypeName.Compare( pActionElement->GetChild( i )->GetProperty( 0 )->GetCategory() ) == 0 )
nCount++;
}
}
m_EditCtrl_SignalCount.Format("%d", nCount );
UpdateData( FALSE );
}
BOOL SignalListViewDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: <20><><EFBFBD><20>߰<EFBFBD> <20>ʱ<EFBFBD>ȭ <20>۾<EFBFBD><DBBE><EFBFBD> <20>߰<EFBFBD><DFB0>մϴ<D5B4>.
CActionObject* pActionObject = NULL;
CActionElement* pActionElement = NULL;
CActionSignal* pSignal = NULL;
pActionObject = dynamic_cast<CActionObject*> ( CGlobalValue::GetInstance().GetControlObject() );
DWORD i, j, n;
i = j = n = 0;
char sComboboxlist[_MAX_PATH] = {0,};
bool bFlag = TRUE;
if( pActionObject ) {
for( i = 0; i < pActionObject->GetChildCount(); i++ )
{
pActionElement= dynamic_cast<CActionElement*>( pActionObject->GetChild( i ) );
if( ! pActionElement )
continue;
for( j = 0; j < pActionElement->GetChildCount(); j ++ ) {
pSignal = dynamic_cast<CActionSignal*>( pActionElement->GetChild( j ) );
if( ! pSignal ) continue;
for( n = 0; n < m_SignalListComboBox.GetCount(); n++ ) {
m_SignalListComboBox.GetLBText( n, sComboboxlist );
if( strcmp( pSignal->GetProperty( 0 )->GetCategory(), sComboboxlist ) == 0) {
bFlag = FALSE;
break;
}
}
if( bFlag ) {
m_SignalListComboBox.AddString( pSignal->GetProperty( 0 )->GetCategory() );
}
bFlag = TRUE;
}
}
}
else {
pActionElement= dynamic_cast<CActionElement*>( CGlobalValue::GetInstance().GetControlObject() );
if( pActionElement == NULL )
return FALSE;
for( j = 0; j < pActionElement->GetChildCount(); j ++ ) {
pSignal = dynamic_cast<CActionSignal*>( pActionElement->GetChild( j ) );
if( ! pSignal ) continue;
for( n = 0; n < m_SignalListComboBox.GetCount(); n++ ) {
m_SignalListComboBox.GetLBText( n, sComboboxlist );
if( strcmp( pSignal->GetProperty( 0 )->GetCategory(), sComboboxlist ) == 0 ) {
bFlag = FALSE;
break;
}
}
if( bFlag ) {
m_SignalListComboBox.AddString( pSignal->GetProperty( 0 )->GetCategory() );
}
bFlag = TRUE;
}
}
return TRUE; // return TRUE unless you set the focus to a control
// <20><><EFBFBD><EFBFBD>: OCX <20>Ӽ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> FALSE<53><45> <20><>ȯ<EFBFBD>ؾ<EFBFBD> <20>մϴ<D5B4>.
}
#endif