-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathEsmDialogDlg.h
184 lines (144 loc) · 5.8 KB
/
EsmDialogDlg.h
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
/*===========================================================================
*
* File: Esmdialogdlg.H
* Author: Dave Humphrey (uesp@m0use.net)
* Created On: February 16, 2003
*
* Description
*
*=========================================================================*/
#ifndef __ESMDIALOGDLG_H
#define __ESMDIALOGDLG_H
/*===========================================================================
*
* Begin Required Includes
*
*=========================================================================*/
#include "EsmRecDialog.h"
#include "Resource.h"
#include "EsmListCtrl.h"
/*===========================================================================
* End of Required Includes
*=========================================================================*/
/*===========================================================================
*
* Begin Definitions
*
*=========================================================================*/
/* Used for resizing the window and controls */
#define MWESM_DLGFORM_MINWIDTH 400
#define MWESM_DLGFORM_MINHEIGHT 120
#define MWESM_DLGFORM_HEIGHTMARGIN 80
#define MWESM_DLGFORM_WIDTHMARGIN 20
#define MWESM_DLGFORM_BUTTONWIDTH 60
/* Identifies the type of new info records */
#define MWESM_DLGFORM_CLEANED 2
#define MWESM_DLGFORM_OLDINFO 3
#define MWESM_DLGFORM_ACTIVEINFO 4
#define MWESM_DLGFORM_NEWINFO 5
/*===========================================================================
* End of Definitions
*=========================================================================*/
/*===========================================================================
*
* Begin Type Definitions
*
*=========================================================================*/
/* Holds information on modified info records */
typedef struct {
esmrecinfo_t* pNewRecInfo;
esmrecinfo_t* pRecInfo;
} esminfodata_t;
typedef TPtrArray<esminfodata_t> CEsmInfoDataArray;
/*===========================================================================
* End of Type Definitions
*=========================================================================*/
/*===========================================================================
*
* Begin Class CEsmDialogDlg Definition
*
*=========================================================================*/
class CEsmDialogDlg : public CEsmRecDialog {
DECLARE_DYNCREATE(CEsmDialogDlg);
/*---------- Begin Protected Class Members ------------------------*/
protected:
CEsmDialogue* m_pDialog; /* Current dialog record we are editting */
CEsmInfoDataArray m_NewInfos; /* List of new and modified info records */
CEsmInfo* m_pStartInfo; /* Head of the info linked list */
esmrecinfo_t* m_pNpcFilter; /* Current NPC that we are filtering for */
/*---------- Begin Protected Class Methods ------------------------*/
protected:
/* Clear the new info array */
void ClearNewInfos (void);
/* Copy all INFOs into the record */
void CopyAllInfos (const bool Rename = false);
/* Checks if the info record can be cleaned or not */
bool CanCleanInfo (esmrecinfo_t* pRecInfo);
/* Ensure that the given list index has a new/modified info */
esmrecinfo_t* CreateNewInfo (const int ListIndex);
esmrecinfo_t* CreateNewInfo (esmrecinfo_t* pRecInfo, const bool MustBeNew = false);
/* Attempt to find a new INFO record in the array */
esminfodata_t* FindNewInfo (const TCHAR* pID);
esminfodata_t* FindNewInfo (esmrecinfo_t* pRecInfo);
esmrecinfo_t* GetRecInfo (const TCHAR* pID, const TCHAR* pDialogID = NULL);
/* Helper get/set methods */
void FillInfoList (void);
void UpdateInfoList (const bool FirstUpdate = false);
bool CheckInfoLinks (esmrecinfo_t* pStartInfoRec, const bool FirstUpdate, CEsmNpc* pFilterNpc);
/* Update item data */
virtual int OnUpdateItem (esmrecinfo_t* pRecInfo);
/* Removes the given info from the linked info list */
void RemoveInfo (esmrecinfo_t* pRecInfo);
/*---------- Begin Public Class Methods ---------------------------*/
public:
/* Construction */
CEsmDialogDlg();
virtual ~CEsmDialogDlg();
/* Get class members */
virtual bool IsModified (void);
/* Set or update the record data */
virtual void GetControlData (void);
virtual void SetControlData (void);
/* Dialog Data */
//{{AFX_DATA(CEsmDialogDlg)
enum { IDD = IDD_DIALOGUE_DLG };
CButton m_CancelButton;
CButton m_SaveButton;
CComboBox m_FilterList;
CEsmListCtrl m_InfoList;
//}}AFX_DATA
/* ClassWizard generated virtual function overrides */
//{{AFX_VIRTUAL(CEsmDialogDlg)
protected:
virtual void OnInitialUpdate();
virtual void DoDataExchange(CDataExchange* pDX);
//}}AFX_VIRTUAL
protected:
/* Generated message map functions */
//{{AFX_MSG(CEsmDialogDlg)
afx_msg LRESULT OnRecordDrop (LPARAM lParam, LPARAM wParam);
afx_msg LRESULT OnRecordKey (LPARAM lParam, LPARAM wParam);
afx_msg LRESULT OnEditRecord (LPARAM lParam, LPARAM wParam);
afx_msg LRESULT OnEditInfoRecord (LPARAM lParam, LPARAM wParam);
afx_msg void OnMoveupbutton();
afx_msg void OnMovedownbutton();
afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
afx_msg void OnEditAddnew();
afx_msg void OnEditEdititem();
afx_msg void OnSelchangeFilterlist();
afx_msg void OnEditCreatecopy();
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnEditDelete();
afx_msg void OnEditClean();
//}}AFX_MSG
DECLARE_MESSAGE_MAP();
};
/*===========================================================================
* End of Class CEsmDialogDlg Definition
*=========================================================================*/
//{{AFX_INSERT_LOCATION}}
//}}AFX_INSERT_LOCATION
#endif
/*===========================================================================
* End of File Esmdialogdlg.H
*=========================================================================*/