-
Notifications
You must be signed in to change notification settings - Fork 5
/
SrSelectRecordDlg.h
198 lines (158 loc) · 7.59 KB
/
SrSelectRecordDlg.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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
/*===========================================================================
*
* File: Srselectrecorddlg.H
* Author: Dave Humphrey ([email protected])
* Created On: 26 November 2011
*
* Description
*
*=========================================================================*/
#ifndef __SRSELECTRECORDDLG_H
#define __SRSELECTRECORDDLG_H
/*===========================================================================
*
* Begin Required Includes
*
*=========================================================================*/
#include "modfile/srespfile.h"
#include "windows/srrecordvirtuallistctrl.h"
#include "modfile/srmultirecordhandler.h"
#include "afxwin.h"
/*===========================================================================
* End of Required Includes
*=========================================================================*/
/*===========================================================================
*
* Begin Definitions
*
*=========================================================================*/
/*===========================================================================
* End of Definitions
*=========================================================================*/
/*===========================================================================
*
* Begin Type Definitions
*
*=========================================================================*/
/* Optional callback function type */
typedef bool (*SRRECSELDLGCALLBACK) (CSrRecord* pRecord, long UserData);
/* Used to define a selection record dialog */
struct srselrecdlginfo_t
{
const srrectype_t* pRecordType; /* Type of record to display */
const srrectype_t** ppRecordArray;
const TCHAR* pTitle;
srreclistcolinit_t* pListColumns;
const srrecfieldmap_t* pFieldMap;
srrecfieldid_t SortField;
SRRECSELDLGCALLBACK pCheckFunc;
long UserData;
};
/*===========================================================================
* End of Type Definitions
*=========================================================================*/
/*===========================================================================
*
* Begin Class CSrSelectRecordDlg Definition
*
*=========================================================================*/
class CSrSelectRecordDlg : public CDialog {
/*---------- Begin Protected Class Members ---------------------------*/
protected:
srselrecdlginfo_t m_DlgInfo;
srformid_t m_InitialFormID;
CString m_InitialEditorID;
srformid_t m_CurrentFormID;
CString m_CurrentEditorID;
CSrRecord* m_pPrevRecord;
CSrRecord* m_pCurrentRecord;
bool m_AllowNullRecord; /* Allow a null record to be selected */
bool m_IsInitialized;
bool m_ListAllOption;
CSrRecordHandler* m_pRecordHandler;
int m_EditorIDCheck;
bool m_UpdateListOnChange;
srrectype_t m_CurrentTypeFilter;
/*---------- Begin Protected Class Methods ---------------------------*/
protected:
/* Get/set control data */
void GetControlData (void);
void SetControlData (void);
void FillRecordList (void);
void FillRecordList (const srrectype_t RecordType);
void AddListColumns (void);
void UpdateCurrentRecord (void);
int UpdateEditorID (void);
void FillFilterList (void);
/*---------- Begin Public Class Methods ------------------------------*/
public:
/* Construction */
CSrSelectRecordDlg(CWnd* pParent = NULL);
/* Get class members */
CSrRecord* GetCurrentRecord (void) { return (m_pCurrentRecord); }
CSrRecord* GetPrevRecord (void) { return (m_pPrevRecord); }
srformid_t GetCurrentFormID (void) { return (m_CurrentFormID); }
const TCHAR* GetCurrentEditorID (void) { return (m_CurrentEditorID); }
/* Set class members */
void SetListAllOption (const bool Value) { m_ListAllOption = Value; }
void SetInitialFormID (const srformid_t FormID) { m_InitialFormID = FormID; }
void SetInitialEditorID (const TCHAR* pString) { m_InitialEditorID = pString; }
void SetPrevRecord (CSrRecord* pRecord) { m_pPrevRecord = pRecord; }
void SetCurrentRecord (CSrRecord* pRecord) { m_pCurrentRecord = pRecord; }
void SetRecordHandler (CSrRecordHandler* pHandler) { m_pRecordHandler = pHandler; }
void SetDlgInfo (srselrecdlginfo_t& DlgInfo) { m_DlgInfo = DlgInfo; }
void SetAllowNull (const bool Value) { m_AllowNullRecord = Value; }
enum { IDD = IDD_SELECTRECORD_DLG };
CEdit m_CurrentFormIDText;
CEdit m_PreviousFormIDText;
CButton m_ClearButton;
CEdit m_CurrentText;
CEdit m_PreviousText;
CSrRecordVirtualListCtrl m_RecordList;
protected:
virtual void DoDataExchange(CDataExchange* pDX);
protected:
virtual BOOL OnInitDialog();
afx_msg void OnClearButton();
virtual void OnOK();
afx_msg void OnItemchangedRecordlist(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg LRESULT OnEditRecord (WPARAM lParam, LPARAM wParam);
afx_msg void OnChangeCurrentText();
afx_msg HBRUSH OnCtlColor (CDC* pDC, CWnd* pWnd, UINT nCtlColor);
DECLARE_MESSAGE_MAP();
public:
CStatic m_TypeFilterLabel;
CComboBox m_TypeFilterList;
afx_msg void OnCbnSelchangeTypefilterList();
};
/*===========================================================================
* End of Class CSrSelectRecordDlg Definition
*=========================================================================*/
/*===========================================================================
*
* Begin Function Prototypes
*
*=========================================================================*/
bool SrSelectItemScript (CString& EditorID, CSrRecordHandler* pRecordHandler);
bool SrSelectActor (CString& EditorID, CSrRecordHandler* pRecordHandler);
bool SrSelectApparelEnchant (CString& EditorID, CSrRecordHandler* pRecordHandler);
bool SrSelectIngrediant (CString& EditorID, CSrRecordHandler* pRecordHandler);
bool SrSelectScrollEnchant (CString& EditorID, CSrRecordHandler* pRecordHandler);
bool SrSelectSound (CString& EditorID, CSrRecordHandler* pRecordHandler);
bool SrSelectStaffEnchant (CString& EditorID, CSrRecordHandler* pRecordHandler);
bool SrSelectWeaponEnchant (CString& EditorID, CSrRecordHandler* pRecordHandler);
bool SrSelectKeyword (CString& EditorID, CSrRecordHandler* pRecordHandler);
bool SrSelectKeyword (CString& EditorID, CSrRecordHandler* pRecordHandler, const char* pFilter);
bool SrSelectComponent (CString& EditorID, CSrRecordHandler* pRecordHandler);
bool SrSelectEquipSlot (CString& EditorID, CSrRecordHandler* pRecordHandler);
bool SrSelectRecord (CString& EditorID, CSrRecordHandler* pRecordHandler, const srrectype_t** ppType, const srrecfieldmap_t* pFieldMap);
bool SrSelectRecord (CString& EditorID, CSrRecordHandler* pRecordHandler, const srrectype_t Type, const srrecfieldmap_t* pFieldMap);
bool SrSelectOutfitItem (CString& EditorID, CSrRecordHandler* pRecordHandler);
bool SrSelectFormListItem (srformid_t& FormID, CSrRecordHandler* pRecordHandler);
/*===========================================================================
* End of Function Prototypes
*=========================================================================*/
#endif
/*===========================================================================
* End of File Srselectrecorddlg.H
*=========================================================================*/