-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathFilePropsDlg.cpp
114 lines (102 loc) · 2.66 KB
/
FilePropsDlg.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/******************************************************************************
** (C) Chris Oldwood
**
** MODULE: FILEPROPSDLG.CPP
** COMPONENT: The Application
** DESCRIPTION: CFilePropsDlg class definition.
**
*******************************************************************************
*/
#include "Common.hpp"
#include "FilePropsDlg.hpp"
#include "UTCMGRApp.hpp"
#include "HelpTopics.h"
/******************************************************************************
** Method: Default constructor.
**
** Description: .
**
** Parameters: None.
**
** Returns: Nothing.
**
*******************************************************************************
*/
CFilePropsDlg::CFilePropsDlg()
: CDialog(IDD_PROPERTIES)
{
DEFINE_CTRL_TABLE
CTRL(IDC_FILE_ICON, &m_scIcon )
CTRL(IDC_REAL_NAME, &m_txtRealName )
CTRL(IDC_CACHE_NAME, &m_txtCacheName)
CTRL(IDC_FILE_DATE, &m_txtDate )
CTRL(IDC_FILE_TYPE, &m_txtType )
CTRL(IDC_FILE_SIZE, &m_txtSize )
END_CTRL_TABLE
DEFINE_CTRLMSG_TABLE
END_CTRLMSG_TABLE
}
/******************************************************************************
** Method: OnInitDialog()
**
** Description: Initialise the dialog.
**
** Parameters: None.
**
** Returns: Nothing.
**
*******************************************************************************
*/
void CFilePropsDlg::OnInitDialog()
{
// Initialise the controls.
m_scIcon.Icon(FileIcon(m_cType));
m_txtRealName.Text(m_strRealName);
m_txtCacheName.Text(m_strCacheName);
m_txtDate.Text(m_strDate);
m_txtType.Text(m_strType);
m_txtSize.Text(m_strSize);
}
/******************************************************************************
** Method: FileIcon()
**
** Description: Get the icon for the file type.
**
** Parameters: cType The file type.
**
** Returns: The icon ID.
**
*******************************************************************************
*/
uint CFilePropsDlg::FileIcon(tchar cType)
{
switch (cType)
{
case SYSTEM_FILE: return IDI_SYSTEM;
case MAP_FILE: return IDI_MAP;
case TEXTURE_FILE: return IDI_TEXTURE;
case SOUND_FILE: return IDI_SOUND;
case MUSIC_FILE: return IDI_MUSIC;
case MESH_FILE: return IDI_MESH;
case ANIM_FILE: return IDI_ANIM;
case KARMA_FILE: return IDI_KARMA;
}
ASSERT_FALSE();
return IDR_APPICON;
}
/******************************************************************************
** Method: OnHelp()
**
** Description: Help requested for the dialog.
**
** Parameters: See HELPINFO.
**
** Returns: Nothing.
**
*******************************************************************************
*/
void CFilePropsDlg::OnHelp(HELPINFO& /*oInfo*/)
{
// Show the dialogs help topic.
App.m_oHelpFile.Topic(IDH_PROPSDLG);
}