// DlgSkelpart.cpp : implementation file // #include "stdafx.h" #include "worldcreator.h" #include "DlgSkelpart.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CDlgSkelpart dialog CDlgSkelpart::CDlgSkelpart(CWnd* pParent /*=NULL*/) : CDialog(CDlgSkelpart::IDD, pParent) { //{{AFX_DATA_INIT(CDlgSkelpart) m_nSkelpartIndex = -1; m_strSkelpartName = _T(""); //}}AFX_DATA_INIT m_rpGCMDS = NULL; } void CDlgSkelpart::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CDlgSkelpart) DDX_CBIndex(pDX, IDC_COMBO_SKELPARTINDEX, m_nSkelpartIndex); DDX_Text(pDX, IDC_EDIT_SKELPARTNAME, m_strSkelpartName); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CDlgSkelpart, CDialog) //{{AFX_MSG_MAP(CDlgSkelpart) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CDlgSkelpart message handlers void CDlgSkelpart::SetupDialog( const char* szSkelpartName, CZ3DGCMDS* pGCMDS, int nIndex ) { if( NULL == pGCMDS ) { return; } if( NULL == szSkelpartName ) { m_strSkelpartName = ""; } else { m_strSkelpartName = szSkelpartName; } m_rpGCMDS = pGCMDS; m_nSkelpartIndex = nIndex; } BOOL CDlgSkelpart::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here if( m_rpGCMDS ) { CWnd* pCtrlSkelpartIndex = GetDlgItem( IDC_COMBO_SKELPARTINDEX ); pCtrlSkelpartIndex->SendMessage( CB_RESETCONTENT, 0, 0 ); for( int i = 0; i < m_rpGCMDS->GetSkeletonCount(); ++i ) { CString strTemp; strTemp.Format( "%d, %s", i, m_rpGCMDS->GetSkeletonName(i) ); pCtrlSkelpartIndex->SendMessage( CB_INSERTSTRING, -1, (LPARAM)((LPCTSTR)strTemp) ); } UpdateData( FALSE ); } return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }