29 #include "../../idlib/precompiled.h"
32 #include "../../sys/win32/rc/DeclEditor_resource.h"
34 #include "../comafx/CPathTreeCtrl.h"
38 #ifdef ID_DEBUG_MEMORY
50 { IDOK,
"create new declaration" },
51 { IDCANCEL,
"cancel" },
84 CDialog::DoDataExchange(pDX);
116 CDialog::OnInitDialog();
124 EnableToolTips(
TRUE );
132 ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTW, 0, 0xFFFF, OnToolTipNotify)
133 ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTA, 0, 0xFFFF, OnToolTipNotify)
138 ON_BN_CLICKED(IDOK, OnBnClickedOk)
139 ON_BN_CLICKED(IDCANCEL, OnBnClickedCancel)
151 CDialog::OnActivate( nState, pWndOther, bMinimized );
169 CDialog::OnSetFocus( pOldWnd );
178 return CDialog::OnDestroy();
187 CString typeName, folder, ext;
189 const char *errorTitle =
"Error selecting file.";
192 MessageBox(
"Select a declaration type first.", errorTitle, MB_OK );
198 MessageBox(
"Unknown declaration type.", errorTitle, MB_OK | MB_ICONERROR );
203 case DECL_TABLE: folder =
"materials"; ext =
"(*.mtr)|*.mtr|(*.*)|*.*||";
break;
204 case DECL_MATERIAL: folder =
"materials"; ext =
"(*.mtr)|*.mtr|(*.*)|*.*||";
break;
205 case DECL_SKIN: folder =
"skins"; ext =
"(*.skin)|*.skin|(*.*)|*.*||";
break;
206 case DECL_SOUND: folder =
"sound"; ext =
"(*.sndshd|*.sndshd|(*.*)|*.*||";
break;
207 case DECL_ENTITYDEF: folder =
"def"; ext =
"(*.def)|*.def|(*.decl)|*.decl|(*.*)|*.*||";
break;
208 case DECL_MODELDEF: folder =
"def"; ext =
"(*.def)|*.def|(*.*)|*.*||";
break;
209 case DECL_FX: folder =
"fx"; ext =
"(*.fx)|*.fx|(*.*)|*.*||";
break;
210 case DECL_PARTICLE: folder =
"particles"; ext =
"(*.prt)|*.prt|(*.*)|*.*||";
break;
211 case DECL_AF: folder =
"af"; ext =
"(*.af)|*.af|(*.*)|*.*||";
break;
212 default: folder =
"def"; ext =
"(*.decl)|*.decl|(*.*)|*.*||";
break;
218 CFileDialog dlgFile(
TRUE,
"decl", path, 0, ext,
this );
219 if ( dlgFile.DoModal() == IDOK ) {
231 CString typeName, declName, fileName;
232 const char *errorTitle =
"Error creating declaration.";
235 MessageBox(
"No declaration tree available.", errorTitle, MB_OK | MB_ICONERROR );
240 MessageBox(
"No declaration type selected.", errorTitle, MB_OK | MB_ICONERROR );
245 if ( declName.GetLength() == 0 ) {
246 MessageBox(
"No declaration name specified.", errorTitle, MB_OK | MB_ICONERROR );
251 if ( fileName.GetLength() == 0 ) {
252 MessageBox(
"No file name specified.", errorTitle, MB_OK | MB_ICONERROR );
257 MessageBox(
"Declaration already exists.", errorTitle, MB_OK | MB_ICONERROR );
263 MessageBox(
"Unknown declaration type.", errorTitle, MB_OK | MB_ICONERROR );
BOOL DefaultOnToolTipNotify(const toolTip_t *toolTips, UINT id, NMHDR *pNMHDR, LRESULT *pResult)
HTREEITEM FindItem(const idStr &pathName)
int SetSafeComboBoxSelection(CComboBox *combo, const char *string, int skip)
CONST PIXELFORMATDESCRIPTOR UINT
#define IDC_DECLNEW_EDIT_NEW_NAME
idFileSystem * fileSystem
virtual idDecl * CreateNewDecl(declType_t type, const char *name, const char *fileName)=0
GLuint GLuint GLsizei GLenum type
virtual int GetNumDeclTypes(void) const =0
afx_msg void OnBnClickedOk()
static toolTip_t toolTips[]
afx_msg BOOL OnToolTipNotify(UINT id, NMHDR *pNMHDR, LRESULT *pResult)
virtual void DoDataExchange(CDataExchange *pDX)
afx_msg void OnSetFocus(CWnd *pOldWnd)
virtual const char * GetDeclNameFromType(declType_t type) const =0
idDeclManager * declManager
virtual const char * RelativePathToOSPath(const char *relativePath, const char *basePath="fs_devpath")=0
#define IDC_DECLNEW_EDIT_NEW_FILE
int GetSafeComboBoxSelection(CComboBox *combo, CString &string, int skip)
#define IDC_DECLNEW_COMBO_NEW_TYPE
#define IDC_DECLNEW_BUTTON_NEW_FILE
virtual declType_t GetDeclTypeFromName(const char *typeName) const =0
const char * c_str(void) const
afx_msg void OnBnClickedCancel()
virtual const char * OSPathToRelativePath(const char *OSPath)=0
afx_msg void OnBnClickedFile()
virtual BOOL OnInitDialog()