-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDialogEdit.h
220 lines (203 loc) · 5.91 KB
/
DialogEdit.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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
#if !defined(AFX_DIALOGEDIT_H__8ABD4F86_1932_4170_98B1_90F9190C47DC__INCLUDED_)
#define AFX_DIALOGEDIT_H__8ABD4F86_1932_4170_98B1_90F9190C47DC__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DialogEdit.h : header file
//
#include "SearchNode.h"
/////////////////////////////////////////////////////////////////////////////
// CDialogEdit dialog
class leaf_data : public CMap<HTREEITEM, HTREEITEM, int, int&>
{
public:
HTREEITEM FindStTrigger(int findvalue)
{
HTREEITEM key;
int value;
POSITION pos;
pos=GetStartPosition();
while(pos)
{
GetNextAssoc(pos,key,value);
if(value<0 || value>=the_dialog.statecount) continue;
if(the_dialog.dlgstates[value].stindex==findvalue) return key;
}
return (HTREEITEM) 0;
}
HTREEITEM FindTrTrigger(int findvalue)
{
HTREEITEM key;
int value;
POSITION pos;
pos=GetStartPosition();
while(pos)
{
GetNextAssoc(pos,key,value);
if(value<0 || value>=the_dialog.transcount) continue;
if(the_dialog.dlgtrans[value].trtrindex==findvalue) return key;
}
return (HTREEITEM) 0;
}
HTREEITEM FindAction(int findvalue)
{
HTREEITEM key;
int value;
POSITION pos;
pos=GetStartPosition();
while(pos)
{
GetNextAssoc(pos,key,value);
if(value<0 || value>=the_dialog.transcount) continue;
if(the_dialog.dlgtrans[value].actionindex==findvalue) return key;
}
return (HTREEITEM) 0;
}
HTREEITEM FindElement(int findvalue)
{
HTREEITEM key;
int value;
POSITION pos;
pos=GetStartPosition();
while(pos)
{
GetNextAssoc(pos,key,value);
if(findvalue==value) return key;
}
return (HTREEITEM) 0;
}
};
class CDialogEdit : public CDialog
{
// Construction
public:
CDialogEdit(CWnd* pParent = NULL); // standard constructor
void NewDialog();
// Dialog Data
//{{AFX_DATA(CDialogEdit)
enum { IDD = IDD_DIALOGEDIT };
CEdit m_text_control;
CButton m_version_control;
CEdit m_freeze_control;
CButton m_journal_control;
CButton m_condition_control;
CButton m_action_control;
CButton m_hasjournal;
CButton m_hascondition;
CButton m_hasaction;
CButton m_hasoption;
CComboBox m_jourtype_control;
CButton m_tagcontrol;
CTreeCtrl m_dialogtree;
CString m_label;
CString m_text;
int m_strref;
CString m_sound;
CString m_dialog;
int m_value;
//}}AFX_DATA
CString m_idsname;
HTREEITEM m_currentselection;
HTREEITEM m_currentselection_new;
int m_activesection;
leaf_data m_treestates; //the state ID's of the dialog tree
leaf_data m_transstates; //the transitions (PC responses)
bool viewonly;
protected:
CToolTipCtrl m_tooltip;
CString filepath;
CSearchNode m_searchdlg;
char *m_treeflags;
char *m_transflags;
bool locked;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDialogEdit)
public:
virtual BOOL PreTranslateMessage(MSG* pMsg);
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
int SaveDialog(CString filepath, CString newname);
void UpdateWindowTitle(int stateidx);
void RefreshDialog(int stateidx, int expandselection=0);
int AddTransBranch(HTREEITEM ht, int transitionidx, int transitioncount, int level);
void DisplayText();
void RetrieveText();
void EnableWindows(int enableflags, int actualflags);
void RefreshMenu();
void RefreshLeaf();
int GetRowCount();
void CheckTriggerOrAction(int messages);
void WalkOnTree(int command);
void SearchNode();
int SeekTo(int startnode, int type);
int RunWeidu(CString syscommand);
int pstize(int reference);
// Generated message map functions
//{{AFX_MSG(CDialogEdit)
afx_msg void OnSelchangedDialogtree(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnTagged();
afx_msg void OnKillfocusJourtype();
afx_msg void OnHasoption();
afx_msg void OnHascondition();
afx_msg void OnHasaction();
afx_msg void OnHasjournal();
afx_msg void OnKillfocusFlags();
afx_msg void OnOption();
afx_msg void OnCondition();
afx_msg void OnAction();
afx_msg void OnJournal();
afx_msg void OnLoad();
afx_msg void OnLoadex();
afx_msg void OnSaveas();
virtual BOOL OnInitDialog();
afx_msg void OnVersion();
afx_msg void OnKillfocusText();
afx_msg void OnKillfocusStrref();
afx_msg void OnKillfocusValue();
afx_msg void OnVscrollText();
afx_msg void OnKillfocusSound();
afx_msg void OnBrowse();
afx_msg void OnPlay();
afx_msg void OnKillfocusDialog();
afx_msg void OnSetfocusText();
afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
afx_msg void OnFollowlink();
afx_msg void OnDblclkDialogtree(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnGetinfotipDialogtree(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnRefresh();
afx_msg void OnExpand();
afx_msg void OnCollapse();
afx_msg void OnSearchnode();
afx_msg void OnRemove();
afx_msg void OnAddnode();
afx_msg void OnConvert();
afx_msg void OnNew();
afx_msg void OnSwapnodes();
afx_msg void OnIncreaseweight();
afx_msg void OnToolsorder();
afx_msg void OnToolsorder2();
afx_msg void OnAddtop();
afx_msg void OnExportWeidu();
afx_msg void OnImportWeidu();
afx_msg void OnExportTbg();
afx_msg void OnSave();
afx_msg void OnCheck();
afx_msg void OnToolspst();
virtual void OnCancel();
afx_msg void OnNewvalue();
afx_msg void OnToolsIdsbrowser();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnGetMinMaxInfo(MINMAXINFO* lpMMI);
afx_msg void OnEnChangeText();
void SetViewOnly();
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DIALOGEDIT_H__8ABD4F86_1932_4170_98B1_90F9190C47DC__INCLUDED_)