-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathamScript.IDE.pas
More file actions
5463 lines (4607 loc) · 162 KB
/
amScript.IDE.pas
File metadata and controls
5463 lines (4607 loc) · 162 KB
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
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
unit amScript.IDE;
(*
* Copyright © 2011 Brian Frost
* Copyright © 2019 Anders Melander
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*)
interface
// -----------------------------------------------------------------------------
//
// Main editor/debugger form
//
// -----------------------------------------------------------------------------
// TODO:
// - Remove or rewrite old, disabled project stuff.
// - Replace monolithic editor/page design. Move editor to separate unit.
// - Make editor abstract so it can easily be replaced with something else.
// - Add configuration, persistence and UI (with Package/Bundle mgmt).
// - Add bundle builder UI.
// -----------------------------------------------------------------------------
{.$define LEAK_CHECK}
{.$define SHELL_EXPLORER}
{.$define FEATURE_SCRIPT_BUNDLE}
{.$define FEATURE_PACKAGE_INSTALLER}
{.$define FEATURE_COPY_PROTECT}
{.$define FEATURE_LICENSING}
{$ifdef DISABLED_STUFF}
{$endif DISABLED_STUFF}
uses
System.Generics.Collections,
System.Types, System.SysUtils, System.Variants, System.Classes,
System.ImageList, System.Diagnostics,
WinApi.Windows, WinApi.Messages,
WinApi.ActiveX, WinApi.UxTheme,
Vcl.Graphics, Vcl.Controls,
Vcl.Forms, Vcl.Themes, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, Vcl.ActnList, Vcl.ComCtrls,
Vcl.StdActns, Vcl.Menus, Vcl.ToolWin, Vcl.ActnCtrls, Vcl.ImgList,
System.Actions, Winapi.ShlObj,
XML.XMLIntf, XML.XMLDoc,
dxSkinsCore, dxSkinscxPCPainter, cxPCdxBarPopupMenu, cxGraphics, cxControls,
cxLookAndFeels, cxLookAndFeelPainters, cxPC, dxSkinsdxBarPainter, dxBar, cxClasses, dxSkinsdxDockControlPainter,
dxDockControl, dxDockPanel, dxSkinsdxStatusBarPainter, dxStatusBar, dxRibbonSkins, dxSkinsdxRibbonPainter, dxRibbon,
dxRibbonForm,
dxBarBuiltInMenu, dxRibbonCustomizationForm, dxSkinsForm, dxBarApplicationMenu,
dxBarExtItems, cxImageList, cxContainer,
dxCore,
{$ifdef SHELL_EXPLORER}
cxDropDownEdit,
cxListView,
cxEdit, cxTextEdit, cxMaskEdit,
cxShellCommon, cxShellComboBox, cxShellListView,
{$endif SHELL_EXPLORER}
DragDrop, DropTarget, DragDropFile,
dwsExprs, dwsComp, dwsCompiler, dwsDebugger, dwsStringResult, dwsErrors,
dwsFunctions, dwsUtils, dwsSymbols, dwsUnitSymbols, dwsStrings,
dwsSymbolDictionary,
dwsInfo,
dwsScriptSource,
// UDwsIdeConfig,
amScript.API,
amScript.Debugger.API,
amScript.Host.API,
amScript.Module,
amScript.Provider.API,
amScript.Editor.API,
amScript.Editor.Dialog.GotoLine, // TODO : Move this out of IDE unit
amScript.Debugger.Dialog.Evaluate,
amScript.Debugger.Frame.LocalVariables,
amScript.Debugger.Frame.Watches,
amScript.Debugger.Frame.CallStack,
amScript.Debugger.Frame.Symbols,
amScript.Debugger.Frame.Stack,
amScript.Debugger.Frame.AST,
amScript.Debugger.Frame.BreakPoints,
amScript.Debugger.Frame.FileSystemStructure;
const
MSG_EXEC_RESET = WM_USER;
MSG_FORM_MAXIMIZE = WM_USER+1;
type
TMessageKind = (mkNone, mkInfo, mkWarning, mkError);
TDebuggerExecutionEvent = procedure(const Execution: IdwsProgramExecution) of object;
// -----------------------------------------------------------------------------
//
// TFormScriptDebugger
//
// -----------------------------------------------------------------------------
TFormScriptDebugger = class(TdxRibbonForm,
IScriptDebugger,
IScriptDebuggerSetup,
IScriptHostApplicationNotification,
IScriptHostApplicationCloseNotification,
IScriptEditorHost,
IScriptEditorNotification,
IScriptEditorActionHandler)
ActionBuild: TAction;
ActionClearAllBreakpoints: TAction;
ActionCloseAllOtherPages: TAction;
ActionClosePage: TAction;
ActionEditClearOutputWindow: TAction;
ActionEditCopyToClipboard: TAction;
ActionEditCut: TAction;
ActionEditDelete: TAction;
ActionEditPaste: TAction;
ActionEditSelectAll: TAction;
ActionEditToggleReadOnly: TAction;
ActionEditUndo: TAction;
ActionFileCloseAll: TAction;
ActionFileNewIncludeFile: TAction;
ActionFileNewProject: TAction;
ActionFileNewUnit: TAction;
ActionFileOpenProject: TAction;
ActionFileSave: TAction;
ActionFileSaveAsFile: TAction;
ActionGotoLineNumber: TAction;
ActionList: TActionList;
ActionOpenFile: TAction;
ActionProgramReset: TAction;
ActionRun: TAction;
ActionRunWithoutDebugging: TAction;
ActionSearchFind: TAction;
ActionSearchReplace: TAction;
ActionShowExecutionPoint: TAction;
ActionStepOver: TAction;
ActionTraceInto: TAction;
ActionViewProjectSource: TAction;
ActionViewSymbols: TAction;
Debugger: TdwsDebugger;
EditorPagePopupMenu: TPopupMenu;
MenuItemBuild: TMenuItem;
MenuItemCloseAllOtherPages: TMenuItem;
MenuItemClosePagexx: TMenuItem;
MenuItemCopy: TMenuItem;
MenuItemCut: TMenuItem;
MenuItemDelete: TMenuItem;
MenuItemPaste: TMenuItem;
MenuItemReadOnly: TMenuItem;
MenuItemRun1: TMenuItem;
MenuItemRunWithoutDebugging: TMenuItem;
MenuItemSave: TMenuItem;
MenuItemSelectAll: TMenuItem;
N12: TMenuItem;
N13: TMenuItem;
N6: TMenuItem;
N9: TMenuItem;
OpenFileDialog: TFileOpenDialog;
OpenProjectDialog: TFileOpenDialog;
SaveProjectDialog: TFileSaveDialog;
SaveSourceDialog: TFileSaveDialog;
UpdateTimer: TTimer;
ActionExit: TAction;
BarManager: TdxBarManager;
MenuItemFileNewProject: TdxBarButton;
MenuItemFileNewUnit: TdxBarButton;
MenuItemFileNewInclude: TdxBarButton;
MenuItemFileNew: TdxBarSubItem;
MenuItemFileOpen: TdxBarButton;
MenuItemFileOpenProject: TdxBarButton;
MenuItemFileSave: TdxBarButton;
MenuItemFileSaveAsFile: TdxBarButton;
MenuItemFileSaveProjectAs: TdxBarButton;
MenuItemFileCloseAll: TdxBarButton;
MenuItemFileExit: TdxBarLargeButton;
MenuItemEditCut: TdxBarButton;
MenuItemEditCopy: TdxBarButton;
MenuItemEditPaste: TdxBarButton;
MenuItemEditDelete: TdxBarButton;
MenuItemEditSelectAll: TdxBarButton;
MenuItemEditUndo: TdxBarButton;
MenuItemEditReadOnly: TdxBarButton;
MenuItemSearchFind: TdxBarButton;
MenuItemSearchReplace: TdxBarButton;
MenuItemViewProjectSource: TdxBarButton;
MenuItemViewSymbols: TdxBarButton;
MenuItemProjectBuild: TdxBarButton;
MenuItemRunStart: TdxBarButton;
MenuItemRunStepOver: TdxBarButton;
MenuItemRunTraceInto: TdxBarButton;
MenuItemRunReset: TdxBarButton;
MenuItemRunShowExecutionPoint: TdxBarButton;
MenuItemRunClearAllBreakpoints: TdxBarButton;
DockingManager: TdxDockingManager;
DockPanelLocalVars: TdxDockPanel;
DockPanelWatches: TdxDockPanel;
DockPanelCallStack: TdxDockPanel;
DockPanelMessages: TdxDockPanel;
ListViewMessages: TListView;
DockPanelOutput: TdxDockPanel;
MemoOutputWindow: TMemo;
DockSiteMain: TdxDockSite;
DockPanelMain: TdxDockPanel;
dxLayoutDockSite3: TdxLayoutDockSite;
PageControlEditor: TcxPageControl;
dxLayoutDockSite1: TdxLayoutDockSite;
dxVertContainerDockSite1: TdxVertContainerDockSite;
StatusBar: TdxStatusBar;
DockPanelSymbols: TdxDockPanel;
dxLayoutDockSite2: TdxLayoutDockSite;
LayoutDockSiteLeft: TdxLayoutDockSite;
TabContainerDockSiteBottom: TdxTabContainerDockSite;
RibbonTabEditor: TdxRibbonTab;
RibbonDebug: TdxRibbon;
dxBarManager1Bar4: TdxBar;
dxBarManager1Bar5: TdxBar;
dxBarManager1Bar6: TdxBar;
dxBarManager1Bar7: TdxBar;
dxBarManager1Bar8: TdxBar;
RibbonTabFile: TdxRibbonTab;
dxBarManager1Bar9: TdxBar;
RibbonTabDebug: TdxRibbonTab;
dxBarManager1Bar10: TdxBar;
dxBarManager1Bar11: TdxBar;
dxBarManager1Bar12: TdxBar;
dxBarManager1Bar1: TdxBar;
dxBarLargeButton1: TdxBarLargeButton;
ActionRunResume: TAction;
ActionRunPause: TAction;
dxBarButton1: TdxBarButton;
dxBarButton2: TdxBarButton;
dxBarLargeButton2: TdxBarLargeButton;
dxBarLargeButton3: TdxBarLargeButton;
dxBarButton4: TdxBarButton;
ActionRunStepOut: TAction;
ActionSearchAgain: TAction;
dxBarButton5: TdxBarButton;
dxBarButton6: TdxBarButton;
DockPanelBreakPoints: TdxDockPanel;
ActionDebugEvaluate: TAction;
ActionDebug: TAction;
Debug1: TMenuItem;
N2: TMenuItem;
EvaluateModify1: TMenuItem;
MenuItemFileSaveAsEx: TdxBarSubItem;
ActionFileSaveAsAttachment: TAction;
MenuItemFileSaveAsAttachment: TdxBarButton;
dxBarButton8: TdxBarButton;
ActionDebugBreakOnPoop: TAction;
dxBarButton9: TdxBarButton;
dxBarButton10: TdxBarButton;
dxBarButton11: TdxBarButton;
dxBarManager1Bar2: TdxBar;
ButtonRefactorNormalizeCase: TdxBarButton;
DockPanelStack: TdxDockPanel;
dxBarButton13: TdxBarButton;
dxBarButton14: TdxBarButton;
dxBarButton15: TdxBarButton;
dxBarButton16: TdxBarButton;
dxBarButton17: TdxBarButton;
dxBarButton18: TdxBarButton;
dxBarButton19: TdxBarButton;
dxBarButton20: TdxBarButton;
ActionViewCallStack: TAction;
ActionViewLocals: TAction;
ActionViewWatches: TAction;
ActionViewStack: TAction;
ActionViewMessages: TAction;
ActionViewOutput: TAction;
ActionViewBreakpoints: TAction;
dxBarButton21: TdxBarButton;
dxBarButton22: TdxBarButton;
DockPanelAST: TdxDockPanel;
dxTabContainerDockSite1: TdxTabContainerDockSite;
ActionViewAST: TAction;
dxBarButton23: TdxBarButton;
dxBarButton24: TdxBarButton;
BarSubItemDebugPanes: TdxBarSubItem;
RibbonDebugTabTools: TdxRibbonTab;
dxBarManager1Bar3: TdxBar;
ActionToolDocBuild: TAction;
ButtonToolProtect: TdxBarLargeButton;
dxBarManager1Bar13: TdxBar;
ActionToolCopyProtect: TAction;
ActionRunInitialization: TAction;
ActionRunFinalization: TAction;
dxBarButton25: TdxBarButton;
dxBarButton26: TdxBarButton;
DropFileTarget1: TDropFileTarget;
ActionToolBundle: TAction;
dxBarLargeButton5: TdxBarLargeButton;
ButtonToolDocument: TdxBarSubItem;
ButtonToolDocumentXML: TdxBarButton;
ButtonToolDocumentSource: TdxBarButton;
BarManagerBarQuickAccess: TdxBar;
BarManagerBarLayout: TdxBar;
BarComboLayout: TdxBarCombo;
BarButtonLayoutSave: TdxBarButton;
BarButtonLayoutDefaultEdit: TdxBarButton;
BarButtonLayoutDefaultDebug: TdxBarButton;
ActionLayoutDefaultEdit: TAction;
ActionLayoutDefaultDebug: TAction;
ActionLayoutSave: TAction;
ActionRefactorNormalizeCase: TAction;
ActionRefactorIdentifierRename: TAction;
ButtonRefactorRename: TdxBarButton;
PopupMenuMessages: TPopupMenu;
ActionMessagesClear: TAction;
Clear1: TMenuItem;
BarSubItemGoto: TdxBarSubItem;
ButtonGotoDeclaration: TdxBarButton;
ButtonGotoImplementation: TdxBarButton;
ActionGotoDeclaration: TAction;
ActionGotoImplementation: TAction;
ButtonRefactorUsage: TdxBarButton;
ActionToolHeader: TAction;
ButtonToolHeader: TdxBarLargeButton;
ActionRefactorSearchSymbol: TAction;
dxBarButton12: TdxBarButton;
ActionFileMainUnit: TAction;
PopupMenuEditorTabs: TdxRibbonPopupMenu;
MenuItemFileClose: TdxBarButton;
MenuItemFileCloseOtherPages: TdxBarButton;
MenuItemFileMainUnit: TdxBarButton;
MenuItemFileReadOnlyToggle: TdxBarButton;
BarApplicationMenu: TdxBarApplicationMenu;
BarButtonLiveObjects: TdxBarButton;
ActionDebugLiveObjects: TAction;
BarStaticSpacer: TdxBarStatic;
DockPanelFileExplorer: TdxDockPanel;
dxBarButton27: TdxBarButton;
ActionViewFileExplorer: TAction;
dxLayoutDockSite4: TdxLayoutDockSite;
dxLayoutDockSite5: TdxLayoutDockSite;
ButtonToolDocumentBuild: TdxBarButton;
ActionJIT: TAction;
dxBarButton7: TdxBarButton;
BarManagerBarMainMenu: TdxBar;
BarSubMenuItemFile: TdxBarSubItem;
BarSubMenuItemEdit: TdxBarSubItem;
BarSubMenuItemRefactoring: TdxBarSubItem;
BarSubMenuItemView: TdxBarSubItem;
BarSubMenuItemSearch: TdxBarSubItem;
BarSubMenuItemRun: TdxBarSubItem;
BarSubMenuItemDebug: TdxBarSubItem;
BarSubMenuItemLayout: TdxBarSubItem;
BarButtonViewRibbon: TdxBarButton;
ActionViewRibbon: TAction;
ActionViewMainMenu: TAction;
BarButtonViewMainMenu: TdxBarButton;
ActionViewLayout: TAction;
MenuItemFileSaveAs: TdxBarButton;
ActionFileSaveAs: TAction;
ActionFileSaveAsEx: TAction;
procedure FormCreate(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
procedure ActionBuildExecute(Sender: TObject);
procedure ActionClearAllBreakpointsExecute(Sender: TObject);
procedure ActionEditClearOutputWindowExecute(Sender: TObject);
procedure ActionEditClearOutputWindowUpdate(Sender: TObject);
procedure ActionCloseAllOtherPagesExecute(Sender: TObject);
procedure ActionCloseAllOtherPagesUpdate(Sender: TObject);
procedure ActionClosePageExecute(Sender: TObject);
procedure ActionClosePageUpdate(Sender: TObject);
procedure ActionFileCloseAllExecute(Sender: TObject);
procedure ActionFileNewIncludeFileExecute(Sender: TObject);
procedure ActionFileNewUnitExecute(Sender: TObject);
procedure ActionFileSaveAsFileExecute(Sender: TObject);
procedure ActionFileSaveAsFileUpdate(Sender: TObject);
procedure ActionFileSaveExecute(Sender: TObject);
procedure ActionFileSaveUpdate(Sender: TObject);
procedure ActionOpenFileExecute(Sender: TObject);
procedure ActionProgramResetExecute(Sender: TObject);
procedure ActionProgramResetUpdate(Sender: TObject);
procedure ActionRunExecute(Sender: TObject);
procedure ActionRunUpdate(Sender: TObject);
procedure ActionRunWithoutDebuggingExecute(Sender: TObject);
procedure ActionRunWithoutDebuggingUpdate(Sender: TObject);
procedure ActionShowExecutionPointExecute(Sender: TObject);
procedure ActionShowExecutionPointUpdate(Sender: TObject);
procedure ActionStepOverExecute(Sender: TObject);
procedure ActionStepOverUpdate(Sender: TObject);
procedure ActionEditToggleReadOnlyExecute(Sender: TObject);
procedure ActionEditToggleReadOnlyUpdate(Sender: TObject);
procedure ActionTraceIntoExecute(Sender: TObject);
procedure ActionTraceIntoUpdate(Sender: TObject);
procedure ActionViewProjectSourceUpdate(Sender: TObject);
procedure ActionViewSymbolsExecute(Sender: TObject);
procedure ActionViewSymbolsUpdate(Sender: TObject);
procedure DebuggerStateChanged(Sender: TObject);
procedure UpdateTimerTimer(Sender: TObject);
procedure ActionGotoLineNumberExecute(Sender: TObject);
procedure ActionGotoLineNumberUpdate(Sender: TObject);
procedure PageControlEditorCanCloseEx(Sender: TObject; ATabIndex: Integer; var ACanClose: Boolean);
procedure ActionExitExecute(Sender: TObject);
procedure ListViewMessagesDblClick(Sender: TObject);
procedure ActionRunResumeUpdate(Sender: TObject);
procedure ActionRunPauseExecute(Sender: TObject);
procedure ActionRunPauseUpdate(Sender: TObject);
procedure ActionRunStepOutExecute(Sender: TObject);
procedure ActionRunStepOutUpdate(Sender: TObject);
procedure ActionSearchFindExecute(Sender: TObject);
procedure ActionSearchFindUpdate(Sender: TObject);
procedure ActionSearchAgainExecute(Sender: TObject);
procedure ActionSearchAgainUpdate(Sender: TObject);
procedure ListViewMessagesDeletion(Sender: TObject; Item: TListItem);
procedure DebuggerDebugMessage(const msg: string);
procedure ActionDebugExecute(Sender: TObject);
procedure ActionDebugEvaluateExecute(Sender: TObject);
procedure ActionDebugEvaluateUpdate(Sender: TObject);
procedure ActionFileCloseAllUpdate(Sender: TObject);
procedure ActionExitUpdate(Sender: TObject);
procedure ActionFileSaveAsAttachmentExecute(Sender: TObject);
procedure ActionFileSaveAsAttachmentUpdate(Sender: TObject);
procedure ActionDebugBreakOnPoopExecute(Sender: TObject);
procedure DebuggerNotifyException(const exceptObj: IInfo);
procedure ActionViewCallStackExecute(Sender: TObject);
procedure ActionViewCallStackUpdate(Sender: TObject);
procedure ActionViewLocalsExecute(Sender: TObject);
procedure ActionViewLocalsUpdate(Sender: TObject);
procedure ActionViewWatchesExecute(Sender: TObject);
procedure ActionViewWatchesUpdate(Sender: TObject);
procedure ActionViewStackExecute(Sender: TObject);
procedure ActionViewStackUpdate(Sender: TObject);
procedure ActionViewMessagesExecute(Sender: TObject);
procedure ActionViewMessagesUpdate(Sender: TObject);
procedure ActionViewOutputExecute(Sender: TObject);
procedure ActionViewOutputUpdate(Sender: TObject);
procedure ActionViewBreakpointsExecute(Sender: TObject);
procedure ActionViewBreakpointsUpdate(Sender: TObject);
procedure ActionViewASTExecute(Sender: TObject);
procedure ActionViewASTUpdate(Sender: TObject);
procedure ActionToolDocBuildExecute(Sender: TObject);
procedure ActionToolCopyProtectExecute(Sender: TObject);
procedure ActionToolCopyProtectUpdate(Sender: TObject);
procedure ActionToolDocBuildUpdate(Sender: TObject);
procedure ActionRunFinalizationUpdate(Sender: TObject);
procedure ActionRunInitializationUpdate(Sender: TObject);
procedure ActionRunInitializationExecute(Sender: TObject);
procedure ActionRunFinalizationExecute(Sender: TObject);
procedure ActionBuildUpdate(Sender: TObject);
procedure DropFileTarget1Drop(Sender: TObject; ShiftState: TShiftState; APoint: TPoint; var Effect: Integer);
procedure DropFileTarget1Enter(Sender: TObject; ShiftState: TShiftState; APoint: TPoint; var Effect: Integer);
procedure ActionToolBundleExecute(Sender: TObject);
procedure ButtonToolDocumentXMLClick(Sender: TObject);
procedure ButtonToolDocumentSourceClick(Sender: TObject);
procedure DockPanelDebugFrameVisibleChanged(Sender: TdxCustomDockControl);
procedure DockPanelDebugFrameClose(Sender: TdxCustomDockControl);
procedure BarComboLayoutChange(Sender: TObject);
procedure ActionLayoutDefaultEditExecute(Sender: TObject);
procedure ActionLayoutDefaultDebugExecute(Sender: TObject);
procedure ActionLayoutSaveExecute(Sender: TObject);
procedure ActionLayoutDefaultEditUpdate(Sender: TObject);
procedure ActionLayoutDefaultDebugUpdate(Sender: TObject);
procedure DockingManagerLayoutChanged(Sender: TdxCustomDockControl);
procedure DockPanelDebugOtherVisibleChanged(Sender: TdxCustomDockControl);
procedure ListViewMessagesKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
procedure ActionRefactorNormalizeCaseExecute(Sender: TObject);
procedure ActionRefactorIdentifierRenameExecute(Sender: TObject);
procedure ActionGenericNotDebuggingUpdate(Sender: TObject);
procedure ActionMessagesClearExecute(Sender: TObject);
procedure ActionMessagesClearUpdate(Sender: TObject);
procedure ActionGotoDeclarationExecute(Sender: TObject);
procedure ActionGotoImplementationExecute(Sender: TObject);
procedure ActionGenericUpdateHasEditor(Sender: TObject);
procedure ActionToolHeaderExecute(Sender: TObject);
procedure ActionToolHeaderUpdate(Sender: TObject);
procedure ActionRefactorSearchSymbolExecute(Sender: TObject);
procedure DebuggerDebugStop(exec: TdwsExecution);
procedure dxBarButton12Click(Sender: TObject);
procedure PageControlEditorGetImageIndex(Sender: TObject; TabIndex: Integer; var ImageIndex: Integer);
procedure ActionFileMainUnitExecute(Sender: TObject);
procedure ActionFileMainUnitUpdate(Sender: TObject);
procedure PageControlEditorNewTabButtonClick(Sender: TObject; var AHandled: Boolean);
procedure PageControlEditorContextPopup(Sender: TObject; MousePos: TPoint; var Handled: Boolean);
procedure PageControlEditorDrawTabEx(AControl: TcxCustomTabControl; ATab: TcxTab; Font: TFont);
procedure PageControlEditorMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
procedure BarApplicationMenuExtraPaneItemClick(Sender: TObject; AIndex: Integer);
procedure BarApplicationMenuPopup(Sender: TObject);
procedure ActionDebugLiveObjectsExecute(Sender: TObject);
procedure ActionEditCopyToClipboardExecute(Sender: TObject);
procedure ActionEditCopyToClipboardUpdate(Sender: TObject);
procedure ActionEditCutUpdate(Sender: TObject);
procedure ActionEditCutExecute(Sender: TObject);
procedure ActionEditPasteUpdate(Sender: TObject);
procedure ActionEditSelectAllUpdate(Sender: TObject);
procedure ActionEditSelectAllExecute(Sender: TObject);
procedure ActionEditUndoExecute(Sender: TObject);
procedure ActionEditUndoUpdate(Sender: TObject);
procedure ActionEditDeleteExecute(Sender: TObject);
procedure ActionEditDeleteUpdate(Sender: TObject);
procedure ActionEditPasteExecute(Sender: TObject);
procedure ActionViewFileExplorerExecute(Sender: TObject);
procedure ActionViewFileExplorerUpdate(Sender: TObject);
procedure ButtonToolDocumentBuildClick(Sender: TObject);
procedure ActionDummyExecute(Sender: TObject);
procedure BarButtonRibbonClick(Sender: TObject);
procedure ActionViewRibbonExecute(Sender: TObject);
procedure ActionViewRibbonUpdate(Sender: TObject);
procedure ActionViewMainMenuExecute(Sender: TObject);
procedure ActionViewMainMenuUpdate(Sender: TObject);
procedure ActionJITUpdate(Sender: TObject);
procedure ActionJITExecute(Sender: TObject);
private
FScript: TDelphiWebScript;
FCompileContext: IScriptContext;
FProgram: IdwsProgram;
FMainUnitName: string;
FMainUnit: IScriptEditor;
FSaveOnNeedUnit: TdwsOnNeedUnitEvent;
FSaveResultType: TdwsResultType;
FGotoForm: TDwsIdeGotoLineNumber;
FSavedModalForm: TCustomForm;
FPreviousDebuggerState: TdwsDebuggerState;
FPendingExceptionMsg: string;
FPendingExceptionPos: TScriptPos;
private
// Editor container and view management
FActiveEditor: IScriptEditor;
// FEditorContainers maps from container control to editor
FEditorContainers: TDictionary<TWinControl, IScriptEditor>;
FEditors: TList<IScriptEditor>;
function EditorByName(const AName: string): IScriptEditor;
function EditorByContainer(const AContainer: TWinControl): IScriptEditor;
function ContainerByEditor(const AEditor: IScriptEditor): TWinControl;
procedure CloseEditor(const AEditor: IScriptEditor);
protected
procedure WMWindowPosChanged(var Msg: TWMWindowPosChanged); message WM_WINDOWPOSCHANGED;
procedure WMDpiChanged(var Message: TWMDpi); message WM_DPICHANGED;
procedure MsgExecReset(var Msg: TMessage); message MSG_EXEC_RESET;
procedure MsgFormMaximize(var Msg: TMessage); message MSG_FORM_MAXIMIZE;
procedure DoCreate; override;
procedure CreateParams(var Params: TCreateParams); override;
protected
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
private
// Recent files
procedure LoadRecentFiles;
procedure SaveRecentFiles;
procedure AddRecentFile(const Filename: string);
private
// HighDPI
FDPIScale: Double;
private
// Layout
FLayoutName: string; // Currently selected layout
FLayoutLoading: boolean;
procedure LoadLayouts;
procedure SaveLayout;
private
// Frames
FDebuggerFrames: TList<IScriptDebuggerWindow>;
private
// Debug stuff
FDebugStopwatch: TStopwatch;
FOnBeforeExecution: TDebuggerExecutionEvent;
FOnAfterExecution: TDebuggerExecutionEvent;
FOnDebuggerClose: TNotifyEvent;
FIntializationFinalizationMode: boolean;
FExecutingIntialization: boolean;
procedure DoOnExecutionStarted(Execution: TdwsProgramExecution);
procedure DoOnExecutionEnded(Execution: TdwsProgramExecution);
private
// Help
class var FHasCheckedHelpVersion: boolean;
private
FEnvironment: IdwsEnvironment;
FFormEvaluate: TFormDebugEvaluate;
function OpenScriptStream(const Name: string; const CurrentScriptProvider: IScriptProvider = nil): IScriptProvider;
function TryRunSelection(ADebug: Boolean): Boolean;
function DoExecute(ADebug: Boolean): Boolean;
function BeginDebug: Boolean;
function EndDebug: Boolean;
procedure NotifyEditors(Notification: TScriptEditorHostNotification);
procedure EditorChange(const AEditor: IScriptEditor);
procedure EditorPageClose(const AEditor: IScriptEditor);
function EditorPagesCloseQuery(const AExceptEditor: IScriptEditor = nil): boolean;
function EditorPagesCloseAll(const AExceptEditor: IScriptEditor = nil): boolean;
procedure EditorSaveAllIfModified(APromptOverwrite: Boolean);
procedure ResetProgram;
procedure SetScript(const Value: TDelphiWebScript);
procedure AddMessage(const AMessage: string; const AScriptPos: TScriptPos; AKind: TMessageKind = mkNone; Select: boolean = False); overload;
procedure AddMessage(const AMessage: string; AKind: TMessageKind = mkNone; Select: boolean = False); overload;
procedure ClearMessagesWindow;
procedure ClearOutputWindow;
function AddAlertMessage(const ACaption, AMessage: string; AImageIndex: integer = -1; ATimeout: integer = -1): IScriptHostAlertWindow;
function UnitMainScript(const AUnitName, AIdentifier: string): string;
function HasEditorPage: Boolean;
function FileIsOpenInEditor(const AFileName: TFileName; Activate: boolean = False): Boolean;
function ModifyFileNameToUniqueInProject(const AFileName: TFileName): string;
procedure ClearCurrentLine;
procedure ClearAllBreakpoints;
procedure AddStatusMessage(const AStr: string);
function GetScriptProvider(var MainUnitName: string; const AScript: string = ''): IScriptProvider;
function CreateCompilerContext(const ScriptProvider: IScriptProvider): IScriptContext;
procedure Compile(ABuild: Boolean; const AScript: string = '');
function IsCompiled: Boolean;
procedure ListSymbols;
procedure RunFunctionMethodByName(const AUnit, AName: string; AWithDebugging, APrompt: Boolean);
function GetGotoForm: TDwsIdeGotoLineNumber;
property GotoForm: TDwsIdeGotoLineNumber read GetGotoForm;
procedure SavePage(const Page: IScriptEditor);
function DoOnNeedUnit(const unitName : UnicodeString; var unitSource : UnicodeString) : IdwsUnit;
private
FSearchText: string;
FSearchOptions: TSearchReplaceOptions;
FSearchHistory: string;
FSearchAutoWrap: boolean;
procedure DoSearch(AOptions: TSearchReplaceOptions; First: boolean);
private
// Shell explorer
{$ifdef SHELL_EXPLORER}
FShellListViewFileExplorer: TcxShellListView;
FShellComboBoxFileExplorer: TcxShellComboBox;
procedure ShellListViewFileExplorerExecuteItem(Sender: TObject; APIDL: PItemIDList; var AHandled: Boolean);
{$endif SHELL_EXPLORER}
protected
// IScriptHostApplicationNotification
procedure ApplicationNotify(const ScriptHostApplication: IScriptHostApplication; Notification: TScriptHostApplicationNotification);
// IScriptHostApplicationCloseNotification
procedure ApplicationCloseQuery(const ScriptHostApplication: IScriptHostApplication; var CanClose: boolean);
private
FCaseNormalizeScriptProgram: IdwsProgram;
procedure OnCaseNormalize(Line, Col : Integer; const Name : string);
private
FScriptDebuggerHost: IScriptDebuggerHost;
protected
procedure SetDebuggerHost(const AScriptDebuggerHost: IScriptDebuggerHost);
protected
// IScriptDebuggerSetup
procedure SetEnvironment(const AEnvironment: IdwsEnvironment);
function AttachAndExecute(const AExecution: IdwsProgramExecution): boolean;
function Execute(Modal: boolean = False): boolean;
private
FDebuggerSubscriptions: TList<IScriptDebuggerNotification>;
procedure DebuggerNotify(Notification: TScriptDebuggerNotification);
private
// IScriptDebugger
procedure DebuggerSubscribe(const Subscriber: IScriptDebuggerNotification);
procedure IScriptDebugger.Subscribe = DebuggerSubscribe;
procedure DebuggerUnsubscribe(const Subscriber: IScriptDebuggerNotification);
procedure IScriptDebugger.Unsubscribe = DebuggerUnsubscribe;
function GetDebugger: TdwsDebugger;
function GetProgram: IdwsProgram;
procedure ViewScriptPos(const AScriptPos: TScriptPos; AMoveCurrent: boolean = False; AHiddenMainModule: Boolean = False);
function GetExecutableLines(const AUnitName: string): TLineNumbers;
function FindBreakPoint(const ScriptPos: TScriptPos): TBreakpointStatus;
procedure AddBreakpoint(const ScriptPos: TScriptPos; AEnabled: Boolean = True);
procedure ClearBreakpoint(const ScriptPos: TScriptPos);
procedure NotifyBreakPoint(Breakpoint: TdwsDebuggerBreakpoint; Notification: TScriptDebuggerBreakpointNotification; Updates: TBreakpointUpdates = []);
function SymbolToImageIndex(Symbol: TSymbol): integer;
procedure AddWatch(const Expression: string);
function GetCompiledScript: IdwsProgram;
procedure Evaluate(const Expression: string; ScriptPos: PScriptPos = nil);
function UnitNameFromScriptPos(const ScriptPos: TScriptPos): string;
function UnitNameFromInternalName(const Name: string): string;
protected
// IScriptEditorHost
function CreateEditor(const AName: string; FileMustExist: boolean = False; const CurrentScriptProvider: IScriptProvider = nil): Boolean; overload;
function GetMainUnit: IScriptEditor;
procedure SetMainUnit(const Value: IScriptEditor);
property MainUnit: IScriptEditor read GetMainUnit write SetMainUnit;
function GetMainUnitName: string;
property MainUnitName: string read GetMainUnitName;
function GetActiveEditor: IScriptEditor;
procedure SetActiveEditor(const Editor: IScriptEditor);
function GetEditorPagePopupMenu: TPopupMenu;
function PromptSaveScript(var Filename: string; const Foldername: string = ''): boolean;
function DpiScale(Value: Integer): Integer;
protected
// IScriptEditorNotification
procedure ScriptEditorNotification(const AEditor: IScriptEditor; ANotification: TScriptEditorNotification);
// IScriptEditorActionHandler
function EditorActionHandler(const AEditor: IScriptEditor; AAction: TScriptEditorAction): boolean;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure AfterConstruction; override;
procedure BeforeDestruction; override;
property Script: TDelphiWebScript read FScript write SetScript;
property Environment: IdwsEnvironment read FEnvironment write FEnvironment;
property ActiveEditor: IScriptEditor read FActiveEditor;
// Create an editor. Optionally load a script into it.
function CreateEditor(const ScriptProvider: IScriptProvider = nil): IScriptEditor; overload;
// Create an editor with the specified filename. Optionally load a script from the file.
function CreateEditor(const AFileName: TFileName; ALoadfile: Boolean = False; AFileRequired: boolean = False; const CurrentScriptProvider: IScriptProvider = nil): IScriptEditor; overload;
// Create an editor with the specified Name. Load the specified script into it.
function CreateEditor(const AName, AScript: string): IScriptEditor; overload;
property OnBeforeExecution: TDebuggerExecutionEvent read FOnBeforeExecution write FOnBeforeExecution;
property OnAfterExecution: TDebuggerExecutionEvent read FOnAfterExecution write FOnAfterExecution;
procedure AddMessageInfo(Messages: TdwsMessageList; Index: integer = -1);
property OnDebuggerClose: TNotifyEvent read FOnDebuggerClose write FOnDebuggerClose;
end;
procedure DwsIDE_ShowModal(AScript: TDelphiWebScript; const Environment: IdwsEnvironment);
const
sScriptHeaderTemplate =
'(*'+#13+
'Plugin Name:'#9'<name of your script>'+#13+
'Plugin URI:'#9'<URL of your scripts home page>'+#13+
'Description:'#9'<a description of what your script does>'+#13+
'Version:'#9'<the version of your script>'+#13+
'Author: '#9'<your name>'+#13+
'Author URI:'#9'<the URL of your home page>'+#13+
'Product ID:'#9'%s'+#13+
'Author ID:'#9'%s'+#13+
'*)'+#13;
sScriptHeaderTemplateProductID = '<the license product ID>';
sScriptHeaderTemplateAuthorID = '<your public API key>';
// The folder where we will output files when generating documentation
sScriptHelpRtlSourceFolder = '%AppInstall%\..\Documentation\Source';
// The name of the generated help file
sScriptHelpRtlFilename = 'ScriptRTL.chm';
// Locations of RTL help file at run time
// Location of preinstalled help file
sScriptHelpRtlFilenameDefault = '%AppInstall%\Help\'+sScriptHelpRtlFilename;
// Fallback location used during debug/development (grab file directly from the place where it's generated)
sScriptHelpRtlFilenameDebug = '%AppInstall%\..\Documentation\Output\CHM\'+sScriptHelpRtlFilename;
// Location of downloaded help file
sScriptHelpRtlFilenameDownload = '%Documents%\%AppName%\Help\'+sScriptHelpRtlFilename;
implementation
{$R *.dfm}
uses
System.UITypes,
System.Generics.Defaults,
System.Win.Registry,
System.Math,
System.StrUtils,
System.IniFiles,
System.HelpIntfs,
Vcl.HtmlHelpViewer,
Vcl.Consts,
Vcl.Clipbrd,
SynMacroRecorder,
dwsXPlatform,
dwsSuggestions,
dwsDebugFunctions,
dwsTokenizer,
dwsFileSystem,
dwsDataContext,
dwsCaseNormalizer,
dwsContextMap,
dwsJIT,
{$ifdef WIN32}
dwsJITx86,
{$endif}
{$ifdef WIN64}
dwsJITx86_64,
{$endif}
SynTaskDialog,
IOUtils, amIOUtils, // Bug fix
amDialogs,
amCursorService,
amInputQueryDialog,
amEnvironment,
amURLUtils,
amScript.IDE.Data,
amScript.Editor.Dialog.Search, // TODO : Move this out of IDE unit
amScript.Editor.SynEdit.Data, // TODO : Abstract this out of IDE unit
amScript.Editor.SynEdit, // This registers the SynEdit-based editor
{$ifdef FEATURE_SCRIPT_BUNDLE}
amScript.IDE.Dialog.BundleBuilder,
{$endif FEATURE_SCRIPT_BUNDLE}
amScript.DocBuilder,
amScript.FileSystem.API,
amScript.FileSystem,
amScript.Provider,
amScript.Host.Provider,
amScript.Package.API,
amScript.IDE.Settings;
const //resourcestring
RStrScriptFolderNotFound = 'Script folder "%s" does not exist';
RStrScriptCannotBeNil = 'Script cannot be nil - the IDE requires a script to debug';
RStrScriptDoesNotDefineMainPath = 'Script does not define a main path';
RStrFileAlreadyExistsOverwrite = 'File "%s" already exists. Overwrite it?';
RStrFileHasChanged = 'File "%s" has changed. Save it now?';
RStrAbandonDebugging = 'Abandon debugging?';
RStrCompileStarted = 'Compile started';
RStrCompileCompleteWarnHints = 'Compile complete with hints/warnings';
RStrRunFunctionMethod = 'Run function/method "%s"?';
RStrRunning = 'Running';
RStrPaused = 'Paused';
RStrErrors = 'Errors';
RStrProjectFileDoesNotExist = 'Project file does not exist (%s)';
RStrCannotRunWithoutProjectFile = 'Cannot run without a project file';
RStrProgramCompleted = 'Program completed';
const
CMargin = 4;
CSlantMargin = 10;
CCloseButtonSize = 12;
CArrowButtonSize = 15;
// Utility routines
// -----------------------------------------------------------------------------
function BrandString(const s: string): string; deprecated 'BrandString not really implemented';
begin
Result := StringReplace(s, '%brandname%', sScriptDebuggerBrandName, [rfReplaceAll, rfIgnoreCase]);
end;
function GetDesktopPath: string;
const
CSIDL_APPDATA = $001A;
var
LStr: array[0 .. MAX_PATH] of Char;
begin
SetLastError(ERROR_SUCCESS);
if SHGetFolderPath(0, CSIDL_DESKTOP, 0, 0, @LStr) = S_OK then
Result := LStr;
end;
function IsHostedControl(AControl: TControl): Boolean;
// Returns TRUE if this control is hosted within another control
begin
Result := AControl.Parent <> nil;
end;
procedure DwsIDE_ShowModal(AScript: TDelphiWebScript; const Environment: IdwsEnvironment);
var
Frm: TFormScriptDebugger;
begin
Frm := TFormScriptDebugger.Create(Application);
try
Frm.Script := AScript;
Frm.Environment := Environment;
Frm.ShowModal;
finally
Frm.Free;
end;
end;
function JustFileName(const AFileName: TFileName): string;
// Returns only the file name without dir or ext
begin
Result := ExtractFileName(AFileName);
if (AnsiSameText(ExtractFileExt(Result), sScriptFileType)) then
Result := ChangeFileExt(Result, '');
end;
function PrepareScriptMessageForHumanConsumption(const Msg: string): string;
begin
Result := StringReplace(Msg, ' -- Tdws', #13' ', [rfReplaceAll]);
Result := StringReplace(Result, ' Tdws', #13#13' ', [rfReplaceAll]); // First
Result := StringReplace(Result, 'Tdws', '', [rfReplaceAll]); // Any remaining - shouldn't be any
Result := StringReplace(Result, ' -- ', #13#13, [rfReplaceAll]); // Last
end;
procedure ErrorDlg(const AStr: string);
begin
MessageTaskDlgEx('Error', PrepareScriptMessageForHumanConsumption(AStr), mtWarning, [mbok]);
end;
function ConfirmDlg(const AStr: string): Boolean;
begin
Result := (MessageTaskDlgEx('Confirm', AStr, mtConfirmation, [mbYes, mbNo]) = mrYes);
end;
procedure SymbolsToStrings(ATable: TSymbolTable; AStrings: TStrings);
// Dumps this table symbol names to AStrings recursively.
procedure AddSymbolTable(ATable: TSymbolTable);
var
I: Integer;
Sym: TSymbol;
begin
if (ATable = nil) then
exit;
for I := 0 to ATable.Count - 1 do
begin
Sym := ATable.Symbols[I];
if Sym is TUnitSymbol then
AddSymbolTable(TUnitSymbol(Sym).Table)
else
AStrings.Add(Sym.Name + ' ' + Sym.ToString + ' (' + Sym.ClassName + ')');
end;
end;
begin
AddSymbolTable(ATable);
end;
// -----------------------------------------------------------------------------
//
// TOutputWindowStringResultType
//
// -----------------------------------------------------------------------------
type
TOutputWindowStringResultType = class(TdwsStringResultType)
strict private
FScriptDebuggerForm: TFormScriptDebugger;
protected
procedure DoAddString(Result: TdwsStringResult; var str: string); override;
procedure DoReadLn(Result: TdwsStringResult; var str: string); override;
procedure DoReadChar(Result: TdwsStringResult; var str: string); override;
public
constructor Create(AOwner: TComponent; AScriptDebuggerForm: TFormScriptDebugger); reintroduce;
end;
constructor TOutputWindowStringResultType.Create(AOwner: TComponent; AScriptDebuggerForm: TFormScriptDebugger);
begin
inherited Create(AOwner);
FScriptDebuggerForm := AScriptDebuggerForm;
end;
procedure TOutputWindowStringResultType.DoAddString(result: TdwsStringResult; var str: string);
begin
while (str <> '') and (str[Length(str)] in [#10,#13]) do
SetLength(str, Length(str)-1);
FScriptDebuggerForm.MemoOutputWindow.Lines.Add('STD: ' + str);
end;
procedure TOutputWindowStringResultType.DoReadChar(result: TdwsStringResult; var str: string);
var
c: Char;
begin
Read(c);
str := c;
end;
procedure TOutputWindowStringResultType.DoReadLn(result: TdwsStringResult; var str: string);
begin
ReadLn(str);
end;
// -----------------------------------------------------------------------------
//
// TFormScriptDebugger
//
// -----------------------------------------------------------------------------
constructor TFormScriptDebugger.Create(AOwner: TComponent);
begin
// Ensure datamodule has been instantiated before form loads
DataModuleDebuggerViewData;
inherited Create(AOwner);
DisableAero := True; // Enables skinning of caption bar
FSearchHistory := '';
FSearchOptions := [];
FDebuggerFrames := TList<IScriptDebuggerWindow>.Create;
FEditorContainers := TDictionary<TWinControl, IScriptEditor>.Create;
FEditors := TList<IScriptEditor>.Create;
end;
procedure TFormScriptDebugger.AfterConstruction;
var
DebuggerFrame: IScriptDebuggerWindow;