Debian Codegraph @

editor/ScriptStudio.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 --- HISTORICAL COMMENTS FOLLOW ---
19
20 * $Logfile: /DescentIII/Main/editor/ScriptStudio.h $
21 * $Revision: 1.1.1.1 $
22 * $Date: 2003-08-26 03:57:39 $
23 * $Author: kevinb $
24 *
25 * Script Studio
26 *
27 * $Log: not supported by cvs2svn $
28 *
29 * 7 3/24/98 6:35p Samir
30 * added script studio exit
31 *
32 * 6 3/02/98 4:03p Samir
33 * Created a function to open up a script studio window.
34 *
35 * 5 9/26/97 4:15p Samir
36 * Mostly working system to go to a certain script in a file.
37 *
38 * 4 9/25/97 5:28p Samir
39 * Even newer script code due to more changes in ObjCScript.cpp
40 *
41 * 3 8/20/97 3:35p Samir
42 * Enhanced ScriptStudio to use tabs! Use new ScriptStudio instead of
43 * ScriptEditor.
44 *
45 * $NoKeywords: $
46 */
47
48 #if !defined(AFX_SCRIPTSTUDIO_H__949F5802_189E_11D1_BD9B_00A0C96ED595__INCLUDED_)
49 #define AFX_SCRIPTSTUDIO_H__949F5802_189E_11D1_BD9B_00A0C96ED595__INCLUDED_
50
51 #if _MSC_VER >= 1000
52 #pragma once
53 #endif // _MSC_VER >= 1000
54 // ScriptStudio.h : header file
55 //
56
57 /////////////////////////////////////////////////////////////////////////////
58 // CScriptStudio dialog
59
60 struct tD3XProgram;
61
62 class CScriptStudio : public CDialog {
63 // Construction
64 public:
65 CScriptStudio(CWnd *pParent = NULL); // standard constructor
66
67 // Dialog Data
68 //{{AFX_DATA(CScriptStudio)
69 enum { IDD = IDD_SCRIPTSTUDIO };
70 // NOTE: the ClassWizard will add data members here
71 //}}AFX_DATA
72
73 // Overrides
74 // ClassWizard generated virtual function overrides
75 //{{AFX_VIRTUAL(CScriptStudio)
76 protected:
77 virtual void DoDataExchange(CDataExchange *pDX); // DDX/DDV support
78 virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
79 //}}AFX_VIRTUAL
80
81 private:
82 CRichEditCtrl m_RichEdit;
83 CString m_EditText;
84 CString m_EditInitial;
85 CFindReplaceDialog *m_pdlgFindReplace;
86 CString m_LastWord;
87 CString m_SelectText;
88 tD3XProgram *m_D3XProgram;
89 bool m_FindMatchCase;
90 bool m_RichEditInit;
91
92 private:
93 void UpdateEditText();
94 void InitFindReplace(BOOL bFind);
95 bool FindNext(char *w);
96 void ReplaceSelected(char *replace_word);
97 void ReplaceAll(char *find_word, char *replace_word);
98 void ReplaceCurrent(char *replace_word);
99 void SetCurrentIndex(int index);
100 bool CheckWord(int index, char *text, char *w);
101 void SetSelection(int index, int length);
102 void RemoveAllSelections();
103 void AdjustExternalName();
104 void ExportScript(char *file);
105 void ImportScript(char *file);
106 void HandleEditControl(int id, int code);
107
108 // Interface
109 public:
110 void SelectText(const char *txt);
111 void SetText(const CString &text);
112 void SetD3XObject(tD3XProgram *prog);
113 void GetText(CString &text);
114 tD3XProgram *GetD3XObject() const { return m_D3XProgram; }
115
116 // Implementation
117 protected:
118 // Generated message map functions
119 //{{AFX_MSG(CScriptStudio)
120 virtual BOOL OnInitDialog();
121 virtual void OnOK();
122 virtual void OnCancel();
123 afx_msg void OnOsirisCompileScript();
124 afx_msg void OnOsirisCopy();
125 afx_msg void OnOsirisCut();
126 afx_msg void OnOsirisExportScript();
127 afx_msg void OnOsirisFind();
128 afx_msg void OnOsirisFindAndReplace();
129 afx_msg void OnOsirisImportScript();
130 afx_msg void OnOsirisPaste();
131 afx_msg void OnOsirisSaveExit();
132 afx_msg void OnOsirisSetExternal();
133 afx_msg void OnOsirisUseExternal();
134 afx_msg void OnUpdateOsirisPaste(CCmdUI *pCmdUI);
135 afx_msg void OnMsgfilterScriptView(NMHDR *pNMHDR, LRESULT *pResult);
136 afx_msg void OnDestroy();
137 afx_msg void OnExit();
138 //}}AFX_MSG
139 afx_msg LONG OnFindReplace(WPARAM wParam, LPARAM lParam);
140 DECLARE_MESSAGE_MAP()
141 };
142
143 // runs script studio for a certain script file and points to the first instance of scrname in the file
144 bool InvokeScriptStudio(const char *filename, const char *scrname);
145
146 //{{AFX_INSERT_LOCATION}}
147 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
148
149 #endif // !defined(AFX_SCRIPTSTUDIO_H__949F5802_189E_11D1_BD9B_00A0C96ED595__INCLUDED_)