File: ScriptParmDialog.h

package info (click to toggle)
descent3 1.5.0%2Bds-2
  • links: PTS, VCS
  • area: contrib
  • in suites: forky, sid
  • size: 35,256 kB
  • sloc: cpp: 416,147; ansic: 3,233; sh: 10; makefile: 8
file content (128 lines) | stat: -rw-r--r-- 4,433 bytes parent folder | download | duplicates (3)
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
/*
 * Descent 3
 * Copyright (C) 2024 Parallax Software
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#if !defined(AFX_SCRIPTPARMDIALOG_H__7B248DB1_91AA_11D1_BFC4_00A0C94B8467__INCLUDED_)
#define AFX_SCRIPTPARMDIALOG_H__7B248DB1_91AA_11D1_BFC4_00A0C94B8467__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
// ScriptParmDialog.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CScriptParmDialog dialog

// struct tScriptParm;

#include "d3x.h"
#include "ObjCScript.h"

class CScriptParmDialog : public CDialog {
  // Construction
public:
  CScriptParmDialog(CWnd *pParent = NULL); // standard constructor

  // Dialog Data
  //{{AFX_DATA(CScriptParmDialog)
  enum { IDD = IDD_SCRIPTPARMS };
  CString m_Parm1;
  CString m_Parm2;
  CString m_Parm3;
  CString m_Parm4;
  CString m_Parm5;
  CString m_Parm6;
  CString m_Parm7;
  CString m_Parm8;
  CString m_ParmEdit1;
  CString m_ParmEdit2;
  CString m_ParmEdit3;
  CString m_ParmEdit4;
  CString m_ParmEdit5;
  CString m_ParmEdit6;
  CString m_ParmEdit7;
  CString m_ParmEdit8;
  //}}AFX_DATA

public:
  void ConvertToScriptParameter(tScriptParm *parm, const char *type, const char *text);
  void ConvertParamToText(CString &text, tScriptParm *parm);

  // Overrides
  // ClassWizard generated virtual function overrides
  //{{AFX_VIRTUAL(CScriptParmDialog)
protected:
  virtual void DoDataExchange(CDataExchange *pDX); // DDX/DDV support
  virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  //}}AFX_VIRTUAL

  // Implementation
protected:
  // Generated message map functions
  //{{AFX_MSG(CScriptParmDialog)
  virtual BOOL OnInitDialog();
  afx_msg void OnParamlist();
  afx_msg void OnParamlist2();
  afx_msg void OnParamlist3();
  afx_msg void OnParamlist4();
  afx_msg void OnParamlist5();
  afx_msg void OnParamlist6();
  afx_msg void OnParamlist7();
  afx_msg void OnParamlist8();
  //}}AFX_MSG
  DECLARE_MESSAGE_MAP()

private:
  CWnd *m_ContextWnd;
};

inline void RETURN_SCRIPTPARM_DIALOG(tScriptParm *parmlist, CScriptParmDialog *dlg, char *parmtypelist[MAX_SCRPARAMS]) {
  dlg->ConvertToScriptParameter(&parmlist[0], parmtypelist[0], dlg->m_ParmEdit1);
  dlg->ConvertToScriptParameter(&parmlist[1], parmtypelist[1], dlg->m_ParmEdit2);
  dlg->ConvertToScriptParameter(&parmlist[2], parmtypelist[2], dlg->m_ParmEdit3);
  dlg->ConvertToScriptParameter(&parmlist[3], parmtypelist[3], dlg->m_ParmEdit4);
  dlg->ConvertToScriptParameter(&parmlist[4], parmtypelist[4], dlg->m_ParmEdit5);
  dlg->ConvertToScriptParameter(&parmlist[5], parmtypelist[5], dlg->m_ParmEdit6);
  dlg->ConvertToScriptParameter(&parmlist[6], parmtypelist[6], dlg->m_ParmEdit7);
  dlg->ConvertToScriptParameter(&parmlist[7], parmtypelist[7], dlg->m_ParmEdit8);
}

inline void SETUP_SCRIPTPARM_DIALOG(CScriptParmDialog *dlg, char *namelist[MAX_SCRPARAMS], tScriptParm *parmlist) {
  dlg->m_Parm1 = namelist[0];
  dlg->m_Parm2 = namelist[1];
  dlg->m_Parm3 = namelist[2];
  dlg->m_Parm4 = namelist[3];
  dlg->m_Parm5 = namelist[4];
  dlg->m_Parm6 = namelist[5];
  dlg->m_Parm7 = namelist[6];
  dlg->m_Parm8 = namelist[7];

  dlg->ConvertParamToText(dlg->m_ParmEdit1, &parmlist[0]);
  dlg->ConvertParamToText(dlg->m_ParmEdit2, &parmlist[1]);
  dlg->ConvertParamToText(dlg->m_ParmEdit3, &parmlist[2]);
  dlg->ConvertParamToText(dlg->m_ParmEdit4, &parmlist[3]);
  dlg->ConvertParamToText(dlg->m_ParmEdit5, &parmlist[4]);
  dlg->ConvertParamToText(dlg->m_ParmEdit6, &parmlist[5]);
  dlg->ConvertParamToText(dlg->m_ParmEdit7, &parmlist[6]);
  dlg->ConvertParamToText(dlg->m_ParmEdit8, &parmlist[7]);
}

//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_SCRIPTPARMDIALOG_H__7B248DB1_91AA_11D1_BFC4_00A0C94B8467__INCLUDED_)