00001 #pragma once 00002 #include "afxwin.h" 00003 #include "afxcmn.h" 00004 #include "Common/List.h" 00005 #include "Landscape/LandEntity.h" 00006 00007 //----------------------------------- 00008 typedef enum _ENTITYTYPE 00009 { 00010 ET_INT, 00011 ET_FLOAT, 00012 ET_STRING, 00013 ET_VECTOR3D 00014 } ENTITYTYPE; 00015 00016 //----------------------------------- 00017 class CEntityKey 00018 { 00019 public: 00020 CEntityKey() 00021 { 00022 m_pKey = NULL; 00023 m_pValue = NULL; 00024 } 00025 00026 ~CEntityKey() 00027 { 00028 if( m_pKey ) 00029 free( m_pKey ); 00030 if( m_pValue ) 00031 free( m_pValue ); 00032 } 00033 00034 char* m_pKey; 00035 char* m_pValue; 00036 }; 00037 00038 //----------------------------------- 00039 class CEntityDef 00040 { 00041 public: 00042 CEntityDef() 00043 { 00044 m_pClassName = NULL; 00045 } 00046 00047 ~CEntityDef() 00048 { 00049 if( m_pClassName ) 00050 free( m_pClassName ); 00051 00052 CEntityKey* pEntityKey; 00053 while( pEntityKey = m_KeyList.GetFirst() ) 00054 { 00055 m_KeyList.Remove( pEntityKey ); 00056 Deletep( pEntityKey ); 00057 } 00058 } 00059 00060 char* m_pClassName; 00061 KList<CEntityKey*> m_KeyList; 00062 }; 00063 00064 // Boîte de dialogue CBrushUnitsDialog 00065 00066 class CBrushUnitsDialog : public CDialog 00067 { 00068 DECLARE_DYNAMIC(CBrushUnitsDialog) 00069 00070 public: 00071 CBrushUnitsDialog(CWnd* pParent = NULL); // constructeur standard 00072 virtual ~CBrushUnitsDialog(); 00073 00074 KList<CEntityDef*> m_EntityDefList; 00075 KLandEntity m_NewLandEntity; 00076 KLandEntity* m_pLandEntity; 00077 CEntityDef* m_pEntityDef; 00078 KLandEntityKey* m_pSelectedKey; 00079 00080 void Refresh(); 00081 void CreateLandEntity( char* pClassName ); 00082 void SetLandEntity( KLandEntity* pLandEntity ); 00083 ENTITYTYPE GetEntityType( char* pKeyType ); 00084 00085 bool IsCreateMode() { return (m_ButtonCreate.GetCheck() == BST_CHECKED); } 00086 bool IsEditMode() { return (m_ButtonEdit.GetCheck() == BST_CHECKED); } 00087 bool IsDeleteMode() { return (m_ButtonDelete.GetCheck() == BST_CHECKED); } 00088 KLandEntity& GetLandEntity() { return m_NewLandEntity; } 00089 00090 // Données de boîte de dialogue 00091 enum { IDD = IDD_DIALOG_BRUSHUNITS }; 00092 00093 protected: 00094 virtual void DoDataExchange(CDataExchange* pDX); // Prise en charge DDX/DDV 00095 00096 DECLARE_MESSAGE_MAP() 00097 public: 00098 virtual BOOL OnInitDialog(); 00099 protected: 00100 virtual void OnOK(); 00101 virtual void OnCancel(); 00102 public: 00103 CComboBox m_ComboClassName; 00104 CButton m_ButtonCreate; 00105 CButton m_ButtonEdit; 00106 CButton m_ButtonDelete; 00107 CListCtrl m_ListEntity; 00108 afx_msg void OnCbnSelchangeComboClassname(); 00109 afx_msg void OnBnClickedRadioCreate(); 00110 afx_msg void OnBnClickedRadioEdit(); 00111 afx_msg void OnBnClickedRadioDelete2(); 00112 CEdit m_EditValue; 00113 afx_msg void OnNMClickListEntity(NMHDR *pNMHDR, LRESULT *pResult); 00114 CButton m_ButtonSet; 00115 afx_msg void OnBnClickedButtonSet(); 00116 };
1.5.1-p1