Debian Codegraph @

editor/ScriptStudio.cpp

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.cpp $
21 * $Revision: 1.1.1.1 $
22 * $Date: 2003-08-26 03:57:39 $
23 * $Author: kevinb $
24 *
25 * Script Studio New Editor
26 *
27 * $Log: not supported by cvs2svn $
28 *
29 * 17 10/13/98 11:42a Samir
30 * this may fix things?
31 *
32 * 16 10/08/98 4:24p Kevin
33 * Changed code to comply with memory library usage. Always use mem_malloc
34 * , mem_free and mem_strdup
35 *
36 * 15 7/13/98 11:13a Chris
37 * Fixed the 65535 charactor limit with Kevin's help
38 *
39 * 14 6/23/98 2:43p Matt
40 * Changed calls to OutrageMessageBox() & Debug_MessageBox() to deal with
41 * int return value (instead of bool).
42 *
43 * 13 4/06/98 4:55p Samir
44 * no bold text.
45 *
46 * 12 4/06/98 2:49p Samir
47 * Fixed width font.
48 *
49 * 11 3/24/98 6:35p Samir
50 * added script studio exit
51 *
52 * 10 3/24/98 4:29p Samir
53 * report correct line number.
54 *
55 * 9 3/04/98 5:54p Samir
56 * Added line number gauge to script studio.
57 *
58 * 8 3/02/98 4:03p Samir
59 * Created a function to open up a script studio window.
60 *
61 * 7 10/15/97 3:05p Samir
62 * Improved paste a little bit.
63 *
64 * 6 9/26/97 4:15p Samir
65 * Mostly working system to go to a certain script in a file.
66 *
67 * 5 9/25/97 5:28p Samir
68 * Even newer script code due to more changes in ObjCScript.cpp
69 *
70 * 4 9/04/97 4:39p Matt
71 * Added includes needed as a result of removing includes from d3edit.h
72 *
73 * 3 8/20/97 3:35p Samir
74 * Enhanced ScriptStudio to use tabs! Use new ScriptStudio instead of
75 * ScriptEditor.
76 *
77 * $NoKeywords: $
78 */
79
80 // ScriptStudio.cpp : implementation file
81 //
82
83 #include "mfc_compatibility.h"
84 #include "editor.h"
85 #include "ScriptStudio.h"
86 #include "OsirisStatusDlg.h"
87 #include "ObjCScript.h"
88 #include "mem.h"
89
90 #include "pserror.h"
91 #include "d3x.h"
92 #include "ddio.h"
93 #include "cfile.h"
94
95 #ifdef _DEBUG
96 #define new DEBUG_NEW
97 #undef THIS_FILE
98 static char THIS_FILE[] = __FILE__;
99 #endif
100
101 #define MAX_SCRIPT_LINE_SIZE 800
102
103 static UINT WM_FINDREPLACE = RegisterWindowMessage(FINDMSGSTRING);
104
105 /////////////////////////////////////////////////////////////////////////////
106 // CScriptStudio dialog
107
108 CScriptStudio::CScriptStudio(CWnd *pParent /*=NULL*/) : CDialog(CScriptStudio::IDD, pParent) {
109 //{{AFX_DATA_INIT(CScriptStudio)
110 // NOTE: the ClassWizard will add member initialization here
111 //}}AFX_DATA_INIT
112
113 m_pdlgFindReplace = NULL;
114 }
115
116 void CScriptStudio::DoDataExchange(CDataExchange *pDX) {
117 CDialog::DoDataExchange(pDX);
118 //{{AFX_DATA_MAP(CScriptStudio)
119 // NOTE: the ClassWizard will add DDX and DDV calls here
120 //}}AFX_DATA_MAP
121 }
122
123 void CScriptStudio::SetText(const CString &text) {
124 m_EditText = text;
125 m_EditInitial = text;
126 }
127
128 void CScriptStudio::SetD3XObject(tD3XProgram *prog) { m_D3XProgram = prog; }
129
130 void CScriptStudio::GetText(CString &text) { text = m_EditText; }
131
132 void CScriptStudio::UpdateEditText() {
133 CHARRANGE chr;
134
135 m_RichEdit.HideCaret();
136 m_RichEdit.GetSel(chr);
137 m_RichEdit.SetSel(0, -1);
138 m_EditText = m_RichEdit.GetSelText();
139 m_RichEdit.SetSel(chr);
140 m_RichEdit.ShowCaret();
141
142 // m_RichEdit.GetWindowText(m_EditText);
143 }
144
145 void CScriptStudio::SelectText(const char *txt) { m_SelectText = txt; }
146
147 BEGIN_MESSAGE_MAP(CScriptStudio, CDialog)
148 //{{AFX_MSG_MAP(CScriptStudio)
149 ON_COMMAND(ID_OSIRIS_COMPILE_SCRIPT, OnOsirisCompileScript)
150 ON_COMMAND(ID_OSIRIS_COPY, OnOsirisCopy)
151 ON_COMMAND(ID_OSIRIS_CUT, OnOsirisCut)
152 ON_COMMAND(ID_OSIRIS_EXPORT_SCRIPT, OnOsirisExportScript)
153 ON_COMMAND(ID_OSIRIS_FIND, OnOsirisFind)
154 ON_COMMAND(ID_OSIRIS_FIND_AND_REPLACE, OnOsirisFindAndReplace)
155 ON_COMMAND(ID_OSIRIS_IMPORT_SCRIPT, OnOsirisImportScript)
156 ON_COMMAND(ID_OSIRIS_PASTE, OnOsirisPaste)
157 ON_COMMAND(ID_OSIRIS_SAVE_EXIT, OnOsirisSaveExit)
158 ON_COMMAND(ID_OSIRIS_SET_EXTERNAL, OnOsirisSetExternal)
159 ON_COMMAND(ID_OSIRIS_USE_EXTERNAL, OnOsirisUseExternal)
160 ON_UPDATE_COMMAND_UI(ID_OSIRIS_PASTE, OnUpdateOsirisPaste)
161 ON_NOTIFY(EN_MSGFILTER, IDC_SCRIPTVIEW, OnMsgfilterScriptView)
162 ON_WM_DESTROY()
163 ON_COMMAND(ID_EXIT, OnExit)
164 //}}AFX_MSG_MAP
165 ON_REGISTERED_MESSAGE(WM_FINDREPLACE, OnFindReplace)
166 END_MESSAGE_MAP()
167
168 /////////////////////////////////////////////////////////////////////////////
169 // CScriptStudio message handlers
170
171 BOOL CScriptStudio::OnInitDialog() {
172 RECT rect;
173 CWnd *wnd;
174 PARAFORMAT pf;
175 CHARFORMAT cf;
176
177 m_RichEditInit = false;
178
179 CDialog::OnInitDialog();
180
181 // Create our Rich Edit Control add keyboard handler for those SPECIAL keys like TAB.
182 wnd = GetDlgItem(IDC_SCRMOD_BOX);
183 wnd->GetWindowRect(&rect);
184 rect.left += 2;
185 rect.right -= 2;
186 rect.top += 2;
187 rect.bottom -= 2;
188 ScreenToClient(&rect);
189 m_RichEdit.Create(WS_CHILD | WS_VISIBLE | ES_MULTILINE | ES_WANTRETURN | ES_AUTOHSCROLL | ES_AUTOVSCROLL |
190 ES_SAVESEL | ES_NOHIDESEL | WS_VSCROLL,
191 rect, this, IDC_SCRIPTVIEW);
192 m_RichEdit.SetEventMask(ENM_KEYEVENTS | ENM_MOUSEEVENTS);
193
194 m_RichEdit.LimitText(0);
195 m_RichEdit.GetParaFormat(pf);
196
197 pf.cbSize = sizeof(pf);
198 pf.dwMask = PFM_TABSTOPS;
199 pf.cTabCount = MAX_TAB_STOPS;
200 for (int i = 0; i < pf.cTabCount; i++)
201 pf.rgxTabs[i] = 360 * (i + 1);
202
203 m_RichEdit.SetParaFormat(pf);
204
205 m_RichEdit.SetWindowText((LPCSTR)m_EditText);
206 FindNext((char *)(LPCSTR)m_SelectText);
207
208 // sets character format
209 ZeroMemory(&cf, sizeof(cf));
210 cf.dwMask = CFM_FACE | CFM_CHARSET | CFM_BOLD;
211 strcpy(cf.szFaceName, "Courier");
212 cf.bCharSet = DEFAULT_CHARSET;
213 cf.bPitchAndFamily = FIXED_PITCH | FF_DONTCARE;
214 m_RichEdit.SetDefaultCharFormat(cf);
215
216 // set linenumber
217 CStatic *linenum = (CStatic *)GetDlgItem(IDC_LINENUM);
218 char buf[8];
219
220 sprintf(buf, "%d", m_RichEdit.LineFromChar(-1) + 1);
221 linenum->SetWindowText(buf);
222
223 return TRUE; // return TRUE unless you set the focus to a control
224 // EXCEPTION: OCX Property Pages should return FALSE
225 }
226
227 void CScriptStudio::OnDestroy() { CDialog::OnDestroy(); }
228
229 // The Key handler for the editor. Handles TAB chars.
230 void CScriptStudio::OnMsgfilterScriptView(NMHDR *pNMHDR, LRESULT *pResult) {
231 MSGFILTER *pMsgFilter = reinterpret_cast<MSGFILTER *>(pNMHDR);
232
233 // TODO: The control will not send this notification unless you override the
234 // CDialog::OnInitDialog() function to send the EM_SETEVENTMASK message
235 // to the control with either the ENM_KEYEVENTS or ENM_MOUSEEVENTS flag
236 // ORed into the lParam mask.
237
238 switch (pMsgFilter->msg) {
239 case WM_KEYDOWN:
240 if (pMsgFilter->wParam == VK_TAB)
241 m_RichEdit.ReplaceSel("\t");
242 *pResult = 0;
243 break;
244 }
245
246 CStatic *linenum = (CStatic *)GetDlgItem(IDC_LINENUM);
247 char buf[8];
248
249 sprintf(buf, "%d", m_RichEdit.LineFromChar(-1) + 1);
250 linenum->SetWindowText(buf);
251 }
252
253 // Process all commands to and from Rich Edit Control here.
254
255 BOOL CScriptStudio::OnCommand(WPARAM wParam, LPARAM lParam) {
256 int nCode = HIWORD(wParam);
257 int nID = LOWORD(wParam);
258
259 switch (nID) {
260 case IDC_SCRIPTVIEW:
261 HandleEditControl(nID, nCode);
262 break;
263 }
264
265 return CDialog::OnCommand(wParam, lParam);
266 }
267
268 void CScriptStudio::OnOK() {
269 ddio_KeyFlush();
270 UpdateEditText();
271
272 CDialog::OnOK();
273 }
274
275 void CScriptStudio::OnCancel() {
276 ddio_KeyFlush();
277
278 if (m_EditInitial != m_EditText)
279 if (OutrageMessageBox(MBOX_YESNO, "You have made changes to this script that won't be saved. Are you sure?") !=
280 IDYES)
281 return;
282
283 CDialog::OnCancel();
284 }
285
286 /////////////////////////////////////////////////////////////////////////////////////////////
287 // Menu functions.
288
289 void CScriptStudio::OnOsirisSaveExit() {
290 m_EditInitial = m_EditText;
291 OnOK();
292 }
293
294 void CScriptStudio::OnOsirisSetExternal() {
295 // OnSetExternalViewer();
296 }
297
298 void CScriptStudio::OnOsirisUseExternal() {
299 // OnUseExternal();
300 }
301
302 void CScriptStudio::OnOsirisCompileScript() {
303 COsirisStatusDlg progress_status;
304
305 UpdateEditText();
306
307 progress_status.SetScript(m_EditText.GetBuffer(1), m_D3XProgram);
308
309 progress_status.DoModal();
310 }
311
312 void CScriptStudio::OnOsirisImportScript() {
313 CString path;
314 CString filter = "All Files (*.*)|*.*||";
315
316 CFileDialog dlg(true, 0, 0, OFN_FILEMUSTEXIST, (LPCTSTR)filter, this);
317 if (dlg.DoModal() == IDOK) {
318 path = dlg.GetPathName();
319 ImportScript(path.GetBuffer(1));
320 }
321 }
322
323 void CScriptStudio::OnOsirisExportScript() {
324 CString path;
325 CString filter = "All Files (*.*)|*.*||";
326
327 CFileDialog dlg(false, 0, 0, OFN_OVERWRITEPROMPT, (LPCTSTR)filter, this);
328 if (dlg.DoModal() == IDOK) {
329 path = dlg.GetPathName();
330 ExportScript(path.GetBuffer(1));
331 }
332 }
333
334 //////////////////////////////////////////////////////////////////////////////
335 // Editing and Clipboard functionality
336
337 void CScriptStudio::OnOsirisFind() { InitFindReplace(true); }
338
339 void CScriptStudio::OnOsirisFindAndReplace() {
340 // TODO: Add your command handler code here
341 InitFindReplace(false);
342 }
343
344 void CScriptStudio::OnOsirisPaste() {
345 m_RichEdit.Paste();
346 m_RichEdit.RedrawWindow();
347 }
348
349 void CScriptStudio::OnOsirisCopy() { m_RichEdit.Copy(); }
350
351 void CScriptStudio::OnOsirisCut() { m_RichEdit.Cut(); }
352
353 void CScriptStudio::OnUpdateOsirisPaste(CCmdUI *pCmdUI) {
354 // this doesn't work right...don't know why
355 if (IsClipboardFormatAvailable(CF_TEXT))
356 pCmdUI->Enable(true);
357 else
358 pCmdUI->Enable(false);
359 }
360
361 /////////////////////////////////////////////////////////////////////////////////////////////
362 // These Functions deal with user interface issues within the editor like Find-Replace.
363
364 // This is the message handler of sorts for the Find/Replace dialog, it interprets the message and passes the control
365 // to the appropriate function
366 LONG CScriptStudio::OnFindReplace(WPARAM wParam, LPARAM lParam) {
367 // Get a pointer to the calling dialog
368 CFindReplaceDialog *pDlg = CFindReplaceDialog::GetNotifier(lParam);
369 ASSERT(pDlg != NULL);
370
371 // See what the user is up to out there...
372 if (pDlg->IsTerminating()) {
373 // Time to kill the dialog box
374 return 0;
375 }
376
377 if (pDlg->ReplaceAll()) {
378 // Put a call to your ReplaceAll() method here...
379 CString find, repl;
380 find = pDlg->GetFindString();
381 repl = pDlg->GetReplaceString();
382 if (pDlg->MatchCase())
383 m_FindMatchCase = true;
384 else
385 m_FindMatchCase = false;
386 ReplaceAll(find.GetBuffer(1), repl.GetBuffer(1));
387 return 0;
388 }
389
390 if (pDlg->ReplaceCurrent()) {
391 // Put a call to your ReplaceCurrent() method here...
392 CString repl;
393 repl = pDlg->GetReplaceString();
394 if (pDlg->MatchCase())
395 m_FindMatchCase = true;
396 else
397 m_FindMatchCase = false;
398 ReplaceCurrent(repl.GetBuffer(1));
399 return 0;
400 }
401
402 CString str;
403 if (pDlg->MatchCase())
404 m_FindMatchCase = true;
405 else
406 m_FindMatchCase = false;
407 str = pDlg->GetFindString();
408
409 FindNext(str.GetBuffer(1));
410
411 return 0;
412 }
413
414 // This initializes a Find/Replace dialog box (if bFind==false it sets up a Find and Replace, else it's just Find)
415 void CScriptStudio::InitFindReplace(BOOL bFind) {
416 //
417 // If the dialog has been called already, and then closed,
418 // the pointer is still non-NULL, but the object is already
419 // dead, so reset the pointer!
420 //
421 m_pdlgFindReplace = NULL;
422 m_LastWord = " ";
423
424 // Construct the dialog
425 m_pdlgFindReplace = new CFindReplaceDialog;
426 ASSERT(m_pdlgFindReplace != NULL);
427
428 // Initialize the dialog
429 if (!m_pdlgFindReplace->Create(bFind, 0, 0, FR_DOWN, this)) {
430 mprintf(0, "Error allocating find/replace dialog!");
431 m_pdlgFindReplace = NULL;
432 return;
433 }
434
435 // Display the dialog
436 ASSERT(m_pdlgFindReplace != NULL);
437 m_pdlgFindReplace->SetActiveWindow();
438 m_pdlgFindReplace->ShowWindow(SW_SHOW);
439 }
440
441 // This will look for the next series of charaters (given by the null terminated w)
442 // If it finds the string, it will highlight/select it and move the caret to the beginning of the word
443 // returns true if it found the string
444 // else false
445 bool CScriptStudio::FindNext(char *w) {
446 int index, max;
447 bool word_found;
448 bool new_word;
449 static int start = 0;
450
451 word_found = false;
452
453 // See if this is a new word to look for (as compared to the last searched word)
454 if (m_LastWord != w) {
455 m_LastWord = w;
456 start = 0;
457 new_word = true;
458 } else
459 new_word = false;
460
461 // This will update the m_sScript string so it has the current script in it
462 UpdateEditText();
463
464 // Make a copy of the script to work with
465 char *text;
466 text = (char *)mem_malloc(m_EditText.GetLength() + 1);
467 if (!text)
468 Int3();
469 strcpy(text, (LPCSTR)m_EditText);
470 max = m_EditText.GetLength();
471
472 // Make sure we aren't gonna try to go past the end of the buffer, start at 0 if we are
473 if (start + (signed)strlen(w) >= max - 1)
474 start = 0;
475
476 // Here we begin the search
477 for (index = start; index < max; index++) {
478 // check the character it's at in the buffer to the first character of the find string, if they are the same
479 // it's a possibility, so Check the word
480 if (toupper(text[index]) == toupper(w[0]))
481 if (CheckWord(index, text, w)) {
482 // We got a match, so move the caret, and select the word
483 SetCurrentIndex(index);
484 SetSelection(index, strlen(w));
485 word_found = true;
486 // adjust start so on the next FindNext() it will start from the next character
487 start = index + 1;
488 index = max;
489 }
490 }
491
492 if (text)
493 mem_free(text);
494
495 if (!word_found) {
496 // This can mean 2 things. We searched to the end of the file and either never found a word, or we did at one time
497
498 // either way, start back at the beginning next time
499 start = 0;
500
501 // if it was a new word then we never found it
502 if (new_word) {
503 OutrageMessageBox("Word Not Found!");
504 m_LastWord = " ";
505 } else {
506 OutrageMessageBox("Searched to end of file");
507 }
508 return false;
509 }
510
511 return true;
512 }
513
514 // This selects a word/string in the edit box, given the starting zero based character index and the length of the
515 // string
516 void CScriptStudio::SetSelection(int index, int length) {
517 m_RichEdit.SetActiveWindow();
518 m_RichEdit.SetFocus();
519 m_RichEdit.ShowCaret();
520 m_RichEdit.SetSel(-1, 0);
521 m_RichEdit.SetSel(index, index + length);
522 }
523
524 // This function clears all selections
525 void CScriptStudio::RemoveAllSelections() {
526 m_RichEdit.SetFocus();
527 m_RichEdit.ShowCaret();
528 m_RichEdit.SetSel(-1, 0);
529 }
530
531 // Replaces the selected word with the passed word
532 void CScriptStudio::ReplaceSelected(char *replace_word) {
533 long start_index, end_index;
534
535 UpdateData(false);
536
537 m_RichEdit.SetFocus();
538 m_RichEdit.GetSel(start_index, end_index);
539 m_RichEdit.ReplaceSel(replace_word);
540
541 UpdateData();
542
543 SetCurrentIndex(start_index);
544 }
545
546 // This will start from the beginning and replace all the occurences
547 void CScriptStudio::ReplaceAll(char *find_word, char *replace_word) {
548 SetCurrentIndex(0);
549 m_LastWord = " ";
550 while (FindNext(find_word)) {
551 ReplaceSelected(replace_word);
552 }
553 }
554
555 // This only replaces the selected string with the replace_word
556 void CScriptStudio::ReplaceCurrent(char *replace_word) { ReplaceSelected(replace_word); }
557
558 // This function moves the caret to the position specified in index
559 void CScriptStudio::SetCurrentIndex(int index) {
560 CPoint point;
561 m_RichEdit.SetFocus();
562 m_RichEdit.ShowCaret();
563 point = m_RichEdit.GetCharPos(index);
564 m_RichEdit.SetCaretPos(point);
565 }
566
567 // This function checks to see if the string w is the same as the string that begins in text[index]
568 // returns true if it is
569 bool CScriptStudio::CheckWord(int index, char *text, char *w) {
570 int word_length = strlen(w);
571 int buffer_size = strlen(text);
572 int count;
573 if (m_FindMatchCase) {
574 for (count = 0; count < word_length; count++) {
575 if (index + count >= buffer_size)
576 return false;
577 if (text[index + count] != w[count])
578 return false;
579 }
580 } else {
581 for (count = 0; count < word_length; count++) {
582 if (index + count >= buffer_size)
583 return false;
584 if (toupper(text[index + count]) != toupper(w[count]))
585 return false;
586 }
587 }
588
589 return true;
590 }
591
592 /////////////////////////////////////////////////////////////////////////////////////////////
593 // These function deal with importing and exporting script files.
594
595 void CScriptStudio::ExportScript(char *filename) {
596 CFILE *file;
597
598 UpdateEditText();
599 file = cfopen(filename, "wt");
600 mprintf(0, "Exporting Script to file %s\n", filename);
601 cf_WriteString(file, m_EditText.GetBuffer(1));
602 cfclose(file);
603 }
604
605 void CScriptStudio::ImportScript(char *filename) {
606 CFILE *file;
607 CString temp;
608 int size;
609 char buffer[MAX_SCRIPT_LINE_SIZE];
610
611 memset(buffer, 0, MAX_SCRIPT_LINE_SIZE);
612
613 if (!cfexist(filename)) {
614 OutrageMessageBox("File not found!");
615 return;
616 }
617
618 file = cfopen(filename, "rt");
619 mprintf(0, "Importing Script from file %s\n", filename);
620 do {
621 size = cf_ReadString(buffer, MAX_SCRIPT_LINE_SIZE - 2, file);
622 buffer[size] = '\xd';
623 buffer[size + 1] = '\xa';
624 buffer[size + 2] = '\0';
625 temp += buffer;
626 memset(buffer, 0, size);
627 } while (!cfeof(file));
628
629 cfclose(file);
630
631 m_EditText = temp;
632 m_RichEdit.SetWindowText((LPCSTR)m_EditText);
633 }
634
635 void CScriptStudio::HandleEditControl(int id, int code) {
636 CRichEditCtrl *rec = (CRichEditCtrl *)GetDlgItem(id);
637
638 switch (code) {
639 case EN_UPDATE:
640 break;
641 }
642 }
643
644 bool InvokeScriptStudio(const char *filename, const char *scrname) {
645 #if 0 // LGT: D3XReallocProgram undefined
646 char *source;
647 CScriptStudio studio;
648 tD3XProgram *script;
649 bool ret = false;
650
651 // initialize script studio.
652 script = D3XReallocProgram(NULL, 0, 0, 0);
653 if (!script) {
654 OutrageMessageBox("Failure to compile script! Something is wrong!");
655 return false;
656 }
657 source = LoadScript(filename);
658 if (!source) {
659 OutrageMessageBox("Unable to find script for level. Something is wrong!");
660 return false;
661 }
662 studio.SelectText(scrname);
663 studio.SetD3XObject(script);
664 studio.SetText(CString(source));
665 FreeScript(source);
666
667 if (studio.DoModal() == IDOK) {
668 CString tempstr;
669 studio.GetText(tempstr);
670 source = (char *) mem_malloc(tempstr.GetLength()+1);
671 strcpy(source, tempstr);
672 SaveScript(filename, source);
673 mem_free(source);
674 ret = true;
675 }
676 else {
677 OutrageMessageBox("The level script could not compile and is invalid until corrected.");
678 ret = false;
679 }
680
681 D3XFreeProgram(script);
682
683 return ret;
684 #else
685 return false;
686 #endif
687 }
688
689 void CScriptStudio::OnExit() {
690 // TODO: Add your command handler code here
691
692 CDialog::OnOK();
693 }