-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathObSelectRecordDlg.h
192 lines (150 loc) · 6.75 KB
/
ObSelectRecordDlg.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
/*===========================================================================
*
* File: Obselectrecorddlg.H
* Author: Dave Humphrey ([email protected])
* Created On: September 26, 2006
*
* Description
*
*=========================================================================*/
#ifndef __OBSELECTRECORDDLG_H
#define __OBSELECTRECORDDLG_H
/*===========================================================================
*
* Begin Required Includes
*
*=========================================================================*/
#include "modfile/obespfile.h"
#include "windows/obrecordlistctrl.h"
#include "modfile/obmultirecordhandler.h"
/*===========================================================================
* End of Required Includes
*=========================================================================*/
/*===========================================================================
*
* Begin Definitions
*
*=========================================================================*/
/*===========================================================================
* End of Definitions
*=========================================================================*/
/*===========================================================================
*
* Begin Type Definitions
*
*=========================================================================*/
/* Optional callback function type */
typedef bool (*OBRECSELDLGCALLBACK) (CObRecord* pRecord, long UserData);
/* Used to define a selection record dialog */
struct obselrecdlginfo_t {
const obrectype_t* pRecordType; /* Type of record to display */
const obrectype_t** ppRecordArray;
const TCHAR* pTitle;
obreclistcolinit_t* pListColumns;
const obrecfieldmap_t* pFieldMap;
obrecfieldid_t SortField;
OBRECSELDLGCALLBACK pCheckFunc;
long UserData;
};
/*===========================================================================
* End of Type Definitions
*=========================================================================*/
/*===========================================================================
*
* Begin Class CObSelectRecordDlg Definition
*
*=========================================================================*/
class CObSelectRecordDlg : public CDialog {
/*---------- Begin Protected Class Members ---------------------------*/
protected:
obselrecdlginfo_t m_DlgInfo;
obformid_t m_InitialFormID;
CString m_InitialEditorID;
obformid_t m_CurrentFormID;
CString m_CurrentEditorID;
CObRecord* m_pPrevRecord;
CObRecord* m_pCurrentRecord;
bool m_AllowNullRecord; /* Allow a null record to be selected */
bool m_IsInitialized;
CObRecordHandler* m_pRecordHandler;
int m_EditorIDCheck;
bool m_UpdateListOnChange;
/*---------- Begin Protected Class Methods ---------------------------*/
protected:
/* Get/set control data */
void GetControlData (void);
void SetControlData (void);
void FillRecordList (void);
void FillRecordList (const obrectype_t RecordType);
void AddListColumns (void);
void UpdateCurrentRecord (void);
int UpdateEditorID (void);
/*---------- Begin Public Class Methods ------------------------------*/
public:
/* Construction */
CObSelectRecordDlg(CWnd* pParent = NULL);
/* Get class members */
CObRecord* GetCurrentRecord (void) { return (m_pCurrentRecord); }
CObRecord* GetPrevRecord (void) { return (m_pPrevRecord); }
obformid_t GetCurrentFormID (void) { return (m_CurrentFormID); }
const TCHAR* GetCurrentEditorID (void) { return (m_CurrentEditorID); }
/* Set class members */
void SetInitialFormID (const obformid_t FormID) { m_InitialFormID = FormID; }
void SetInitialEditorID (const TCHAR* pString) { m_InitialEditorID = pString; }
void SetPrevRecord (CObRecord* pRecord) { m_pPrevRecord = pRecord; }
void SetCurrentRecord (CObRecord* pRecord) { m_pCurrentRecord = pRecord; }
void SetRecordHandler (CObRecordHandler* pHandler) { m_pRecordHandler = pHandler; }
void SetDlgInfo (obselrecdlginfo_t& DlgInfo) { m_DlgInfo = DlgInfo; }
void SetAllowNull (const bool Value) { m_AllowNullRecord = Value; }
//{{AFX_DATA(CObSelectRecordDlg)
enum { IDD = IDD_SELECTRECORD_DLG };
CEdit m_CurrentFormIDText;
CEdit m_PreviousFormIDText;
CButton m_ClearButton;
CEdit m_CurrentText;
CEdit m_PreviousText;
CObRecordListCtrl m_RecordList;
//}}AFX_DATA
/* ClassWizard generated virtual function overrides */
//{{AFX_VIRTUAL(CObSelectRecordDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX);
//}}AFX_VIRTUAL
protected:
/* Generated message map functions */
//{{AFX_MSG(CObSelectRecordDlg)
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);
//}}AFX_MSG
DECLARE_MESSAGE_MAP();
};
/*===========================================================================
* End of Class CObSelectRecordDlg Definition
*=========================================================================*/
/*===========================================================================
*
* Begin Function Prototypes
*
*=========================================================================*/
bool ObSelectItemScript (CString& EditorID, CObRecordHandler* pRecordHandler);
bool ObSelectActor (CString& EditorID, CObRecordHandler* pRecordHandler);
bool ObSelectApparelEnchant (CString& EditorID, CObRecordHandler* pRecordHandler);
bool ObSelectIngrediant (CString& EditorID, CObRecordHandler* pRecordHandler);
bool ObSelectScrollEnchant (CString& EditorID, CObRecordHandler* pRecordHandler);
bool ObSelectSound (CString& EditorID, CObRecordHandler* pRecordHandler);
bool ObSelectStaffEnchant (CString& EditorID, CObRecordHandler* pRecordHandler);
bool ObSelectWeaponEnchant (CString& EditorID, CObRecordHandler* pRecordHandler);
/*===========================================================================
* End of Function Prototypes
*=========================================================================*/
//{{AFX_INSERT_LOCATION}}
//}}AFX_INSERT_LOCATION
#endif
/*===========================================================================
* End of File Obselectrecorddlg.H
*=========================================================================*/