Debian Codegraph @

editor/ScriptParmDialog.h

raw symbols SCIP
1 /*
2 * Descent 3
3 * Copyright (C) 2024 Parallax Software
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 #if !defined(AFX_SCRIPTPARMDIALOG_H__7B248DB1_91AA_11D1_BFC4_00A0C94B8467__INCLUDED_)
20 #define AFX_SCRIPTPARMDIALOG_H__7B248DB1_91AA_11D1_BFC4_00A0C94B8467__INCLUDED_
21
22 #if _MSC_VER >= 1000
23 #pragma once
24 #endif // _MSC_VER >= 1000
25 // ScriptParmDialog.h : header file
26 //
27
28 /////////////////////////////////////////////////////////////////////////////
29 // CScriptParmDialog dialog
30
31 // struct tScriptParm;
32
33 #include "d3x.h"
34 #include "ObjCScript.h"
35
36 class CScriptParmDialog : public CDialog {
37 // Construction
38 public:
39 CScriptParmDialog(CWnd *pParent = NULL); // standard constructor
40
41 // Dialog Data
42 //{{AFX_DATA(CScriptParmDialog)
43 enum { IDD = IDD_SCRIPTPARMS };
44 CString m_Parm1;
45 CString m_Parm2;
46 CString m_Parm3;
47 CString m_Parm4;
48 CString m_Parm5;
49 CString m_Parm6;
50 CString m_Parm7;
51 CString m_Parm8;
52 CString m_ParmEdit1;
53 CString m_ParmEdit2;
54 CString m_ParmEdit3;
55 CString m_ParmEdit4;
56 CString m_ParmEdit5;
57 CString m_ParmEdit6;
58 CString m_ParmEdit7;
59 CString m_ParmEdit8;
60 //}}AFX_DATA
61
62 public:
63 void ConvertToScriptParameter(tScriptParm *parm, const char *type, const char *text);
64 void ConvertParamToText(CString &text, tScriptParm *parm);
65
66 // Overrides
67 // ClassWizard generated virtual function overrides
68 //{{AFX_VIRTUAL(CScriptParmDialog)
69 protected:
70 virtual void DoDataExchange(CDataExchange *pDX); // DDX/DDV support
71 virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
72 //}}AFX_VIRTUAL
73
74 // Implementation
75 protected:
76 // Generated message map functions
77 //{{AFX_MSG(CScriptParmDialog)
78 virtual BOOL OnInitDialog();
79 afx_msg void OnParamlist();
80 afx_msg void OnParamlist2();
81 afx_msg void OnParamlist3();
82 afx_msg void OnParamlist4();
83 afx_msg void OnParamlist5();
84 afx_msg void OnParamlist6();
85 afx_msg void OnParamlist7();
86 afx_msg void OnParamlist8();
87 //}}AFX_MSG
88 DECLARE_MESSAGE_MAP()
89
90 private:
91 CWnd *m_ContextWnd;
92 };
93
94 inline void RETURN_SCRIPTPARM_DIALOG(tScriptParm *parmlist, CScriptParmDialog *dlg, char *parmtypelist[MAX_SCRPARAMS]) {
95 dlg->ConvertToScriptParameter(&parmlist[0], parmtypelist[0], dlg->m_ParmEdit1);
96 dlg->ConvertToScriptParameter(&parmlist[1], parmtypelist[1], dlg->m_ParmEdit2);
97 dlg->ConvertToScriptParameter(&parmlist[2], parmtypelist[2], dlg->m_ParmEdit3);
98 dlg->ConvertToScriptParameter(&parmlist[3], parmtypelist[3], dlg->m_ParmEdit4);
99 dlg->ConvertToScriptParameter(&parmlist[4], parmtypelist[4], dlg->m_ParmEdit5);
100 dlg->ConvertToScriptParameter(&parmlist[5], parmtypelist[5], dlg->m_ParmEdit6);
101 dlg->ConvertToScriptParameter(&parmlist[6], parmtypelist[6], dlg->m_ParmEdit7);
102 dlg->ConvertToScriptParameter(&parmlist[7], parmtypelist[7], dlg->m_ParmEdit8);
103 }
104
105 inline void SETUP_SCRIPTPARM_DIALOG(CScriptParmDialog *dlg, char *namelist[MAX_SCRPARAMS], tScriptParm *parmlist) {
106 dlg->m_Parm1 = namelist[0];
107 dlg->m_Parm2 = namelist[1];
108 dlg->m_Parm3 = namelist[2];
109 dlg->m_Parm4 = namelist[3];
110 dlg->m_Parm5 = namelist[4];
111 dlg->m_Parm6 = namelist[5];
112 dlg->m_Parm7 = namelist[6];
113 dlg->m_Parm8 = namelist[7];
114
115 dlg->ConvertParamToText(dlg->m_ParmEdit1, &parmlist[0]);
116 dlg->ConvertParamToText(dlg->m_ParmEdit2, &parmlist[1]);
117 dlg->ConvertParamToText(dlg->m_ParmEdit3, &parmlist[2]);
118 dlg->ConvertParamToText(dlg->m_ParmEdit4, &parmlist[3]);
119 dlg->ConvertParamToText(dlg->m_ParmEdit5, &parmlist[4]);
120 dlg->ConvertParamToText(dlg->m_ParmEdit6, &parmlist[5]);
121 dlg->ConvertParamToText(dlg->m_ParmEdit7, &parmlist[6]);
122 dlg->ConvertParamToText(dlg->m_ParmEdit8, &parmlist[7]);
123 }
124
125 //{{AFX_INSERT_LOCATION}}
126 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
127
128 #endif // !defined(AFX_SCRIPTPARMDIALOG_H__7B248DB1_91AA_11D1_BFC4_00A0C94B8467__INCLUDED_)