2
$Id: fpviews.pas,v 1.59 2005/03/07 17:16:56 peter Exp $
3
This file is part of the Free Pascal Integrated Development Environment
4
Copyright (c) 1998 by Berczi Gabor
6
Views and view-related functions for the IDE
8
See the file COPYING.FPC, included in this distribution,
9
for details about the copyright.
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15
**********************************************************************}
25
Views,Menus,Dialogs,App,Gadgets,Tabs,
28
WUtils,WHelp,WHlpView,WViews,WANSI,
33
TEditor = TCodeEditor;
34
PEditor = PCodeEditor;
36
PStoreCollection = ^TStoreCollection;
37
TStoreCollection = object(TStringCollection)
38
function Add(const S: string): PString;
41
PIntegerLine = ^TIntegerLine;
42
TIntegerLine = object(TInputLine)
43
constructor Init(var Bounds: TRect; AMin, AMax: longint);
46
PFPHeapView = ^TFPHeapView;
47
TFPHeapView = object(THeapView)
48
constructor Init(var Bounds: TRect);
49
constructor InitKb(var Bounds: TRect);
50
procedure HandleEvent(var Event: TEvent); virtual;
53
PFPClockView = ^TFPClockView;
54
TFPClockView = object(TClockView)
55
constructor Init(var Bounds: TRect);
56
procedure HandleEvent(var Event: TEvent); virtual;
57
function GetPalette: PPalette; virtual;
60
PFPWindow = ^TFPWindow;
61
TFPWindow = object(TWindow)
63
procedure HandleEvent(var Event: TEvent); virtual;
64
procedure SetState(AState: Word; Enable: Boolean); virtual;
65
procedure UpdateCommands; virtual;
66
constructor Load(var S: TStream);
67
procedure Store(var S: TStream);
68
procedure Update; virtual;
69
procedure SelectInDebugSession;
72
PFPHelpViewer = ^TFPHelpViewer;
73
TFPHelpViewer = object(THelpViewer)
74
function GetLocalMenu: PMenu; virtual;
75
function GetCommandTarget: PView; virtual;
78
PFPHelpWindow = ^TFPHelpWindow;
79
TFPHelpWindow = object(THelpWindow)
80
constructor Init(var Bounds: TRect; ATitle: TTitleStr; ASourceFileID: word; AContext: THelpCtx; ANumber: Integer);
81
destructor Done;virtual;
82
procedure InitHelpView; virtual;
83
procedure Show; {virtual;}
84
procedure Hide; {virtual;}
85
procedure HandleEvent(var Event: TEvent); virtual;
86
function GetPalette: PPalette; virtual;
87
constructor Load(var S: TStream);
88
procedure Store(var S: TStream);
91
PTextScroller = ^TTextScroller;
92
TTextScroller = object(TStaticText)
95
Lines : PUnsortedStringCollection;
96
constructor Init(var Bounds: TRect; ASpeed: integer; AText: PUnsortedStringCollection);
97
function GetLineCount: integer; virtual;
98
function GetLine(I: integer): string; virtual;
99
procedure HandleEvent(var Event: TEvent); virtual;
100
procedure Update; virtual;
101
procedure Reset; virtual;
102
procedure Scroll; virtual;
103
procedure Draw; virtual;
104
destructor Done; virtual;
109
TAlign = (alLeft,alCenter,alRight);
111
PFPToolTip = ^TFPToolTip;
112
TFPToolTip = object(TView)
113
constructor Init(var Bounds: TRect; const AText: string; AAlign: TAlign);
114
procedure Draw; virtual;
115
function GetText: string;
116
procedure SetText(const AText: string);
117
function GetAlign: TAlign;
118
procedure SetAlign(AAlign: TAlign);
119
function GetPalette: PPalette; virtual;
120
destructor Done; virtual;
126
PSourceEditor = ^TSourceEditor;
127
TSourceEditor = object(TFileEditor)
128
constructor Init(var Bounds: TRect; AHScrollBar, AVScrollBar:
129
PScrollBar; AIndicator: PIndicator;const AFileName: string);
130
CompileStamp : longint;
131
CodeCompleteTip: PFPToolTip;
134
ShouldHandleBreakpoints : boolean;
138
function IsReservedWord(const S: string): boolean; virtual;
139
function IsAsmReservedWord(const S: string): boolean; virtual;
140
function GetSpecSymbolCount(SpecClass: TSpecSymbolClass): integer; virtual;
141
function GetSpecSymbol(SpecClass: TSpecSymbolClass; Index: integer): pstring; virtual;
143
function TranslateCodeTemplate(var Shortcut: string; ALines: PUnsortedStringCollection): boolean; virtual;
144
function SelectCodeTemplate(var ShortCut: string): boolean; virtual;
146
function CompleteCodeWord(const WordS: string; var Text: string): boolean; virtual;
147
procedure FindMatchingDelimiter(ScanForward: boolean); virtual;
148
procedure SetCodeCompleteWord(const S: string); virtual;
149
procedure AlignCodeCompleteTip;
150
procedure HandleEvent(var Event: TEvent); virtual;
156
function Valid(Command: Word): Boolean;virtual;
157
function GetLocalMenu: PMenu; virtual;
158
function GetCommandTarget: PView; virtual;
159
function CreateLocalMenuView(var Bounds: TRect; M: PMenu): PMenuPopup; virtual;
160
procedure ModifiedChanged; virtual;
161
procedure InsertOptions; virtual;
162
procedure PushInfo(Const st : string);virtual;
163
procedure PopInfo;virtual;
164
procedure DeleteLine(I: sw_integer); virtual;
165
procedure BackSpace; virtual;
166
procedure DelChar; virtual;
167
procedure DelSelect; virtual;
168
function InsertNewLine : Sw_integer;virtual;
169
function InsertLine(LineNo: sw_integer; const S: string): PCustomLine; virtual;
170
procedure AddLine(const S: string); virtual;
173
PSourceWindow = ^TSourceWindow;
174
TSourceWindow = object(TFPWindow)
175
Editor : PSourceEditor;
176
Indicator : PIndicator;
177
NoNameCount : longint;
178
constructor Init(var Bounds: TRect; AFileName: string);
179
function GetTitle(MaxSize: sw_Integer): TTitleStr; virtual;
180
procedure SetTitle(ATitle: string); virtual;
181
procedure UpdateTitle; virtual;
182
procedure HandleEvent(var Event: TEvent); virtual;
183
procedure Update; virtual;
184
procedure UpdateCommands; virtual;
185
function GetPalette: PPalette; virtual;
186
constructor Load(var S: TStream);
187
procedure Store(var S: TStream);
188
procedure Close; virtual;
189
destructor Done; virtual;
193
PGDBSourceEditor = ^TGDBSourceEditor;
194
TGDBSourceEditor = object(TSourceEditor)
195
function InsertNewLine : Sw_integer;virtual;
196
function Valid(Command: Word): Boolean; virtual;
197
procedure AddLine(const S: string); virtual;
198
procedure AddErrorLine(const S: string); virtual;
200
function IsReservedWord(const S: string): boolean; virtual;
204
IgnoreStringAtEnd : boolean;
205
LastCommand : String;
208
PGDBWindow = ^TGDBWindow;
209
TGDBWindow = object(TFPWindow)
210
Editor : PGDBSourceEditor;
211
Indicator : PIndicator;
212
constructor Init(var Bounds: TRect);
213
procedure HandleEvent(var Event: TEvent); virtual;
214
procedure WriteText(Buf : pchar;IsError : boolean);
215
procedure WriteString(Const S : string);
216
procedure WriteErrorString(Const S : string);
217
procedure WriteOutputText(Buf : pchar);
218
procedure WriteErrorText(Buf : pchar);
219
function GetPalette: PPalette;virtual;
220
constructor Load(var S: TStream);
221
procedure Store(var S: TStream);
222
procedure UpdateCommands; virtual;
223
destructor Done; virtual;
226
PDisasLine = ^TDisasLine;
227
TDisasLine = object(TLine)
228
address : cardinal;{ should be target size of address for cross debuggers }
231
PDisasLineCollection = ^TDisasLineCollection;
232
TDisasLineCollection = object(TLineCollection)
233
function At(Index: sw_Integer): PDisasLine;
236
PDisassemblyEditor = ^TDisassemblyEditor;
237
TDisassemblyEditor = object(TSourceEditor)
238
CurrentSource : String;
239
CurrentLine : longint;
240
constructor Init(var Bounds: TRect; AHScrollBar, AVScrollBar:
241
PScrollBar; AIndicator: PIndicator;const AFileName: string);
242
procedure ReleaseSource;
243
destructor Done;virtual;
244
procedure AddSourceLine(const AFileName: string;line : longint); virtual;
245
procedure AddAssemblyLine(const S: string;AAddress : cardinal); virtual;
246
function GetCurrentLine(address : cardinal) : PDisasLine;
248
Source : PSourceWindow;
249
OwnsSource : Boolean;
250
DisasLines : PDisasLineCollection;
251
MinAddress,MaxAddress : cardinal;
255
PDisassemblyWindow = ^TDisassemblyWindow;
256
TDisassemblyWindow = object(TFPWindow)
257
Editor : PDisassemblyEditor;
258
Indicator : PIndicator;
259
constructor Init(var Bounds: TRect);
260
procedure LoadFunction(Const FuncName : string);
261
procedure LoadAddress(Addr : cardinal);
262
function ProcessPChar(p : pchar) : boolean;
263
procedure HandleEvent(var Event: TEvent); virtual;
264
procedure WriteSourceString(Const S : string;line : longint);
265
procedure WriteDisassemblyString(Const S : string;address : cardinal);
266
procedure SetCurAddress(address : cardinal);
267
procedure UpdateCommands; virtual;
268
function GetPalette: PPalette;virtual;
269
destructor Done; virtual;
273
PClipboardWindow = ^TClipboardWindow;
274
TClipboardWindow = object(TSourceWindow)
276
procedure Close; virtual;
277
constructor Load(var S: TStream);
278
procedure Store(var S: TStream);
279
destructor Done; virtual;
282
PMessageItem = ^TMessageItem;
283
TMessageItem = object(TObject)
287
Row,Col : sw_integer;
288
constructor Init(AClass: longint; const AText: string; AModule: PString; ARow, ACol: sw_integer);
289
function GetText(MaxLen: Sw_integer): string; virtual;
290
procedure Selected; virtual;
291
function GetModuleName: string; virtual;
292
destructor Done; virtual;
295
PMessageListBox = ^TMessageListBox;
296
TMessageListBox = object(THSListBox)
297
Transparent : boolean;
298
NoSelection : boolean;
299
MaxWidth : Sw_integer;
300
ModuleNames : PStoreCollection;
301
constructor Init(var Bounds: TRect; AHScrollBar, AVScrollBar: PScrollBar);
302
procedure SetState(AState: Word; Enable: Boolean); virtual;
303
procedure AddItem(P: PMessageItem); virtual;
304
function AddModuleName(const Name: string): PString; virtual;
305
function GetText(Item,MaxLen: Sw_Integer): String; virtual;
306
procedure Clear; virtual;
307
procedure TrackSource; virtual;
308
procedure GotoSource; virtual;
309
procedure Draw; virtual;
310
procedure HandleEvent(var Event: TEvent); virtual;
311
function GetLocalMenu: PMenu; virtual;
312
constructor Load(var S: TStream);
313
procedure Store(var S: TStream);
314
destructor Done; virtual;
318
PFPDlgWindow = ^TFPDlgWindow;
319
TFPDlgWindow = object(TDlgWindow)
320
procedure HandleEvent(var Event: TEvent); virtual;
324
PTabItem = ^TTabItem;
341
TTab = object(TGroup)
345
constructor Init(var Bounds: TRect; ATabDef: PTabDef);
346
function AtTab(Index: integer): PTabDef; virtual;
347
procedure SelectTab(Index: integer); virtual;
348
function TabCount: integer;
349
procedure SelectNextTab(Forwards: boolean);
350
function Valid(Command: Word): Boolean; virtual;
351
procedure ChangeBounds(var Bounds: TRect); virtual;
352
procedure HandleEvent(var Event: TEvent); virtual;
353
function GetPalette: PPalette; virtual;
354
procedure Draw; virtual;
355
procedure SetState(AState: Word; Enable: Boolean); virtual;
356
destructor Done; virtual;
362
PScreenView = ^TScreenView;
363
TScreenView = object(TScroller)
365
constructor Init(var Bounds: TRect; AHScrollBar, AVScrollBar: PScrollBar;
367
procedure Draw; virtual;
368
procedure Update; virtual;
369
procedure HandleEvent(var Event: TEvent); virtual;
372
PScreenWindow = ^TScreenWindow;
373
TScreenWindow = object(TFPWindow)
374
ScreenView : PScreenView;
375
constructor Init(AScreen: PScreen; ANumber: integer);
376
destructor Done; virtual;
379
PFPAboutDialog = ^TFPAboutDialog;
380
TFPAboutDialog = object(TCenterDialog)
382
procedure ToggleInfo;
383
procedure HandleEvent(var Event: TEvent); virtual;
385
Scroller: PTextScroller;
386
TitleST : PStaticText;
389
PFPASCIIChart = ^TFPASCIIChart;
390
TFPASCIIChart = object(TASCIIChart)
392
constructor Load(var S: TStream);
393
procedure Store(var S: TStream);
394
procedure HandleEvent(var Event: TEvent); virtual;
395
destructor Done; virtual;
398
PVideoModeListBox = ^TVideoModeListBox;
399
TVideoModeListBox = object(TDropDownListBox)
400
function GetText(Item: pointer; MaxLen: sw_integer): string; virtual;
403
PFPDesktop = ^TFPDesktop;
404
TFPDesktop = object(TDesktop)
405
constructor Init(var Bounds: TRect);
406
procedure InitBackground; virtual;
407
constructor Load(var S: TStream);
408
procedure Store(var S: TStream);
412
TFPMemo = object(TCodeEditor)
413
constructor Init(var Bounds: TRect; AHScrollBar, AVScrollBar:
414
PScrollBar; AIndicator: PIndicator);
415
function IsReservedWord(const S: string): boolean; virtual;
416
function GetSpecSymbolCount(SpecClass: TSpecSymbolClass): integer; virtual;
417
function GetSpecSymbol(SpecClass: TSpecSymbolClass; Index: integer): pstring; virtual;
418
function GetPalette: PPalette; virtual;
421
PFPCodeMemo = ^TFPCodeMemo;
422
TFPCodeMemo = object(TFPMemo)
423
constructor Init(var Bounds: TRect; AHScrollBar, AVScrollBar:
424
PScrollBar; AIndicator: PIndicator);
425
function IsReservedWord(const S: string): boolean; virtual;
426
function GetSpecSymbolCount(SpecClass: TSpecSymbolClass): integer; virtual;
427
function GetSpecSymbol(SpecClass: TSpecSymbolClass; Index: integer): pstring; virtual;
430
function SearchFreeWindowNo: integer;
432
function IsWindow(P: PView): boolean;
433
function IsThereAnyEditor: boolean;
434
function IsThereAnyWindow: boolean;
435
function IsThereAnyVisibleWindow: boolean;
436
function IsThereAnyNumberedWindow: boolean;
437
function FirstEditorWindow: PSourceWindow;
438
function EditorWindowFile(const Name : String): PSourceWindow;
439
procedure AskToReloadAllModifiedFiles;
442
function InDisassemblyWindow :boolean;
445
function NewTabItem(AView: PView; ANext: PTabItem): PTabItem;
446
procedure DisposeTabItem(P: PTabItem);
447
function NewTabDef(AName: string; ADefItem: PView; AItems: PTabItem; ANext: PTabDef): PTabDef;
448
procedure DisposeTabDef(P: PTabDef);
450
function GetEditorCurWord(Editor: PEditor; ValidSpecChars: TCharSet): string;
451
procedure InitReservedWords;
452
procedure DoneReservedWords;
453
function GetReservedWordCount: integer;
454
function GetReservedWord(Index: integer): string;
455
function GetAsmReservedWordCount: integer;
456
function GetAsmReservedWord(Index: integer): string;
458
procedure TranslateMouseClick(View: PView; var Event: TEvent);
460
function GetNextEditorBounds(var Bounds: TRect): boolean;
461
function OpenEditorWindow(Bounds: PRect; FileName: string; CurX,CurY: sw_integer): PSourceWindow;
462
function IOpenEditorWindow(Bounds: PRect; FileName: string; CurX,CurY: sw_integer; ShowIt: boolean): PSourceWindow;
463
function LastSourceEditor : PSourceWindow;
464
function SearchOnDesktop(FileName : string;tryexts:boolean) : PSourceWindow;
465
function TryToOpenFile(Bounds: PRect; FileName: string; CurX,CurY: sw_integer;tryexts: boolean): PSourceWindow;
466
function ITryToOpenFile(Bounds: PRect; FileName: string; CurX,CurY: sw_integer;tryexts, ShowIt,
467
ForceNewWindow:boolean): PSourceWindow;
468
function LocateSourceFile(const FileName: string; tryexts: boolean): string;
470
function SearchWindow(const Title: string): PWindow;
472
function StartEditor(Editor: PCodeEditor; FileName: string): boolean;
475
procedure InitVESAScreenModes;
476
procedure DoneVESAScreenModes;
479
procedure NoDebugger;
482
SourceCmds : TCommandSet =
483
([cmSave,cmSaveAs,cmCompile,cmHide,cmDoReload]);
484
EditorCmds : TCommandSet =
485
([cmFind,cmReplace,cmSearchAgain,cmJumpLine,cmHelpTopicSearch]);
486
CompileCmds : TCommandSet =
487
([cmMake,cmBuild,cmRun]);
489
CalcClipboard : extended = 0;
491
OpenFileName : string = '';
492
OpenFileLastExt : string[12] = '*.pas';
493
NewEditorOpened : boolean = false;
495
var MsgParms : array[1..10] of
502
procedure RegisterFPViews;
507
Video,Strings,Keyboard,Validate,
508
globtype,Tokens,Version,
510
{$if defined(I386) or defined(x64_86)}
513
{$ifdef USE_EXTERNAL_COMPILER}
514
fpintf, { superseeds version_string of version unit }
515
{$endif USE_EXTERNAL_COMPILER}
519
{$ifdef VESA}Vesa,{$endif}
520
FPString,FPSwitch,FPSymbol,FPDebug,FPVars,FPUtils,FPCompil,FPHelp,
521
FPTools,FPIDE,FPCodTmp,FPCodCmp;
524
RSourceEditor: TStreamRec = (
526
VmtLink: Ofs(TypeOf(TSourceEditor)^);
527
Load: @TSourceEditor.Load;
528
Store: @TSourceEditor.Store
530
RSourceWindow: TStreamRec = (
532
VmtLink: Ofs(TypeOf(TSourceWindow)^);
533
Load: @TSourceWindow.Load;
534
Store: @TSourceWindow.Store
536
RFPHelpViewer: TStreamRec = (
538
VmtLink: Ofs(TypeOf(TFPHelpViewer)^);
539
Load: @TFPHelpViewer.Load;
540
Store: @TFPHelpViewer.Store
542
RFPHelpWindow: TStreamRec = (
544
VmtLink: Ofs(TypeOf(TFPHelpWindow)^);
545
Load: @TFPHelpWindow.Load;
546
Store: @TFPHelpWindow.Store
548
RClipboardWindow: TStreamRec = (
550
VmtLink: Ofs(TypeOf(TClipboardWindow)^);
551
Load: @TClipboardWindow.Load;
552
Store: @TClipboardWindow.Store
554
RMessageListBox: TStreamRec = (
556
VmtLink: Ofs(TypeOf(TMessageListBox)^);
557
Load: @TMessageListBox.Load;
558
Store: @TMessageListBox.Store
560
RFPDesktop: TStreamRec = (
562
VmtLink: Ofs(TypeOf(TFPDesktop)^);
563
Load: @TFPDesktop.Load;
564
Store: @TFPDesktop.Store
567
RFPASCIIChart: TStreamRec = (
569
VmtLink: Ofs(TypeOf(TFPASCIIChart)^);
570
Load: @TFPASCIIChart.Load;
571
Store: @TFPASCIIChart.Store
573
RFPDlgWindow: TStreamRec = (
575
VmtLink: Ofs(TypeOf(TFPDlgWindow)^);
576
Load: @TFPDlgWindow.Load;
577
Store: @TFPDlgWindow.Store
580
RGDBWindow: TStreamRec = (
582
VmtLink: Ofs(TypeOf(TGDBWindow)^);
583
Load: @TGDBWindow.Load;
584
Store: @TGDBWindow.Store
586
RGDBSourceEditor: TStreamRec = (
588
VmtLink: Ofs(TypeOf(TGDBSourceEditor)^);
589
Load: @TGDBSourceEditor.Load;
590
Store: @TGDBSourceEditor.Store
592
RDisassemblyEditor: TStreamRec = (
594
VmtLink: Ofs(TypeOf(TDisassemblyEditor)^);
595
Load: @TDisassemblyEditor.Load;
596
Store: @TDisassemblyEditor.Store
598
RDisassemblyWindow: TStreamRec = (
600
VmtLink: Ofs(TypeOf(TDisassemblyWindow)^);
601
Load: @TDisassemblyWindow.Load;
602
Store: @TDisassemblyWindow.Store
606
GlobalNoNameCount : integer = 0;
608
ReservedWords : array[1..ReservedWordMaxLen] of PStringCollection;
609
AsmReservedWords : array[1..ReservedWordMaxLen] of PStringCollection;
611
{****************************************************************************
613
****************************************************************************}
615
function TStoreCollection.Add(const S: string): PString;
619
if S='' then P:=nil else
620
if Search(@S,Index) then P:=At(Index) else
629
function IsThereAnyEditor: boolean;
630
function EditorWindow(P: PView): boolean; {$ifndef FPC}far;{$endif}
632
EditorWindow:=(P^.HelpCtx=hcSourceWindow);
635
IsThereAnyEditor:=Desktop^.FirstThat(@EditorWindow)<>nil;
638
procedure AskToReloadAllModifiedFiles;
639
procedure EditorWindowModifiedOnDisk(P: PView); {$ifndef FPC}far;{$endif}
641
if (P^.HelpCtx=hcSourceWindow) then
642
PSourceWindow(P)^.Editor^.ReloadFile;
645
Desktop^.ForEach(@EditorWindowModifiedOnDisk);
648
function IsThereAnyHelpWindow: boolean;
650
IsThereAnyHelpWindow:=(HelpWindow<>nil) and (HelpWindow^.GetState(sfVisible));
653
function IsThereAnyNumberedWindow: boolean;
656
_Is:=Message(Desktop,evBroadcast,cmSearchWindow,nil)<>nil;
657
_Is:=_Is or ( (ClipboardWindow<>nil) and ClipboardWindow^.GetState(sfVisible));
658
IsThereAnyNumberedWindow:=_Is;
661
function IsWindow(P: PView): boolean;
665
if (P^.HelpCtx=hcSourceWindow) or
666
(P^.HelpCtx=hcHelpWindow) or
667
(P^.HelpCtx=hcClipboardWindow) or
668
(P^.HelpCtx=hcCalcWindow) or
669
(P^.HelpCtx=hcInfoWindow) or
670
(P^.HelpCtx=hcBrowserWindow) or
671
(P^.HelpCtx=hcMessagesWindow) or
672
(P^.HelpCtx=hcCompilerMessagesWindow) or
673
(P^.HelpCtx=hcGDBWindow) or
674
(P^.HelpCtx=hcdisassemblyWindow) or
675
(P^.HelpCtx=hcWatchesWindow) or
676
(P^.HelpCtx=hcRegistersWindow) or
677
(P^.HelpCtx=hcFPURegisters) or
678
(P^.HelpCtx=hcVectorRegisters) or
679
(P^.HelpCtx=hcStackWindow) or
680
(P^.HelpCtx=hcBreakpointListWindow) or
681
(P^.HelpCtx=hcASCIITableWindow)
687
function IsThereAnyWindow: boolean;
688
function CheckIt(P: PView): boolean; {$ifndef FPC}far;{$endif}
690
CheckIt:=IsWindow(P);
693
IsThereAnyWindow:=Desktop^.FirstThat(@CheckIt)<>nil;
696
function IsThereAnyVisibleWindow: boolean;
697
function CheckIt(P: PView): boolean; {$ifndef FPC}far;{$endif}
699
CheckIt:=IsWindow(P) and P^.GetState(sfVisible);
702
IsThereAnyVisibleWindow:=Desktop^.FirstThat(@CheckIt)<>nil;
705
function FirstEditorWindow: PSourceWindow;
706
function EditorWindow(P: PView): boolean; {$ifndef FPC}far;{$endif}
708
EditorWindow:=(P^.HelpCtx=hcSourceWindow);
711
FirstEditorWindow:=pointer(Desktop^.FirstThat(@EditorWindow));
714
function EditorWindowFile(const Name : String): PSourceWindow;
718
function EditorWindow(P: PView): boolean; {$ifndef FPC}far;{$endif}
720
EditorWindow:=(TypeOf(P^)=TypeOf(TSourceWindow)) and
721
(FixFileName(PSourceWindow(P)^.Editor^.FileName)=SName);
725
SName:=FixFileName(FExpand(Name));
726
EditorWindowFile:=pointer(Desktop^.FirstThat(@EditorWindow));
731
function InDisassemblyWindow :boolean;
735
function CheckIt(P: PView): boolean; {$ifndef FPC}far;{$endif}
737
CheckIt:=IsWindow(P) and P^.GetState(sfVisible) and
738
(P^.HelpCtx <> hcWatchesWindow) and
739
(P^.HelpCtx <> hcStackWindow) and
740
(P^.HelpCtx <> hcRegistersWindow) and
741
(P^.HelpCtx <> hcVectorRegisters) and
742
(P^.HelpCtx <> hcFPURegisters);
745
PW:=PWindow(Desktop^.FirstThat(@CheckIt));
746
InDisassemblyWindow:=Assigned(PW) and
747
(TypeOf(PW^)=TypeOf(TDisassemblyWindow));
752
function GetEditorCurWord(Editor: PEditor; ValidSpecChars: TCharSet): string;
755
function Trim(S: string): string;
756
const TrimChars : set of char = [#0,#9,' ',#255];
758
while (length(S)>0) and (S[1] in TrimChars) do Delete(S,1,1);
759
while (length(S)>0) and (S[length(S)] in TrimChars) do Delete(S,length(S),1);
762
const AlphaNum : set of char = ['A'..'Z','0'..'9','_'];
766
S:=GetDisplayText(CurPos.Y);
767
PS:=CurPos.X; while (PS>0) and (Upcase(S[PS]) in AlphaNum) do Dec(PS);
768
PE:=CurPos.X; while (PE<length(S)) and (Upcase(S[PE+1]) in (AlphaNum+ValidSpecChars)) do Inc(PE);
769
S:=Trim(copy(S,PS+1,PE-PS));
775
{*****************************************************************************
777
*****************************************************************************}
779
function NewTabItem(AView: PView; ANext: PTabItem): PTabItem;
782
New(P); FillChar(P^,SizeOf(P^),0);
783
P^.Next:=ANext; P^.View:=AView;
787
procedure DisposeTabItem(P: PTabItem);
791
if P^.View<>nil then Dispose(P^.View, Done);
796
function NewTabDef(AName: string; ADefItem: PView; AItems: PTabItem; ANext: PTabDef): PTabDef;
801
P^.Next:=ANext; P^.Name:=NewStr(AName); P^.Items:=AItems;
803
if (x<>0) and (x<length(AName)) then P^.ShortCut:=Upcase(AName[x+1])
804
else P^.ShortCut:=#0;
805
P^.DefItem:=ADefItem;
809
procedure DisposeTabDef(P: PTabDef);
824
{*****************************************************************************
826
*****************************************************************************}
828
function GetReservedWordCount: integer;
833
for I:=ord(Low(tToken)) to ord(High(tToken)) do
834
with TokenInfo^[TToken(I)] do
835
if (str<>'') and (str[1] in['A'..'Z']) and (length(str)>1) then
837
GetReservedWordCount:=Count;
840
function GetReservedWord(Index: integer): string;
842
Count,Idx,I: integer;
848
while (I<=ord(High(tToken))) and (Idx=-1) do
849
with TokenInfo^[TToken(I)] do
851
if (str<>'') and (str[1] in['A'..'Z']) and (length(str)>1) then
862
S:=TokenInfo^[TToken(Idx)].str;
866
function GetAsmReservedWordCount: integer;
868
GetAsmReservedWordCount:=ord(lastop) - ord(firstop)
872
+ CondAsmOps*(ord(high(TasmCond))-ord(low(TasmCond)));
874
{ the arm has an incredible amount of combinations of opcodes,
875
we've to solve this different }
879
+ CondAsmOps*(ord(high(TAsmCondFlag))-ord(low(TAsmCondFlag)));
885
function GetAsmReservedWord(Index: integer): string;
887
CondNum,CondOpNum : integer;
890
if index <= ord(lastop) - ord(firstop) then
891
GetAsmReservedWord:=std_op2str[tasmop(Index+ord(firstop))]
894
index:=index - (ord(lastop) - ord(firstop) );
895
CondOpNum:= index div (ord(high(TasmCond))-ord(low(TasmCond)));
896
CondNum:=index - (CondOpNum * (ord(high(TasmCond))-ord(low(TasmCond))));
897
GetAsmReservedWord:=CondAsmOpStr[CondOpNum]+cond2str[TasmCond(CondNum+ord(low(TAsmCond))+1)];
901
if index <= ord(lastop) - ord(firstop) then
902
GetAsmReservedWord:=mot_op2str[tasmop(Index+ord(firstop))]
905
index:=index - (ord(lastop) - ord(firstop) );
906
CondOpNum:= index div (ord(high(TasmCond))-ord(low(TasmCond)));
907
CondNum:=index - (CondOpNum * (ord(high(TasmCond))-ord(low(TasmCond))));
908
GetAsmReservedWord:=CondAsmOpStr[CondOpNum]+cond2str[TasmCond(CondNum+ord(low(TAsmCond))+1)];
911
GetAsmReservedWord:='';
916
procedure InitReservedWords;
918
Idx,I,J : sw_integer;
921
for I:=Low(ReservedWords) to High(ReservedWords) do
922
New(ReservedWords[I], Init(50,10));
923
for I:=1 to GetReservedWordCount do
925
WordS:=GetReservedWord(I-1); Idx:=length(WordS);
926
if (Idx>=Low(ReservedWords)) and (Idx<=High(ReservedWords)) then
927
ReservedWords[Idx]^.Insert(NewStr(WordS));
929
for I:=Low(AsmReservedWords) to High(AsmReservedWords) do
930
New(AsmReservedWords[I], Init(50,10));
931
for I:=1 to GetAsmReservedWordCount do
933
WordS:=UpcaseStr(GetAsmReservedWord(I-1)); Idx:=length(WordS);
934
if (Idx>=Low(AsmReservedWords)) and (Idx<=High(AsmReservedWords)) then
936
if not AsmReservedWords[Idx]^.Search(@WordS, J) then
937
AsmReservedWords[Idx]^.Insert(NewStr(WordS));
942
procedure DoneReservedWords;
945
for I:=Low(ReservedWords) to High(ReservedWords) do
946
if assigned(ReservedWords[I]) then
948
dispose(ReservedWords[I],done);
949
ReservedWords[I]:=nil;
951
for I:=Low(AsmReservedWords) to High(AsmReservedWords) do
952
if assigned(AsmReservedWords[I]) then
954
dispose(AsmReservedWords[I],done);
955
ReservedWords[I]:=nil;
960
function IsFPReservedWord(const S: string): boolean;
962
Idx,Item: sw_integer;
965
Idx:=length(S); _Is:=false;
966
if (Low(ReservedWords)<=Idx) and (Idx<=High(ReservedWords)) and
967
(ReservedWords[Idx]<>nil) and (ReservedWords[Idx]^.Count<>0) then
970
_Is:=ReservedWords[Idx]^.Search(@UpS,Item);
972
IsFPReservedWord:=_Is;
975
function IsFPAsmReservedWord(S: string): boolean;
977
Idx,Item,Len: sw_integer;
981
Idx:=length(S); _Is:=false;
982
if (Low(AsmReservedWords)<=Idx) and (Idx<=High(AsmReservedWords)) and
983
(AsmReservedWords[Idx]<>nil) and (AsmReservedWords[Idx]^.Count<>0) then
986
_Is:=AsmReservedWords[Idx]^.Search(@S,Item);
988
if not _Is and (Length(S)>1) then
991
if LastC in ['B','D','L','Q','S','T','V','W'] then
993
Delete(S,Length(S),1);
995
if (AsmReservedWords[Idx]<>nil) and (AsmReservedWords[Idx]^.Count<>0) then
996
_Is:=AsmReservedWords[Idx]^.Search(@S,Item);
997
if not _Is and (Length(S)>1) then
999
LastTwo:=S[Length(S)]+LastC;
1000
if (LastTwo='BL') or
1004
Delete(S,Length(S),1);
1006
if (AsmReservedWords[Idx]<>nil) and (AsmReservedWords[Idx]^.Count<>0) then
1007
_Is:=AsmReservedWords[Idx]^.Search(@S,Item);
1014
IsFPAsmReservedWord:=_Is;
1018
{*****************************************************************************
1020
*****************************************************************************}
1022
function SearchWindowWithNo(No: integer): PWindow;
1025
P:=Message(Desktop,evBroadcast,cmSearchWindow+No,nil);
1026
if pointer(P)=pointer(Desktop) then P:=nil;
1027
SearchWindowWithNo:=P;
1030
function SearchWindow(const Title: string): PWindow;
1031
function Match(P: PView): boolean; {$ifndef FPC}far;{$endif}
1036
{ we have a crash here because of the TStatusLine
1037
that can also have one of these values
1038
but is not a Window object PM }
1039
if P<>pointer(StatusLine) then
1045
OK:=CompareText(W^.GetTitle(255),Title)=0;
1051
W:=Application^.FirstThat(@Match);
1052
{ This is wrong because TStatusLine is also considered PM }
1053
if not Assigned(W) then W:=Desktop^.FirstThat(@Match);
1054
{ But why do we need to check all ??
1055
Probably because of the ones which were not inserted into
1056
Desktop as the Messages view
1058
Exactly. Some windows are inserted directly in the Application and not
1059
in the Desktop. btw. Does TStatusLine.HelpCtx really change? Why?
1060
Only GetHelpCtx should return different values depending on the
1061
focused view (and it's helpctx), but TStatusLine's HelpCtx field
1062
shouldn't change... Gabor
1064
if Assigned(W)=false then W:=Desktop^.FirstThat(@Match);}
1065
SearchWindow:=PWindow(W);
1068
function SearchFreeWindowNo: integer;
1072
while (No<100) and (SearchWindowWithNo(No)<>nil) do
1074
if No=100 then No:=0;
1075
SearchFreeWindowNo:=No;
1079
{*****************************************************************************
1081
*****************************************************************************}
1083
constructor TIntegerLine.Init(var Bounds: TRect; AMin, AMax: longint);
1085
if inherited Init(Bounds, Bounds.B.X-Bounds.A.X-1)=false then
1087
Validator:=New(PRangeValidator, Init(AMin, AMax));
1091
{*****************************************************************************
1093
*****************************************************************************}
1095
function SearchCoreForFileName(AFileName: string): PCodeEditorCore;
1096
var EC: PCodeEditorCore;
1097
function Check(P: PView): boolean; {$ifndef FPC}far;{$endif}
1100
OK:=P^.HelpCtx=hcSourceWindow;
1102
with PSourceWindow(P)^ do
1103
if FixFileName(Editor^.FileName)=AFileName then
1114
AFileName:=FixFileName(AFileName);
1115
{ do not use the same core for all new files }
1116
if AFileName<>'' then
1117
Desktop^.FirstThat(@Check);
1118
SearchCoreForFileName:=EC;
1121
constructor TSourceEditor.Init(var Bounds: TRect; AHScrollBar, AVScrollBar:
1122
PScrollBar; AIndicator: PIndicator;const AFileName: string);
1123
var EC: PCodeEditorCore;
1125
EC:=SearchCoreForFileName(AFileName);
1126
inherited Init(Bounds,AHScrollBar,AVScrollBar,AIndicator,EC,AFileName);
1132
FreePascalSpecSymbolCount : array [TSpecSymbolClass] of integer =
1135
1,{ssCommentSingleLinePrefix}
1139
1,{ssDirectivePrefix}
1140
1,{ssDirectiveSuffix}
1145
FreePascalEmptyString : string[1] = '';
1146
FreePascalCommentPrefix1 : string[1] = '{';
1147
FreePascalCommentPrefix2 : string[2] = '(*';
1148
FreePascalCommentPrefix3 : string[2] = '//';
1149
FreePascalCommentSingleLinePrefix : string[2] = '//';
1150
FreePascalCommentSuffix1 : string[1] = '}';
1151
FreePascalCommentSuffix2 : string[2] = '*)';
1152
FreePascalStringPrefix : string[1] = '''';
1153
FreePascalStringSuffix : string[1] = '''';
1154
FreePascalDirectivePrefix : string[2] = '{$';
1155
FreePascalDirectiveSuffix : string[1] = '}';
1156
FreePascalAsmPrefix : string[3] = 'ASM';
1157
FreePascalAsmSuffix : string[3] = 'END';
1159
function TSourceEditor.GetSpecSymbolCount(SpecClass: TSpecSymbolClass): integer;
1161
GetSpecSymbolCount:=FreePascalSpecSymbolCount[SpecClass];
1164
function TSourceEditor.GetSpecSymbol(SpecClass: TSpecSymbolClass; Index: integer): pstring;
1166
GetSpecSymbol:=@FreePascalEmptyString;
1170
0 : GetSpecSymbol:=@FreePascalCommentPrefix1;
1171
1 : GetSpecSymbol:=@FreePascalCommentPrefix2;
1172
2 : GetSpecSymbol:=@FreePascalCommentPrefix3;
1174
ssCommentSingleLinePrefix :
1176
0 : GetSpecSymbol:=@FreePascalCommentSingleLinePrefix;
1180
0 : GetSpecSymbol:=@FreePascalCommentSuffix1;
1181
1 : GetSpecSymbol:=@FreePascalCommentSuffix2;
1184
GetSpecSymbol:=@FreePascalStringPrefix;
1186
GetSpecSymbol:=@FreePascalStringSuffix;
1187
{ must be uppercased to avoid calling UpCaseStr in MatchesAnyAsmSymbol PM }
1189
GetSpecSymbol:=@FreePascalAsmPrefix;
1191
GetSpecSymbol:=@FreePascalAsmSuffix;
1193
GetSpecSymbol:=@FreePascalDirectivePrefix;
1195
GetSpecSymbol:=@FreePascalDirectiveSuffix;
1199
function TSourceEditor.IsReservedWord(const S: string): boolean;
1201
IsReservedWord:=IsFPReservedWord(S);
1204
function TSourceEditor.IsAsmReservedWord(const S: string): boolean;
1206
IsAsmReservedWord:=IsFPAsmReservedWord(S);
1209
function TSourceEditor.TranslateCodeTemplate(var Shortcut: string; ALines: PUnsortedStringCollection): boolean;
1211
TranslateCodeTemplate:=FPTranslateCodeTemplate(ShortCut,ALines);
1214
function TSourceEditor.SelectCodeTemplate(var ShortCut: string): boolean;
1215
var D: PCodeTemplatesDialog;
1218
New(D, Init(true,ShortCut));
1219
OK:=Desktop^.ExecView(D)=cmOK;
1220
if OK then ShortCut:=D^.GetSelectedShortCut;
1222
SelectCodeTemplate:=OK;
1225
function TSourceEditor.CompleteCodeWord(const WordS: string; var Text: string): boolean;
1227
CompleteCodeWord:=FPCompleteCodeWord(WordS,Text);
1230
procedure TSourceEditor.FindMatchingDelimiter(ScanForward: boolean);
1232
St,nextResWord : String;
1233
LineText,LineAttr: string;
1234
Res,found,addit : boolean;
1236
X,Y,lexchange,curlevel,linecount : sw_integer;
1238
function GetLexChange(const S : string) : sw_integer;
1240
if (S='END') or (S='THEN') or (S='UNTIL') then
1242
else if (S='ASM') or (S='BEGIN') or (S='CASE') or (S='CLASS') or
1243
(S='IF') or (S='OBJECT') or (S='RECORD') or (S='REPEAT') then
1250
st:=UpcaseStr(GetCurrentWord);
1252
Res:=IsReservedWord(St)
1255
LexChange:=GetLexChange(St);
1256
if not res or (LexChange=0) or not
1257
IsFlagSet(efSyntaxHighlight) then
1258
Inherited FindMatchingDelimiter(ScanForward)
1261
JumpPos.X:=-1; JumpPos.Y:=-1;
1262
Y:=CurPos.Y; X:=CurPos.X;
1265
curlevel:=lexchange;
1271
GetDisplayTextFormat(Y,LineText,LineAttr);
1272
if LineCount<>1 then X:=-1
1273
else if ord(LineAttr[X+1])<>coReservedWordColor then
1277
if X<length(LineText) then
1279
AddIt:=ord(LineAttr[X+1])=coReservedWordColor;
1281
NextResWord:=NextResWord+UpCase(LineText[X+1]);
1283
if ((X=length(LineText)) or (Not AddIt)) and
1284
(NextResWord<>'') and
1285
IsReservedWord(NextResWord) then
1287
LexChange:=GetLexChange(NextResWord);
1288
CurLevel:=CurLevel+LexChange;
1291
JumpPos.X:=X-Length(NextResWord);
1296
until (X>=length(LineText)) or (JumpPos.X<>-1);
1298
until (Y>=GetLineCount) or (JumpPos.X<>-1);
1299
if (Y=GetLineCount) and (JumpPos.X=-1) then
1301
ErrorBox('No match',nil);
1305
else if (LexChange<0) then
1310
GetDisplayTextFormat(Y,LineText,LineAttr);
1311
if LineCount<>1 then
1313
else if ord(LineAttr[X+1])<>coReservedWordColor then
1319
AddIt:=ord(LineAttr[X+1])=coReservedWordColor;
1321
NextResWord:=UpCase(LineText[X+1])+NextResWord;
1323
if ((X=0) or (Not AddIt)) and
1324
(NextResWord<>'') and
1325
IsReservedWord(NextResWord) then
1327
LexChange:=GetLexChange(NextResWord);
1328
CurLevel:=CurLevel+LexChange;
1339
until (X<=0) or (JumpPos.X<>-1);
1341
until (Y<0) or (JumpPos.X<>-1);
1342
if (Y<0) and (JumpPos.X=-1) then
1344
ErrorBox('No match',nil);
1348
if JumpPos.X<>-1 then
1350
SetCurPtr(JumpPos.X,JumpPos.Y);
1356
procedure TSourceEditor.SetCodeCompleteWord(const S: string);
1359
inherited SetCodeCompleteWord(S);
1362
if Assigned(CodeCompleteTip) then Dispose(CodeCompleteTip, Done);
1363
CodeCompleteTip:=nil;
1368
if Assigned(CodeCompleteTip)=false then
1370
New(CodeCompleteTip, Init(R, S, alCenter));
1371
CodeCompleteTip^.Hide;
1372
Application^.Insert(CodeCompleteTip);
1375
CodeCompleteTip^.SetText(S);
1376
AlignCodeCompleteTip;
1380
procedure TSourceEditor.AlignCodeCompleteTip;
1385
if Assigned(CodeCompleteTip)=false then Exit;
1386
S:=CodeCompleteTip^.GetText;
1388
{ determine the center of current word fragment }
1389
P.X:=CurPos.X-(length(GetCodeCompleteFrag) div 2);
1390
{ calculate position for centering the complete word over/below the current }
1391
P.X:=P.X-(length(S) div 2);
1396
if Assigned(CodeCompleteTip^.Owner) then
1397
CodeCompleteTip^.Owner^.MakeLocal(P,P);
1399
{ ensure that the tooltip stays in screen }
1400
P.X:=Min(Max(0,P.X),ScreenWidth-length(S)-2-1);
1401
{ align it vertically }
1402
if P.Y>round(ScreenHeight*3/4) then
1406
R.Assign(P.X,P.Y,P.X+1+length(S)+1,P.Y+1);
1407
CodeCompleteTip^.Locate(R);
1408
if CodeCompleteTip^.GetState(sfVisible)=false then
1409
CodeCompleteTip^.Show;
1412
procedure TSourceEditor.ModifiedChanged;
1414
inherited ModifiedChanged;
1415
if (@Self<>Clipboard) and GetModified then
1418
EditorModified:=true;
1419
{ reset compile flags as the file is
1420
not the same as at the compilation anymore }
1425
procedure TSourceEditor.InsertOptions;
1426
var C: PUnsortedStringCollection;
1431
New(C, Init(10,10));
1432
GetCompilerOptionLines(C);
1435
for Y:=0 to C^.Count-1 do
1440
AdjustSelectionPos(0,0,0,C^.Count);
1441
UpdateAttrs(0,attrAll);
1449
procedure TSourceEditor.PushInfo(Const st : string);
1454
procedure TSourceEditor.PopInfo;
1459
procedure TSourceEditor.DeleteLine(I: sw_integer);
1461
inherited DeleteLine(I);
1463
If ShouldHandleBreakpoints then
1464
BreakpointsCollection^.AdaptBreakpoints(@Self,I,-1);
1468
procedure TSourceEditor.BackSpace;
1471
MoveBreakpointToPreviousLine,WasEnabled : boolean;
1472
PBStart,PBEnd : PBreakpoint;
1477
inherited Backspace;
1479
MoveBreakpointToPreviousLine:=(CurPos.X=0) and (CurPos.Y>0);
1480
If MoveBreakpointToPreviousLine then
1482
ShouldHandleBreakpoints:=false;
1484
PBEnd:=BreakpointsCollection^.FindBreakpointAt(@Self,I);
1485
PBStart:=BreakpointsCollection^.FindBreakpointAt(@Self,I-1);
1487
inherited Backspace;
1488
if MoveBreakpointToPreviousLine then
1490
ShouldHandleBreakpoints:=true;
1491
if assigned(PBEnd) then
1493
if assigned(PBStart) then
1495
if PBEnd^.state=bs_enabled then
1496
PBStart^.state:=bs_enabled;
1497
BreakpointsCollection^.Free(PBEnd);
1501
WasEnabled:=PBEnd^.state=bs_enabled;
1504
PBEnd^.state:=bs_disabled;
1505
PBEnd^.UpdateSource;
1510
PBEnd^.state:=bs_enabled;
1511
PBEnd^.UpdateSource;
1515
BreakpointsCollection^.AdaptBreakpoints(@Self,I,-1);
1520
function TSourceEditor.InsertNewLine : Sw_integer;
1523
MoveBreakpointToNextLine : boolean;
1528
InsertNewLine:=inherited InsertNewLine;
1530
ShouldHandleBreakpoints:=false;
1531
MoveBreakpointToNextLine:=Cursor.x<Length(RTrim(GetDisplayText(CurPos.Y)));
1533
InsertNewLine:=inherited InsertNewLine;
1534
if MoveBreakpointToNextLine then
1535
BreakpointsCollection^.AdaptBreakpoints(@Self,I-1,1)
1537
BreakpointsCollection^.AdaptBreakpoints(@Self,I,1);
1538
ShouldHandleBreakpoints:=true;
1542
procedure TSourceEditor.DelChar;
1547
PBStart,PBEnd : PBreakpoint;
1548
MoveBreakpointOneLineUp,WasEnabled : boolean;
1551
if IsReadOnly then Exit;
1552
S:=GetLineText(CurPos.Y);
1554
CI:=LinePosToCharIdx(CurPos.Y,CurPos.X);
1556
if ((CI>length(S)) or (S='')) and (CurPos.Y<GetLineCount-1) then
1558
MoveBreakpointOneLineUp:=true;
1559
ShouldHandleBreakpoints:=false;
1560
PBEnd:=BreakpointsCollection^.FindBreakpointAt(@Self,I+1);
1561
PBStart:=BreakpointsCollection^.FindBreakpointAt(@Self,I);
1564
MoveBreakpointOneLineUp:=false;
1568
if MoveBreakpointOneLineUp then
1570
ShouldHandleBreakpoints:=true;
1571
if assigned(PBEnd) then
1573
if assigned(PBStart) then
1575
if PBEnd^.state=bs_enabled then
1576
PBStart^.state:=bs_enabled;
1577
BreakpointsCollection^.Free(PBEnd);
1581
WasEnabled:=PBEnd^.state=bs_enabled;
1584
PBEnd^.state:=bs_disabled;
1585
PBEnd^.UpdateSource;
1590
PBEnd^.state:=bs_enabled;
1591
PBEnd^.UpdateSource;
1595
BreakpointsCollection^.AdaptBreakpoints(@Self,I,-1);
1600
procedure TSourceEditor.DelSelect;
1603
MoveBreakpointToFirstLine,WasEnabled : boolean;
1604
PBStart,PBEnd : PBreakpoint;
1609
inherited DelSelect;
1611
ShouldHandleBreakpoints:=false;
1612
J:=SelEnd.Y-SelStart.Y;
1613
MoveBreakpointToFirstLine:=J>0;
1614
PBEnd:=BreakpointsCollection^.FindBreakpointAt(@Self,SelEnd.Y);
1615
PBStart:=BreakpointsCollection^.FindBreakpointAt(@Self,SelEnd.Y);
1617
inherited DelSelect;
1618
if MoveBreakpointToFirstLine and assigned(PBEnd) then
1620
If assigned(PBStart) then
1622
if PBEnd^.state=bs_enabled then
1623
PBStart^.state:=bs_enabled;
1624
BreakpointsCollection^.Free(PBEnd);
1628
WasEnabled:=PBEnd^.state=bs_enabled;
1631
PBEnd^.state:=bs_disabled;
1632
PBEnd^.UpdateSource;
1637
PBEnd^.state:=bs_enabled;
1638
PBEnd^.UpdateSource;
1642
BreakpointsCollection^.AdaptBreakpoints(@Self,I,-J);
1643
ShouldHandleBreakpoints:=true;
1648
function TSourceEditor.InsertLine(LineNo: sw_integer; const S: string): PCustomLine;
1650
InsertLine := inherited InsertLine(LineNo,S);
1652
If ShouldHandleBreakpoints then
1653
BreakpointsCollection^.AdaptBreakpoints(@Self,LineNo,1);
1657
procedure TSourceEditor.AddLine(const S: string);
1659
inherited AddLine(S);
1661
BreakpointsCollection^.AdaptBreakpoints(@Self,GetLineCount,1);
1667
function TSourceEditor.GetLocalMenu: PMenu;
1672
NewItem(menu_edit_cut,menu_key_edit_cut,kbShiftDel,cmCut,hcCut,
1673
NewItem(menu_edit_copy,menu_key_edit_copy,kbCtrlIns,cmCopy,hcCopy,
1674
NewItem(menu_edit_paste,menu_key_edit_paste,kbShiftIns,cmPaste,hcPaste,
1675
NewItem(menu_edit_clear,menu_key_edit_clear,kbCtrlDel,cmClear,hcClear,
1677
NewItem(menu_srclocal_openfileatcursor,'',kbNoKey,cmOpenAtCursor,hcOpenAtCursor,
1678
NewItem(menu_srclocal_browseatcursor,'',kbNoKey,cmBrowseAtCursor,hcBrowseAtCursor,
1679
NewItem(menu_srclocal_topicsearch,menu_key_help_topicsearch,kbCtrlF1,cmHelpTopicSearch,hcHelpTopicSearch,
1681
NewItem(menu_srclocal_options,'',kbNoKey,cmEditorOptions,hcEditorOptions,
1683
if IsChangedOnDisk then
1684
MI:=NewItem(menu_srclocal_reload,'',kbNoKey,cmDoReload,hcDoReload,
1690
function TSourceEditor.GetCommandTarget: PView;
1692
GetCommandTarget:=@Self;
1695
function TSourceEditor.CreateLocalMenuView(var Bounds: TRect; M: PMenu): PMenuPopup;
1696
var MV: PAdvancedMenuPopup;
1698
New(MV, Init(Bounds,M));
1699
CreateLocalMenuView:=MV;
1703
procedure TSourceEditor.DumpUndo;
1708
AddToolCommand('UndoList Dump');
1709
for i:=0 to Core^.UndoList^.count-1 do
1710
with Core^.UndoList^.At(i)^ do
1712
if is_grouped_action then
1713
AddToolMessage('','Group '+ActionString[action]+' '+IntToStr(ActionCount)+' elementary actions',0,0)
1715
AddToolMessage('',ActionString[action]+' '+IntToStr(StartPos.Y+1)+':'+IntToStr(StartPos.X+1)+
1716
' '+IntToStr(EndPos.Y+1)+':'+IntToStr(EndPos.X+1)+' "'+GetStr(Text)+'"',0,0);
1718
if Core^.RedoList^.count>0 then
1719
AddToolCommand('RedoList Dump');
1720
for i:=0 to Core^.RedoList^.count-1 do
1721
with Core^.RedoList^.At(i)^ do
1723
if is_grouped_action then
1724
AddToolMessage('','Group '+ActionString[action]+' '+IntToStr(ActionCount)+' elementary actions',0,0)
1726
AddToolMessage('',ActionString[action]+' '+IntToStr(StartPos.Y+1)+':'+IntToStr(StartPos.X+1)+
1727
' '+IntToStr(EndPos.Y+1)+':'+IntToStr(EndPos.X+1)+' "'+GetStr(Text)+'"',0,0);
1730
if Assigned(MessagesWindow) then
1731
MessagesWindow^.Focus;
1734
procedure TSourceEditor.UndoAll;
1736
While Core^.UndoList^.count>0 do
1740
procedure TSourceEditor.RedoAll;
1742
While Core^.RedoList^.count>0 do
1748
function TSourceEditor.Valid(Command: Word): Boolean;
1751
OK:=inherited Valid(Command);
1752
if OK and ({(Command=cmClose) or already handled in TFileEditor.Valid PM }
1753
(Command=cmAskSaveAll)) then
1754
if IsClipboard=false then
1760
procedure TSourceEditor.HandleEvent(var Event: TEvent);
1761
var DontClear: boolean;
1764
TranslateMouseClick(@Self,Event);
1769
case Event.KeyCode of
1771
Message(@Self,evCommand,cmOpenAtCursor,nil);
1772
else DontClear:=true;
1774
if not DontClear then ClearEvent(Event);
1777
inherited HandleEvent(Event);
1780
case Event.Command of
1783
InsertText(FloatToStr(CalcClipboard,0));
1790
case Event.Command of
1792
cmDumpUndo : DumpUndo;
1793
cmUndoAll : UndoAll;
1794
cmRedoAll : RedoAll;
1796
cmDoReload : ReloadFile;
1799
S:=LowerCaseStr(GetEditorCurWord(@Self,[]));
1800
OpenOneSymbolBrowser(S);
1804
S:=LowerCaseStr(GetEditorCurWord(@Self,['.']));
1805
if Pos('.',S)<>0 then
1806
OpenFileName:=S else
1807
OpenFileName:=S+'.pp'+ListSeparator+
1808
S+'.pas'+ListSeparator+
1810
Message(Application,evCommand,cmOpen,nil);
1813
Message(Application,evCommand,cmEditorOptions,@Self);
1815
Message(@Self,evCommand,cmHelpTopicSearch,@Self);
1817
HelpTopicSearch(@Self);
1818
else DontClear:=true;
1820
if not DontClear then ClearEvent(Event);
1825
constructor TFPHeapView.Init(var Bounds: TRect);
1827
if inherited Init(Bounds)=false then Fail;
1828
Options:=Options or gfGrowHiX or gfGrowHiY;
1829
EventMask:=EventMask or evIdle;
1830
GrowMode:=gfGrowAll;
1833
constructor TFPHeapView.InitKb(var Bounds: TRect);
1835
if inherited InitKb(Bounds)=false then Fail;
1836
Options:=Options or gfGrowHiX or gfGrowHiY;
1837
EventMask:=EventMask or evIdle;
1838
GrowMode:=gfGrowAll;
1841
procedure TFPHeapView.HandleEvent(var Event: TEvent);
1847
inherited HandleEvent(Event);
1850
constructor TFPClockView.Init(var Bounds: TRect);
1852
inherited Init(Bounds);
1853
EventMask:=EventMask or evIdle;
1856
procedure TFPClockView.HandleEvent(var Event: TEvent);
1862
inherited HandleEvent(Event);
1865
function TFPClockView.GetPalette: PPalette;
1866
const P: string[length(CFPClockView)] = CFPClockView;
1871
procedure TFPWindow.SetState(AState: Word; Enable: Boolean);
1875
inherited SetState(AState,Enable);
1877
if (AState and (sfVisible+sfExposed))<>0 then
1878
if GetState(sfVisible+sfExposed) then
1881
Number:=SearchFreeWindowNo;
1886
if ((AState and sfActive)<>0) and (((OldState xor State) and sfActive)<>0) then
1890
procedure TFPWindow.UpdateCommands;
1894
procedure TFPWindow.Update;
1899
procedure TFPWindow.SelectInDebugSession;
1901
F,PrevCurrent : PView;
1904
PrevCurrent:=Desktop^.Current;
1906
While assigned(F) and
1907
((F^.HelpCtx = hcGDBWindow) or
1908
(F^.HelpCtx = hcdisassemblyWindow) or
1909
(F^.HelpCtx = hcWatchesWindow) or
1910
(F^.HelpCtx = hcStackWindow) or
1911
(F^.HelpCtx = hcRegistersWindow) or
1912
(F^.HelpCtx = hcVectorRegisters) or
1913
(F^.HelpCtx = hcFPURegisters)) do
1917
if PrevCurrent<>F then
1919
Desktop^.InsertBefore(@self,F);
1920
PrevCurrent^.Select;
1925
procedure TFPWindow.HandleEvent(var Event: TEvent);
1929
case Event.Command of
1932
cmSearchWindow+1..cmSearchWindow+99 :
1933
if (Event.Command-cmSearchWindow=Number) then
1937
inherited HandleEvent(Event);
1941
constructor TFPWindow.Load(var S: TStream);
1944
S.Read(AutoNumber,SizeOf(AutoNumber));
1947
procedure TFPWindow.Store(var S: TStream);
1950
S.Write(AutoNumber,SizeOf(AutoNumber));
1953
function TFPHelpViewer.GetLocalMenu: PMenu;
1957
NewItem(menu_hlplocal_contents,'',kbNoKey,cmHelpContents,hcHelpContents,
1958
NewItem(menu_hlplocal_index,menu_key_hlplocal_index,kbShiftF1,cmHelpIndex,hcHelpIndex,
1959
NewItem(menu_hlplocal_topicsearch,menu_key_hlplocal_topicsearch,kbCtrlF1,cmHelpTopicSearch,hcHelpTopicSearch,
1960
NewItem(menu_hlplocal_prevtopic,menu_key_hlplocal_prevtopic,kbAltF1,cmHelpPrevTopic,hcHelpPrevTopic,
1962
NewItem(menu_hlplocal_copy,menu_key_hlplocal_copy,kbCtrlIns,cmCopy,hcCopy,
1967
function TFPHelpViewer.GetCommandTarget: PView;
1969
GetCommandTarget:=Application;
1972
constructor TFPHelpWindow.Init(var Bounds: TRect; ATitle: TTitleStr; ASourceFileID: word;
1973
AContext: THelpCtx; ANumber: Integer);
1975
inherited Init(Bounds,ATitle,ASourceFileID,AContext,ANumber);
1976
HelpCtx:=hcHelpWindow;
1980
destructor TFPHelpWindow.Done;
1982
if HelpWindow=@Self then
1987
procedure TFPHelpWindow.InitHelpView;
1990
GetExtent(R); R.Grow(-1,-1);
1991
HelpView:=New(PFPHelpViewer, Init(R, HSB, VSB));
1992
HelpView^.GrowMode:=gfGrowHiX+gfGrowHiY;
1995
procedure TFPHelpWindow.Show;
1998
if GetState(sfVisible) and (Number=0) then
2000
Number:=SearchFreeWindowNo;
2005
procedure TFPHelpWindow.Hide;
2008
if GetState(sfVisible)=false then
2012
procedure TFPHelpWindow.HandleEvent(var Event: TEvent);
2016
case Event.Command of
2019
cmSearchWindow+1..cmSearchWindow+99 :
2020
if (Event.Command-cmSearchWindow=Number) then
2024
inherited HandleEvent(Event);
2027
function TFPHelpWindow.GetPalette: PPalette;
2028
const P: string[length(CIDEHelpDialog)] = CIDEHelpDialog;
2033
constructor TFPHelpWindow.Load(var S: TStream);
2038
procedure TFPHelpWindow.Store(var S: TStream);
2043
constructor TSourceWindow.Init(var Bounds: TRect; AFileName: string);
2044
var HSB,VSB: PScrollBar;
2046
PA : Array[1..2] of pointer;
2049
inherited Init(Bounds,AFileName,{SearchFreeWindowNo}0);
2051
Options:=Options or ofTileAble;
2052
GetExtent(R); R.A.Y:=R.B.Y-1; R.Grow(-1,0); R.A.X:=14;
2053
New(HSB, Init(R)); HSB^.GrowMode:=gfGrowLoY+gfGrowHiX+gfGrowHiY; Insert(HSB);
2054
GetExtent(R); R.A.X:=R.B.X-1; R.Grow(0,-1);
2055
New(VSB, Init(R)); VSB^.GrowMode:=gfGrowLoX+gfGrowHiX+gfGrowHiY; Insert(VSB);
2056
GetExtent(R); R.A.X:=3; R.B.X:=14; R.A.Y:=R.B.Y-1;
2057
New(Indicator, Init(R));
2058
Indicator^.GrowMode:=gfGrowLoY+gfGrowHiY;
2060
GetExtent(R); R.Grow(-1,-1);
2061
LoadFile:=(AFileName<>'') and (AFileName<>'*');
2062
if (AFileName='') then
2064
Inc(GlobalNoNameCount);
2065
NoNameCount:=GlobalNoNameCount;
2069
if AFileName='*' then
2071
New(Editor, Init(R, HSB, VSB, Indicator,AFileName));
2072
Editor^.GrowMode:=gfGrowHiX+gfGrowHiY;
2075
if Editor^.LoadFile=false then
2076
ErrorBox(FormatStrStr(msg_errorreadingfile,AFileName),nil)
2077
{ warn if modified, but not if modified in another
2078
already open window PM }
2079
else if Editor^.GetModified and (Editor^.Core^.GetBindingCount=1) then
2082
Ptrint(PA[2]):={Editor^.ChangedLine}-1;
2083
EditorDialog(edChangedOnloading,@PA);
2088
If assigned(BreakpointsCollection) then
2089
BreakpointsCollection^.ShowBreakpoints(@Self);
2094
procedure TSourceWindow.UpdateTitle;
2098
if Editor^.FileName<>'' then
2100
Name:=SmartPath(Editor^.FileName);
2101
Count:=Editor^.Core^.GetBindingCount;
2104
Name:=Name+':'+IntToStr(Editor^.Core^.GetBindingIndex(Editor)+1);
2108
else if NoNameCount>=0 then
2110
SetTitle('noname'+IntToStrZ(NonameCount,2)+'.pas');
2114
function TSourceWindow.GetTitle(MaxSize: sw_Integer): TTitleStr;
2116
GetTitle:=OptimizePath(inherited GetTitle(255),MaxSize);
2119
procedure TSourceWindow.SetTitle(ATitle: string);
2121
if Title<>nil then DisposeStr(Title);
2122
Title:=NewStr(ATitle);
2126
procedure TSourceWindow.HandleEvent(var Event: TEvent);
2127
var DontClear: boolean;
2131
case Event.Command of
2137
if @Self<>ClipboardWindow then
2143
case Event.Command of
2147
if Editor^.IsClipboard=false then
2148
if (Editor^.FileName='') and Editor^.GetModified then
2153
if Editor^.IsClipboard=false then
2155
else DontClear:=true;
2157
if DontClear=false then ClearEvent(Event);
2160
inherited HandleEvent(Event);
2163
procedure TSourceWindow.UpdateCommands;
2164
var Active: boolean;
2166
Active:=GetState(sfActive);
2167
if Editor^.IsClipboard=false then
2169
SetCmdState(SourceCmds+CompileCmds,Active);
2170
SetCmdState(EditorCmds,Active);
2172
SetCmdState(ToClipCmds+FromClipCmds+NulClipCmds+UndoCmd+RedoCmd,Active);
2173
Message(Application,evBroadcast,cmCommandSetChanged,nil);
2176
procedure TSourceWindow.Update;
2182
function TSourceWindow.GetPalette: PPalette;
2183
const P: string[length(CSourceWindow)] = CSourceWindow;
2188
constructor TSourceWindow.Load(var S: TStream);
2191
PushStatus(FormatStrStr(msg_loadingfile,GetStr(Title)));
2193
GetSubViewPtr(S,Indicator);
2194
GetSubViewPtr(S,Editor);
2196
If assigned(BreakpointsCollection) then
2197
BreakpointsCollection^.ShowBreakpoints(@Self);
2202
procedure TSourceWindow.Store(var S: TStream);
2205
PushStatus(FormatStrStr(msg_storingfile,GetStr(Title)));
2208
PutSubViewPtr(S,Indicator);
2209
PutSubViewPtr(S,Editor);
2214
procedure TSourceWindow.Close;
2219
destructor TSourceWindow.Done;
2221
PushStatus(FormatStrStr(msg_closingfile,GetStr(Title)));
2222
if not IDEApp.IsClosing then
2223
Message(Application,evBroadcast,cmSourceWndClosing,@Self);
2225
IDEApp.SourceWindowClosed;
2226
{ if not IDEApp.IsClosing then
2227
Message(Application,evBroadcast,cmUpdate,@Self);}
2234
function TGDBSourceEditor.Valid(Command: Word): Boolean;
2237
OK:=TCodeEditor.Valid(Command);
2238
{ do NOT ask for save !!
2239
if OK and ((Command=cmClose) or (Command=cmQuit)) then
2240
if IsClipboard=false then
2245
procedure TGDBSourceEditor.AddLine(const S: string);
2247
if Silent or (IgnoreStringAtEnd and (S=LastCommand)) then exit;
2248
inherited AddLine(S);
2252
procedure TGDBSourceEditor.AddErrorLine(const S: string);
2254
if Silent then exit;
2255
inherited AddLine(S);
2256
{ display like breakpoints in red }
2257
SetLineFlagState(GetLineCount-1,lfBreakpoint,true);
2262
GDBReservedCount = 6;
2263
GDBReservedLongest = 3;
2264
GDBReserved : array[1..GDBReservedCount] of String[GDBReservedLongest] =
2265
('gdb','b','n','s','f','bt');
2267
function IsGDBReservedWord(const S : string) : boolean;
2271
for i:=1 to GDBReservedCount do
2272
if (S=GDBReserved[i]) then
2274
IsGDBReservedWord:=true;
2277
IsGDBReservedWord:=false;
2280
function TGDBSourceEditor.IsReservedWord(const S: string): boolean;
2282
IsReservedWord:=IsGDBReservedWord(S);
2285
function TGDBSourceEditor.InsertNewLine: Sw_integer;
2288
CommandCalled : boolean;
2291
if IsReadOnly then begin InsertNewLine:=-1; Exit; end;
2292
if CurPos.Y<GetLineCount then S:=GetDisplayText(CurPos.Y) else S:='';
2293
s:=Copy(S,1,CurPos.X);
2294
CommandCalled:=false;
2295
if Pos(GDBPrompt,S)=1 then
2296
Delete(S,1,length(GDBPrompt));
2298
if assigned(Debugger) then
2302
{ should be true only if we are at the end ! }
2303
IgnoreStringAtEnd:=(CurPos.Y=GetLineCount-1) and
2304
(CurPos.X>=length(RTrim(GetDisplayText(GetLineCount-1))));
2305
Debugger^.Command(S);
2306
CommandCalled:=true;
2307
IgnoreStringAtEnd:=false;
2309
else if AutoRepeat and (CurPos.Y=GetLineCount-1) then
2311
Debugger^.Command(LastCommand);
2312
CommandCalled:=true;
2315
InsertNewLine:=inherited InsertNewLine;
2316
If CommandCalled then
2317
InsertText(GDBPrompt);
2321
constructor TGDBWindow.Init(var Bounds: TRect);
2322
var HSB,VSB: PScrollBar;
2325
inherited Init(Bounds,dialog_gdbwindow,0);
2326
Options:=Options or ofTileAble;
2328
HelpCtx:=hcGDBWindow;
2329
GetExtent(R); R.A.Y:=R.B.Y-1; R.Grow(-1,0); R.A.X:=14;
2330
New(HSB, Init(R)); HSB^.GrowMode:=gfGrowLoY+gfGrowHiX+gfGrowHiY; Insert(HSB);
2331
GetExtent(R); R.A.X:=R.B.X-1; R.Grow(0,-1);
2332
New(VSB, Init(R)); VSB^.GrowMode:=gfGrowLoX+gfGrowHiX+gfGrowHiY; Insert(VSB);
2333
GetExtent(R); R.A.X:=3; R.B.X:=14; R.A.Y:=R.B.Y-1;
2334
New(Indicator, Init(R));
2335
Indicator^.GrowMode:=gfGrowLoY+gfGrowHiY;
2337
GetExtent(R); R.Grow(-1,-1);
2338
New(Editor, Init(R, HSB, VSB, Indicator, GDBOutputFile));
2339
Editor^.GrowMode:=gfGrowHiX+gfGrowHiY;
2340
Editor^.SetFlags(efInsertMode+efSyntaxHighlight+efNoIndent+efExpandAllTabs);
2341
if ExistsFile(GDBOutputFile) then
2343
if Editor^.LoadFile=false then
2344
ErrorBox(FormatStrStr(msg_errorreadingfile,GDBOutputFile),nil);
2347
{ Empty files are buggy !! }
2348
Editor^.AddLine('');
2351
if assigned(Debugger) then
2352
Debugger^.SetWidth(Size.X-1);
2354
Editor^.silent:=false;
2355
Editor^.AutoRepeat:=true;
2356
Editor^.InsertText(GDBPrompt);
2359
procedure TGDBWindow.HandleEvent(var Event: TEvent);
2360
var DontClear: boolean;
2366
case Event.Command of
2369
else DontClear:=true;
2371
if DontClear=false then ClearEvent(Event);
2374
inherited HandleEvent(Event);
2377
destructor TGDBWindow.Done;
2379
if @Self=GDBWindow then
2384
constructor TGDBWindow.Load(var S: TStream);
2387
GetSubViewPtr(S,Indicator);
2388
GetSubViewPtr(S,Editor);
2392
procedure TGDBWindow.Store(var S: TStream);
2395
PutSubViewPtr(S,Indicator);
2396
PutSubViewPtr(S,Editor);
2399
function TGDBWindow.GetPalette: PPalette;
2400
const P: string[length(CSourceWindow)] = CSourceWindow;
2405
procedure TGDBWindow.WriteOutputText(Buf : pchar);
2407
{selected normal color ?}
2408
WriteText(Buf,false);
2411
procedure TGDBWindow.WriteErrorText(Buf : pchar);
2413
{selected normal color ?}
2414
WriteText(Buf,true);
2417
procedure TGDBWindow.WriteString(Const S : string);
2422
procedure TGDBWindow.WriteErrorString(Const S : string);
2424
Editor^.AddErrorLine(S);
2427
procedure TGDBWindow.WriteText(Buf : pchar;IsError : boolean);
2433
While assigned(p) and (p^<>#0) do
2440
Editor^.AddErrorLine(S)
2443
{ restore for dispose }
2450
if pe-p > High(s) then
2463
procedure TGDBWindow.UpdateCommands;
2464
var Active: boolean;
2466
Active:=GetState(sfActive);
2467
SetCmdState([cmSaveAs,cmHide,cmRun],Active);
2468
SetCmdState(EditorCmds,Active);
2469
SetCmdState(ToClipCmds+FromClipCmds+NulClipCmds+UndoCmd+RedoCmd,Active);
2470
Message(Application,evBroadcast,cmCommandSetChanged,nil);
2474
function TDisasLineCollection.At(Index: sw_Integer): PDisasLine;
2476
At := PDisasLine(Inherited At(Index));
2479
constructor TDisassemblyEditor.Init(var Bounds: TRect; AHScrollBar, AVScrollBar:
2480
PScrollBar; AIndicator: PIndicator;const AFileName: string);
2482
Inherited Init(Bounds,AHScrollBar,AVScrollBar,AIndicator,AFileName);
2483
GrowMode:=gfGrowHiX+gfGrowHiY;
2484
SetFlags(efInsertMode+efSyntaxHighlight+efNoIndent+efExpandAllTabs{+efHighlightRow});
2485
New(DisasLines,Init(500,1000));
2486
Core^.ChangeLinesTo(DisasLines);
2487
{ do not allow to write into that window }
2497
destructor TDisassemblyEditor.Done;
2503
procedure TDisassemblyEditor.ReleaseSource;
2505
if OwnsSource and assigned(source) then
2507
Desktop^.Delete(Source);
2508
Dispose(Source,Done);
2515
procedure TDisassemblyEditor.AddSourceLine(const AFileName: string;line : longint);
2519
if AFileName<>CurrentSource then
2522
Source:=SearchOnDesktop(FileName,false);
2523
if not assigned(Source) then
2525
Source:=ITryToOpenFile(nil,AFileName,0,line,false,false,true);
2530
CurrentSource:=AFileName;
2532
if Assigned(Source) and (line>0) then
2533
S:=Trim(Source^.Editor^.GetLineText(line-1))
2535
S:='<source not found>';
2537
inherited AddLine(AFileName+':'+IntToStr(line)+' '+S);
2538
{ display differently }
2539
SetLineFlagState(GetLineCount-1,lfSpecialRow,true);
2543
procedure TDisassemblyEditor.AddAssemblyLine(const S: string;AAddress : cardinal);
2546
LI : PEditorLineInfo;
2549
inherited AddLine('$'+hexstr(AAddress,8)+S)
2551
inherited AddLine(S);
2552
PL:=DisasLines^.At(DisasLines^.count-1);
2553
PL^.Address:=AAddress;
2554
LI:=PL^.GetEditorInfo(@Self);
2556
LI^.BeginsWithAsm:=true;
2558
if ((AAddress<minaddress) or (minaddress=0)) and (AAddress<>0) then
2559
MinAddress:=AAddress;
2560
if (AAddress>maxaddress) or (maxaddress=0) then
2561
MaxAddress:=AAddress;
2564
function TDisassemblyEditor.GetCurrentLine(address : cardinal) : PDisasLine;
2566
function IsCorrectLine(PL : PDisasLine) : boolean;
2568
IsCorrectLine:=PL^.Address=Address;
2573
PL:=DisasLines^.FirstThat(@IsCorrectLine);
2574
if Assigned(PL) then
2576
if assigned(CurL) then
2577
CurL^.SetFlagState(lfDebuggerRow,false);
2578
SetCurPtr(0,DisasLines^.IndexOf(PL));
2579
PL^.SetFlags(lfDebuggerRow);
2586
{ PDisassemblyWindow = ^TDisassemblyWindow;
2587
TDisassemblyWindow = object(TFPWindow)
2588
Editor : PDisassemblyEditor;
2589
Indicator : PIndicator; }
2590
constructor TDisassemblyWindow.Init(var Bounds: TRect);
2591
var HSB,VSB: PScrollBar;
2594
inherited Init(Bounds,dialog_disaswindow,0);
2595
Options:=Options or ofTileAble;
2597
HelpCtx:=hcDisassemblyWindow;
2598
GetExtent(R); R.A.Y:=R.B.Y-1; R.Grow(-1,0); R.A.X:=14;
2599
New(HSB, Init(R)); HSB^.GrowMode:=gfGrowLoY+gfGrowHiX+gfGrowHiY; Insert(HSB);
2600
GetExtent(R); R.A.X:=R.B.X-1; R.Grow(0,-1);
2601
New(VSB, Init(R)); VSB^.GrowMode:=gfGrowLoX+gfGrowHiX+gfGrowHiY; Insert(VSB);
2602
GetExtent(R); R.A.X:=3; R.B.X:=14; R.A.Y:=R.B.Y-1;
2603
New(Indicator, Init(R));
2604
Indicator^.GrowMode:=gfGrowLoY+gfGrowHiY;
2606
GetExtent(R); R.Grow(-1,-1);
2607
New(Editor, Init(R, HSB, VSB, nil, GDBOutputFile));
2609
DisassemblyWindow:=@Self;
2612
procedure TDisassemblyWindow.LoadFunction(Const FuncName : string);
2617
If not assigned(Debugger) then Exit;
2618
Debugger^.Command('set print sym on');
2619
Debugger^.Command('set width 0xffffffff');
2620
Debugger^.Command('disas '+FuncName);
2621
p:=StrNew(Debugger^.GetOutput);
2623
if (Debugger^.IsRunning) and (FuncName='') then
2624
Editor^.GetCurrentLine(Debugger^.current_pc);
2628
procedure TDisassemblyWindow.LoadAddress(Addr : cardinal);
2633
If not assigned(Debugger) then Exit;
2634
Debugger^.Command('set print sym on');
2635
Debugger^.Command('set width 0xffffffff');
2636
Debugger^.Command('disas 0x'+HexStr(Addr,8));
2637
p:=StrNew(Debugger^.GetOutput);
2639
if Debugger^.IsRunning and
2640
(Debugger^.current_pc>=Editor^.MinAddress) and
2641
(Debugger^.current_pc<=Editor^.MaxAddress) then
2642
Editor^.GetCurrentLine(Debugger^.current_pc);
2647
function TDisassemblyWindow.ProcessPChar(p : pchar) : boolean;
2651
pos1, pos2, CurLine, PrevLine : longint;
2654
curaddress, cursymofs, CurFile,
2655
PrevFile, line : string;
2659
Editor^.DisasLines^.FreeAll;
2660
Editor^.SetFlags(Editor^.GetFlags or efSyntaxHighlight or efKeepLineAttr);
2662
Editor^.MinAddress:=0;
2663
Editor^.MaxAddress:=0;
2668
while assigned(p) do
2670
pline:=strscan(p,#10);
2671
if assigned(pline) then
2675
if assigned(pline) then
2682
{ now process the line }
2683
{ line is hexaddr <symbol+sym_offset at filename:line> assembly }
2684
pos1:=pos('<',line);
2687
curaddress:=copy(line,1,pos1-1);
2688
if copy(curaddress,1,2)='0x' then
2689
curaddress:='$'+copy(curaddress,3,length(curaddress)-2);
2690
val(curaddress,CurAddr,err);
2692
val(copy(curaddress,1,err-1),CurAddr,err);
2693
system.delete(line,1,pos1);
2695
pos1:=pos(' at ',line);
2696
pos2:=pos('>',line);
2697
if (pos1>0) and (pos1 < pos2) then
2699
cursymofs:=copy(line,1,pos1-1);
2700
CurFile:=copy(line,pos1+4,pos2-pos1-4);
2701
pos1:=pos(':',CurFile);
2704
val(copy(CurFile,pos1+1,high(CurFile)),CurLine,err);
2705
system.delete(CurFile,pos1,high(CurFile));
2709
system.delete(line,1,pos2);
2711
else { no ' at ' found before '>' }
2713
cursymofs:=copy(line,1,pos2-1);
2715
system.delete(line,1,pos2);
2717
if (CurFile<>'') and ((CurFile<>PrevFile) or (CurLine<>PrevLine)) then
2719
WriteSourceString(CurFile,CurLine);
2723
WriteDisassemblyString(line,curaddr);
2726
Editor^.ReleaseSource;
2727
Editor^.UpdateAttrs(0,attrForceFull);
2728
If assigned(BreakpointsCollection) then
2729
BreakpointsCollection^.ShowBreakpoints(@Self);
2734
procedure TDisassemblyWindow.HandleEvent(var Event: TEvent);
2736
inherited HandleEvent(Event);
2739
procedure TDisassemblyWindow.WriteSourceString(Const S : string;line : longint);
2741
Editor^.AddSourceLine(S,line);
2744
procedure TDisassemblyWindow.WriteDisassemblyString(Const S : string;address : cardinal);
2746
Editor^.AddAssemblyLine(S,address);
2749
procedure TDisassemblyWindow.SetCurAddress(address : cardinal);
2751
if (address<Editor^.MinAddress) or (address>Editor^.MaxAddress) then
2752
LoadAddress(address);
2753
Editor^.GetCurrentLine(address);
2756
procedure TDisassemblyWindow.UpdateCommands;
2757
var Active: boolean;
2759
Active:=GetState(sfActive);
2760
SetCmdState(SourceCmds+CompileCmds,Active);
2761
SetCmdState(EditorCmds,Active);
2762
SetCmdState(ToClipCmds+FromClipCmds+NulClipCmds+UndoCmd+RedoCmd,false);
2763
Message(Application,evBroadcast,cmCommandSetChanged,nil);
2767
function TDisassemblyWindow.GetPalette: PPalette;
2768
const P: string[length(CSourceWindow)] = CSourceWindow;
2773
destructor TDisassemblyWindow.Done;
2775
if @Self=DisassemblyWindow then
2776
DisassemblyWindow:=nil;
2783
constructor TClipboardWindow.Init;
2785
HSB,VSB: PScrollBar;
2787
Desktop^.GetExtent(R);
2788
inherited Init(R, '*');
2789
SetTitle(dialog_clipboard);
2790
HelpCtx:=hcClipboardWindow;
2794
GetExtent(R); R.A.Y:=R.B.Y-1; R.Grow(-1,0); R.A.X:=14;
2795
New(HSB, Init(R)); HSB^.GrowMode:=gfGrowLoY+gfGrowHiX+gfGrowHiY; Insert(HSB);
2796
GetExtent(R); R.A.X:=R.B.X-1; R.Grow(0,-1);
2797
New(VSB, Init(R)); VSB^.GrowMode:=gfGrowLoX+gfGrowHiX+gfGrowHiY; Insert(VSB);
2798
GetExtent(R); R.A.X:=3; R.B.X:=14; R.A.Y:=R.B.Y-1;
2799
New(Indicator, Init(R));
2800
Indicator^.GrowMode:=gfGrowLoY+gfGrowHiY;
2802
GetExtent(R); R.Grow(-1,-1);
2803
New(Editor, Init(R, HSB, VSB, Indicator, ''));
2804
Editor^.GrowMode:=gfGrowHiX+gfGrowHiY;
2807
Editor^.SetFlags(Editor^.GetFlags or efUseTabCharacters);
2813
procedure TClipboardWindow.Close;
2818
constructor TClipboardWindow.Load(var S: TStream);
2825
procedure TClipboardWindow.Store(var S: TStream);
2830
destructor TClipboardWindow.Done;
2834
ClipboardWindow:=nil;
2838
constructor TMessageListBox.Init(var Bounds: TRect; AHScrollBar, AVScrollBar: PScrollBar);
2840
inherited Init(Bounds,1,AHScrollBar, AVScrollBar);
2841
GrowMode:=gfGrowHiX+gfGrowHiY;
2842
New(ModuleNames, Init(50,100));
2847
function TMessageListBox.GetLocalMenu: PMenu;
2850
if (Owner<>nil) and (Owner^.GetState(sfModal)) then M:=nil else
2852
NewItem(menu_msglocal_clear,'',kbNoKey,cmMsgClear,hcMsgClear,
2854
NewItem(menu_msglocal_gotosource,'',kbNoKey,cmMsgGotoSource,hcMsgGotoSource,
2855
NewItem(menu_msglocal_tracksource,'',kbNoKey,cmMsgTrackSource,hcMsgTrackSource,
2857
NewItem(menu_msglocal_saveas,'',kbNoKey,cmSaveAs,hcSaveAs,
2862
procedure TMessageListBox.SetState(AState: Word; Enable: Boolean);
2866
inherited SetState(AState,Enable);
2867
if ((AState and sfActive)<>0) and (((OldState xor State) and sfActive)<>0) then
2868
SetCmdState([cmSaveAs],Enable);
2872
procedure TMessageListBox.HandleEvent(var Event: TEvent);
2873
var DontClear: boolean;
2879
case Event.KeyCode of
2882
Message(@Self,evCommand,cmMsgGotoSource,nil);
2889
if not DontClear then
2893
case Event.Command of
2894
cmListItemSelected :
2895
if Event.InfoPtr=@Self then
2896
Message(@Self,evCommand,cmMsgTrackSource,nil);
2901
case Event.Command of
2919
if not DontClear then
2923
inherited HandleEvent(Event);
2926
procedure TMessageListBox.AddItem(P: PMessageItem);
2929
if List=nil then New(List, Init(500,500));
2930
W:=length(P^.GetText(255));
2934
if HScrollBar<>nil then
2935
HScrollBar^.SetRange(0,MaxWidth);
2938
SetRange(List^.Count);
2939
if Focused=List^.Count-1-1 then
2940
FocusItem(List^.Count-1);
2944
function TMessageListBox.AddModuleName(const Name: string): PString;
2947
if ModuleNames<>nil then
2948
P:=ModuleNames^.Add(Name)
2954
function TMessageListBox.GetText(Item,MaxLen: Sw_Integer): String;
2955
var P: PMessageItem;
2959
S:=P^.GetText(MaxLen);
2960
GetText:=copy(S,1,MaxLen);
2963
procedure TMessageListBox.Clear;
2965
if assigned(List) then
2966
Dispose(List, Done);
2969
if assigned(ModuleNames) then
2970
ModuleNames^.FreeAll;
2971
SetRange(0); DrawView;
2972
Message(Application,evBroadcast,cmClearLineHighlights,@Self);
2975
procedure TMessageListBox.TrackSource;
2976
var W: PSourceWindow;
2979
Row,Col: sw_integer;
2982
Message(Application,evBroadcast,cmClearLineHighlights,@Self);
2983
if Range=0 then Exit;
2984
P:=List^.At(Focused);
2985
if P^.Row=0 then Exit;
2987
GetNextEditorBounds(R);
2988
R.B.Y:=Owner^.Origin.Y;
2989
if P^.Row>0 then Row:=P^.Row-1 else Row:=0;
2990
if P^.Col>0 then Col:=P^.Col-1 else Col:=0;
2991
W:=EditorWindowFile(P^.GetModuleName);
2995
R.B.Y:=Owner^.Origin.Y;
2997
W^.Editor^.SetCurPtr(Col,Row);
3000
W:=TryToOpenFile(@R,P^.GetModuleName,Col,Row,true);
3001
{ Try to find it by browsing }
3005
Found:=IDEApp.OpenSearch(P^.GetModuleName+'*');
3007
W:=TryToOpenFile(nil,P^.GetModuleName,Col,Row,true);
3013
W^.Editor^.TrackCursor(true);
3014
W^.Editor^.SetLineFlagExclusive(lfHighlightRow,Row);
3016
if Assigned(Owner) then
3021
procedure TMessageListBox.GotoSource;
3022
var W: PSourceWindow;
3025
Row,Col: sw_integer;
3029
Message(Application,evBroadcast,cmClearLineHighlights,@Self);
3030
if Range=0 then Exit;
3031
P:=List^.At(Focused);
3032
if P^.Row=0 then Exit;
3034
if P^.Row>0 then Row:=P^.Row-1 else Row:=0;
3035
if P^.Col>0 then Col:=P^.Col-1 else Col:=0;
3036
W:=EditorWindowFile(P^.GetModuleName);
3040
if Owner^.Origin.Y>R.A.Y+4 then
3041
R.B.Y:=Owner^.Origin.Y;
3043
W^.Editor^.SetCurPtr(Col,Row);
3046
W:=TryToOpenFile(nil,P^.GetModuleName,Col,Row,true);
3047
{ Try to find it by browsing }
3051
Found:=IDEApp.OpenSearch(P^.GetModuleName+'*');
3053
W:=TryToOpenFile(nil,P^.GetModuleName,Col,Row,true);
3058
{ Message(Owner,evCommand,cmClose,nil);
3059
This calls close on StackWindow
3063
if (P^.TClass<>0) then
3064
W^.Editor^.SetErrorMessage(P^.GetText(R.B.X-R.A.X));
3071
Event.What:=evCommand;
3072
Event.command:=cmClose;
3074
fpide.PutEvent(Owner,Event);
3078
procedure TMessageListBox.Draw;
3080
I, J, Item: Sw_Integer;
3081
NormalColor, SelectedColor, FocusedColor, Color: Word;
3082
ColWidth, CurCol, Indent: Integer;
3087
procedure MT(var C: word); begin if TC<>0 then C:=(C and $ff0f) or (TC and $f0); end;
3089
if (Owner<>nil) then TC:=ord(Owner^.GetColor(6)) else TC:=0;
3090
if State and (sfSelected + sfActive) = (sfSelected + sfActive) then
3092
NormalColor := GetColor(1);
3093
FocusedColor := GetColor(3);
3094
SelectedColor := GetColor(4);
3097
NormalColor := GetColor(2);
3098
SelectedColor := GetColor(4);
3101
begin MT(NormalColor); MT(SelectedColor); end;
3103
SelectedColor:=NormalColor;
3104
if HScrollBar <> nil then Indent := HScrollBar^.Value
3106
ColWidth := Size.X div NumCols + 1;
3107
for I := 0 to Size.Y - 1 do
3109
for J := 0 to NumCols-1 do
3111
Item := J*Size.Y + I + TopItem;
3112
CurCol := J*ColWidth;
3113
if (State and (sfSelected + sfActive) = (sfSelected + sfActive)) and
3114
(Focused = Item) and (Range > 0) then
3116
Color := FocusedColor;
3117
SetCursor(CurCol+1,I);
3120
else if (Item < Range) and IsSelected(Item) then
3122
Color := SelectedColor;
3127
Color := NormalColor;
3130
MoveChar(B[CurCol], ' ', Color, ColWidth);
3131
if Item < Range then
3133
Text := GetText(Item, ColWidth + Indent);
3134
Text := Copy(Text,Indent,ColWidth);
3135
MoveStr(B[CurCol+1], Text, Color);
3138
WordRec(B[CurCol]).Lo := Byte(SpecialChars[SCOff]);
3139
WordRec(B[CurCol+ColWidth-2]).Lo := Byte(SpecialChars[SCOff+1]);
3142
MoveChar(B[CurCol+ColWidth-1], #179, GetColor(5), 1);
3144
WriteLine(0, I, Size.X, 1, B);
3148
constructor TMessageListBox.Load(var S: TStream);
3151
New(ModuleNames, Init(50,100));
3155
procedure TMessageListBox.Store(var S: TStream);
3156
var OL: PCollection;
3159
OL:=List; ORV:=Range;
3161
New(List, Init(1,1)); Range:=0;
3165
Dispose(List, Done);
3166
List:=OL; Range:=ORV;
3167
{ ^^^ nasty trick - has anyone a better idea how to avoid storing the
3168
collection? Pasting here a modified version of TListBox.Store+
3169
TAdvancedListBox.Store isn't a better solution, since by eventually
3170
changing the obj-hierarchy you'll always have to modify this, too - BG }
3173
destructor TMessageListBox.Done;
3176
if List<>nil then Dispose(List, Done);
3177
if ModuleNames<>nil then Dispose(ModuleNames, Done);
3180
constructor TMessageItem.Init(AClass: longint; const AText: string; AModule: PString; ARow, ACol: sw_integer);
3184
Text:=NewStr(AText);
3186
Row:=ARow; Col:=ACol;
3189
function TMessageItem.GetText(MaxLen: Sw_integer): string;
3192
if Text=nil then S:='' else S:=Text^;
3193
if (Module<>nil) then
3194
S:=NameAndExtOf(Module^)+'('+IntToStr(Row)+') '+S;
3195
if length(S)>MaxLen then S:=copy(S,1,MaxLen-2)+'..';
3199
procedure TMessageItem.Selected;
3203
function TMessageItem.GetModuleName: string;
3205
GetModuleName:=GetStr(Module);
3208
destructor TMessageItem.Done;
3211
if Text<>nil then DisposeStr(Text);
3212
{ if Module<>nil then DisposeStr(Module);}
3216
procedure TFPDlgWindow.HandleEvent(var Event: TEvent);
3220
case Event.Command of
3221
cmSearchWindow+1..cmSearchWindow+99 :
3222
if (Event.Command-cmSearchWindow=Number) then
3226
inherited HandleEvent(Event);
3231
constructor TTab.Init(var Bounds: TRect; ATabDef: PTabDef);
3233
inherited Init(Bounds);
3234
Options:=Options or ofSelectable or ofFirstClick or ofPreProcess or ofPostProcess;
3235
GrowMode:=gfGrowHiX+gfGrowHiY+gfGrowRel;
3242
function TTab.TabCount: integer;
3255
function TTab.AtTab(Index: integer): PTabDef;
3262
if P=nil then RunError($AA);
3269
procedure TTab.SelectTab(Index: integer);
3273
if ActiveDef<>Index then
3275
if Owner<>nil then Owner^.Lock;
3278
if TabDefs<>nil then
3281
while AtTab(DefCount-1)^.Next<>nil do Inc(DefCount);
3284
if ActiveDef<>-1 then
3286
P:=AtTab(ActiveDef)^.Items;
3289
if P^.View<>nil then Delete(P^.View);
3294
P:=AtTab(ActiveDef)^.Items;
3297
if P^.View<>nil then Insert(P^.View);
3300
V:=AtTab(ActiveDef)^.DefItem;
3301
if V<>nil then V^.Select;
3305
if Owner<>nil then Owner^.UnLock;
3310
procedure TTab.ChangeBounds(var Bounds: TRect);
3312
procedure DoCalcChange(P: PView); {$ifndef FPC}far;{$endif}
3316
if P^.Owner=nil then Exit; { it think this is a bug in TV }
3317
P^.CalcBounds(R, D);
3324
D.X := Bounds.B.X - Bounds.A.X - Size.X;
3325
D.Y := Bounds.B.Y - Bounds.A.Y - Size.Y;
3326
inherited ChangeBounds(Bounds);
3327
for I:=0 to TabCount-1 do
3328
if I<>ActiveDef then
3333
if P^.View<>nil then DoCalcChange(P^.View);
3339
procedure TTab.SelectNextTab(Forwards: boolean);
3343
if Index=-1 then Exit;
3344
if Forwards then Inc(Index) else Dec(Index);
3345
if Index<0 then Index:=DefCount-1 else
3346
if Index>DefCount-1 then Index:=0;
3350
procedure TTab.HandleEvent(var Event: TEvent);
3351
var Index : integer;
3360
function FirstSelectable: PView;
3365
while (FV<>nil) and ((FV^.Options and ofSelectable)=0) and (FV<>Last) do
3368
if (FV^.Options and ofSelectable)=0 then FV:=nil;
3369
FirstSelectable:=FV;
3371
function LastSelectable: PView;
3376
while (LV<>nil) and ((LV^.Options and ofSelectable)=0) and (LV<>First) do
3379
if (LV^.Options and ofSelectable)=0 then LV:=nil;
3383
if (Event.What and evMouseDown)<>0 then
3385
MakeLocal(Event.Where,P);
3389
for i:=0 to DefCount-1 do
3391
Len:=CStrLen(AtTab(i)^.Name^);
3392
if (P.X>=X) and (P.X<=X+Len+1) then Index:=i;
3399
if Event.What=evKeyDown then
3402
case Event.KeyCode of
3405
SelectNextTab((Event.KeyShift and kbShift)=0);
3409
if GetState(sfSelected) then
3411
if Current<>nil then
3413
LastV:=LastSelectable; FirstV:=FirstSelectable;
3414
if ((Current=LastV) or (Current=PLabel(LastV)^.Link)) and (Event.KeyCode=kbShiftTab) then
3416
if Owner<>nil then Owner^.SelectNext(true);
3418
if ((Current=FirstV) or (Current=PLabel(FirstV)^.Link)) and (Event.KeyCode=kbTab) then
3421
if Owner<>nil then Owner^.SelectNext(false);
3424
SelectNext(Event.KeyCode=kbShiftTab);
3429
for I:=0 to DefCount-1 do
3431
if Upcase(GetAltChar(Event.KeyCode))=AtTab(I)^.ShortCut
3443
V:=AtTab(ActiveDef)^.DefItem;
3444
if V<>nil then V^.Focus;
3448
if Event.What=evKeyDown then
3450
if ((Owner<>nil) and (Owner^.Phase=phPostProcess) and (GetAltChar(Event.KeyCode)<>#0)) or GetState(sfFocused)
3452
else CallOrig:=false;
3454
if CallOrig then inherited HandleEvent(Event);
3457
function TTab.GetPalette: PPalette;
3462
procedure TTab.Draw;
3463
var B : TDrawBuffer;
3466
HeaderLen : integer;
3469
ActiveKPos : integer;
3470
ActiveVPos : integer;
3473
procedure SWriteBuf(X,Y,W,H: integer; var Buf);
3476
if Y+H>Size.Y then H:=Size.Y-Y;
3477
if X+W>Size.X then W:=Size.X-X;
3478
if Buffer=nil then WriteBuf(X,Y,W,H,Buf)
3479
else for i:=1 to H do
3480
Move(Buf,Buffer^[X+(Y+i-1)*Size.X],W*2);
3484
MoveChar(B,' ',C1,Size.X);
3487
if InDraw then Exit;
3489
{ - Start of TGroup.Draw - }
3490
{ if Buffer = nil then
3494
{ - Start of TGroup.Draw - }
3496
C1:=GetColor(1); C2:=(GetColor(7) and $f0 or $08)+GetColor(9)*256; C3:=GetColor(8)+GetColor({9}8)*256;
3497
HeaderLen:=0; for i:=0 to DefCount-1 do HeaderLen:=HeaderLen+CStrLen(AtTab(i)^.Name^)+3; Dec(HeaderLen);
3498
if HeaderLen>Size.X-2 then HeaderLen:=Size.X-2;
3501
ClearBuf; MoveChar(B[0],'�',C1,1); MoveChar(B[HeaderLen+1],'�',C1,1);
3503
for i:=0 to DefCount-1 do
3505
Name:=AtTab(i)^.Name; X2:=CStrLen(Name^);
3510
if GetState(sfFocused) then C:=C3 else C:=C2;
3513
MoveCStr(B[X],' '+Name^+' ',C); X:=X+X2+3;
3514
MoveChar(B[X-1],'�',C1,1);
3516
SWriteBuf(0,1,Size.X,1,B);
3519
ClearBuf; MoveChar(B[0],'�',C1,1);
3521
for i:=0 to DefCount-1 do
3523
if I<ActiveDef then FC:='�'
3525
X2:=CStrLen(AtTab(i)^.Name^)+2;
3526
MoveChar(B[X+X2],{'�'}FC,C1,1);
3527
if i=DefCount-1 then X2:=X2+1;
3529
MoveChar(B[X],'�',C1,X2);
3532
MoveChar(B[HeaderLen+1],'�',C1,1);
3533
MoveChar(B[ActiveKPos],'�',C1,1); MoveChar(B[ActiveVPos],'�',C1,1);
3534
SWriteBuf(0,0,Size.X,1,B);
3537
MoveChar(B[1],'�',C1,Max(HeaderLen,0)); MoveChar(B[HeaderLen+2],'�',C1,Max(Size.X-HeaderLen-3,0));
3538
MoveChar(B[Size.X-1],'�',C1,1);
3539
MoveChar(B[ActiveKPos],'�',C1,1);
3540
if ActiveDef=0 then MoveChar(B[0],'�',C1,1)
3541
else MoveChar(B[0],{'�'}'�',C1,1);
3542
MoveChar(B[HeaderLen+1],'�'{'�'},C1,1); MoveChar(B[ActiveVPos],'�',C1,1);
3543
MoveChar(B[ActiveKPos+1],' ',C1,Max(ActiveVPos-ActiveKPos-1,0));
3544
SWriteBuf(0,2,Size.X,1,B);
3546
{ --- marad�k sor --- }
3547
ClearBuf; MoveChar(B[0],'�',C1,1); MoveChar(B[Size.X-1],'�',C1,1);
3548
for i:=3 to Size.Y-1 do
3549
SWriteBuf(0,i,Size.X,1,B);
3550
{ SWriteBuf(0,3,Size.X,Size.Y-4,B); this was wrong
3551
because WriteBuf then expect a buffer of size size.x*(size.y-4)*2 PM }
3553
{ --- Size.X . sor --- }
3554
MoveChar(B[0],'�',C1,1); MoveChar(B[1],'�',C1,Max(Size.X-2,0)); MoveChar(B[Size.X-1],'�',C1,1);
3555
SWriteBuf(0,Size.Y-1,Size.X,1,B);
3557
{ - End of TGroup.Draw - }
3558
if Buffer <> nil then
3564
if Buffer <> nil then WriteBuf(0, 0, Size.X, Size.Y, Buffer^) else
3570
{ - End of TGroup.Draw - }
3574
function TTab.Valid(Command: Word): Boolean;
3581
while (PT<>nil) and (OK=true) do
3584
while (PI<>nil) and (OK=true) do
3586
if PI^.View<>nil then OK:=OK and PI^.View^.Valid(Command);
3594
procedure TTab.SetState(AState: Word; Enable: Boolean);
3596
inherited SetState(AState,Enable);
3597
if (AState and sfFocused)<>0 then DrawView;
3600
destructor TTab.Done;
3602
procedure DeleteViews(P: PView); {$ifndef FPC}far;{$endif}
3604
if P<>nil then Delete(P);
3607
ForEach(@DeleteViews);
3620
constructor TScreenView.Init(var Bounds: TRect; AHScrollBar, AVScrollBar: PScrollBar;
3623
inherited Init(Bounds,AHScrollBar,AVScrollBar);
3627
SetState(sfCursorVis,true);
3631
procedure TScreenView.Update;
3633
SetLimit(UserScreen^.GetWidth,UserScreen^.GetHeight);
3637
procedure TScreenView.HandleEvent(var Event: TEvent);
3641
case Event.Command of
3645
inherited HandleEvent(Event);
3648
procedure TScreenView.Draw;
3654
Screen^.GetCursorPos(P);
3655
for Y:=Delta.Y to Delta.Y+Size.Y-1 do
3657
if Y<Screen^.GetHeight then
3658
Screen^.GetLine(Y,Text,Attr)
3660
begin Text:=''; Attr:=''; end;
3661
Text:=copy(Text,Delta.X+1,255); Attr:=copy(Attr,Delta.X+1,255);
3662
MoveChar(B,' ',GetColor(1),Size.X);
3663
for X:=1 to length(Text) do
3664
MoveChar(B[X-1],Text[X],ord(Attr[X]),1);
3665
WriteLine(0,Y-Delta.Y,Size.X,1,B);
3667
SetCursor(P.X-Delta.X,P.Y-Delta.Y);
3670
constructor TScreenWindow.Init(AScreen: PScreen; ANumber: integer);
3672
VSB,HSB: PScrollBar;
3674
Desktop^.GetExtent(R);
3675
inherited Init(R, dialog_userscreen, ANumber);
3676
Options:=Options or ofTileAble;
3677
GetExtent(R); R.Grow(-1,-1); R.Move(1,0); R.A.X:=R.B.X-1;
3678
New(VSB, Init(R)); VSB^.Options:=VSB^.Options or ofPostProcess;
3679
VSB^.GrowMode:=gfGrowLoX+gfGrowHiX+gfGrowHiY; Insert(VSB);
3680
GetExtent(R); R.Grow(-1,-1); R.Move(0,1); R.A.Y:=R.B.Y-1;
3681
New(HSB, Init(R)); HSB^.Options:=HSB^.Options or ofPostProcess;
3682
HSB^.GrowMode:=gfGrowLoY+gfGrowHiX+gfGrowHiY; Insert(HSB);
3683
GetExtent(R); R.Grow(-1,-1);
3684
New(ScreenView, Init(R, HSB, VSB, AScreen));
3685
ScreenView^.GrowMode:=gfGrowHiX+gfGrowHiY;
3687
UserScreenWindow:=@Self;
3690
destructor TScreenWindow.Done;
3693
UserScreenWindow:=nil;
3696
const InTranslate : boolean = false;
3698
procedure TranslateMouseClick(View: PView; var Event: TEvent);
3699
procedure TranslateAction(Action: integer);
3702
if Action<>acNone then
3705
E.What:=evMouseDown; E.Buttons:=mbLeftButton;
3706
View^.HandleEvent(E);
3707
Event.What:=evCommand;
3708
Event.Command:=ActionCommands[Action];
3712
if InTranslate then Exit;
3716
if (GetShiftState and kbAlt)<>0 then
3717
TranslateAction(AltMouseAction) else
3718
if (GetShiftState and kbCtrl)<>0 then
3719
TranslateAction(CtrlMouseAction);
3724
function GetNextEditorBounds(var Bounds: TRect): boolean;
3727
P:=Desktop^.Current;
3730
if P^.HelpCtx=hcSourceWindow then Break;
3732
if P=Desktop^.Current then
3738
if P=nil then Desktop^.GetExtent(Bounds) else
3740
P^.GetBounds(Bounds);
3741
Inc(Bounds.A.X); Inc(Bounds.A.Y);
3743
GetNextEditorBounds:=P<>nil;
3746
function IOpenEditorWindow(Bounds: PRect; FileName: string; CurX,CurY: sw_integer; ShowIt: boolean): PSourceWindow;
3750
if Assigned(Bounds) then R.Copy(Bounds^) else
3751
GetNextEditorBounds(R);
3752
PushStatus(FormatStrStr(msg_openingsourcefile,SmartPath(FileName)));
3753
New(W, Init(R, FileName));
3754
if ShowIt=false then
3758
if (CurX<>0) or (CurY<>0) then
3761
SetCurPtr(CurX,CurY);
3764
W^.HelpCtx:=hcSourceWindow;
3766
Message(Application,evBroadcast,cmUpdate,nil);
3769
IOpenEditorWindow:=W;
3772
function OpenEditorWindow(Bounds: PRect; FileName: string; CurX,CurY: sw_integer): PSourceWindow;
3774
OpenEditorWindow:=IOpenEditorWindow(Bounds,FileName,CurX,CurY,true);
3778
function LastSourceEditor : PSourceWindow;
3780
function IsSearchedSource(P: PView) : boolean; {$ifndef FPC}far;{$endif}
3783
(TypeOf(P^)=TypeOf(TSourceWindow)) then
3784
IsSearchedSource:=true
3786
IsSearchedSource:=false;
3790
LastSourceEditor:=PSourceWindow(Desktop^.FirstThat(@IsSearchedSource));
3794
function SearchOnDesktop(FileName : string;tryexts:boolean) : PSourceWindow;
3801
function IsSearchedFile(W : PSourceWindow) : boolean;
3805
if (W<>nil) and (W^.HelpCtx=hcSourceWindow) then
3808
SName:=NameAndExtOf(PSourceWindow(W)^.Editor^.FileName)
3810
SName:=PSourceWindow(W)^.Editor^.FileName;
3811
FSplit(SName,DS,NS,ES);
3812
SName:=UpcaseStr(NS+ES);
3814
if (E<>'') or (not tryexts) then
3817
Found:=UpCaseStr(DS)+SName=UpcaseStr(D+N+E)
3819
Found:=SName=UpcaseStr(N+E);
3823
Found:=SName=UpcaseStr(N+'.pp');
3825
Found:=SName=UpcaseStr(N+'.pas');
3828
IsSearchedFile:=found;
3830
function IsSearchedSource(P: PView) : boolean; {$ifndef FPC}far;{$endif}
3833
(TypeOf(P^)=TypeOf(TSourceWindow)) then
3834
IsSearchedSource:=IsSearchedFile(PSourceWindow(P))
3836
IsSearchedSource:=false;
3840
FSplit(FileName,D,N,E);
3841
SearchOnDesktop:=PSourceWindow(Desktop^.FirstThat(@IsSearchedSource));
3844
function TryToOpenFile(Bounds: PRect; FileName: string; CurX,CurY: sw_integer;tryexts:boolean): PSourceWindow;
3846
TryToOpenFile:=ITryToOpenFile(Bounds,FileName,CurX,CurY,tryexts,true,false);
3849
function LocateSingleSourceFile(const FileName: string; tryexts: boolean): string;
3854
function CheckDir(NewDir: DirStr; NewName: NameStr; NewExt: ExtStr): boolean;
3857
NewDir:=CompleteDir(NewDir);
3858
OK:=ExistsFile(NewDir+NewName+NewExt);
3859
if OK then begin D:=NewDir; N:=NewName; E:=NewExt; end;
3863
function CheckExt(NewExt: ExtStr): boolean;
3867
if D<>'' then OK:=CheckDir(D,N,NewExt) else
3868
if CheckDir('.'+DirSep,N,NewExt) then OK:=true;
3872
function TryToLocateIn(const DD : dirstr): boolean;
3877
if (E<>'') or (not tryexts) then
3880
if CheckExt('.pp') then
3883
if CheckExt('.pas') then
3886
if CheckExt('.inc') then
3888
{ try also without extension if no other exist }
3890
if CheckExt('') then
3894
TryToLocateIn:=Found;
3896
var Path,DrStr: string;
3899
FSplit(FileName,D,N,E);
3900
Found:=CheckDir(D,N,E);
3902
Found:=TryToLocateIn('.');
3903
DrStr:=GetSourceDirectories;
3905
While pos(ListSeparator,DrStr)>0 do
3907
Found:=TryToLocateIn(Copy(DrStr,1,pos(ListSeparator,DrStr)-1));
3910
DrStr:=Copy(DrStr,pos(ListSeparator,DrStr)+1,High(DrStr));
3912
if Found then Path:=FExpand(D+N+E) else Path:='';
3913
LocateSingleSourceFile:=Path;
3916
function LocateSourceFile(const FileName: string; tryexts: boolean): string;
3923
P:=Pos(ListSeparator,FN); if P=0 then P:=length(FN)+1;
3924
S:=copy(FN,1,P-1); Delete(FN,1,P);
3925
FFN:=LocateSingleSourceFile(S,tryexts);
3926
until (FFN<>'') or (FN='');
3927
LocateSourceFile:=FFN;
3930
function ITryToOpenFile(Bounds: PRect; FileName: string; CurX,CurY: sw_integer;tryexts:boolean;
3931
ShowIt,ForceNewWindow: boolean): PSourceWindow;
3937
if ForceNewWindow then
3940
W:=SearchOnDesktop(FileName,tryexts);
3943
NewEditorOpened:=false;
3944
{ if assigned(Bounds) then
3945
W^.ChangeBounds(Bounds^);}
3946
W^.Editor^.SetCurPtr(CurX,CurY);
3950
DrStr:=LocateSourceFile(FileName,tryexts);
3952
W:=IOpenEditorWindow(Bounds,DrStr,CurX,CurY,ShowIt);
3953
NewEditorOpened:=W<>nil;
3955
W^.Editor^.SetCurPtr(CurX,CurY);
3960
function StartEditor(Editor: PCodeEditor; FileName: string): boolean;
3966
New(E, Init(R,nil,nil,nil,nil,FileName));
3970
PushStatus(FormatStrStr(msg_readingfileineditor,FileName));
3978
Editor^.InsertFrom(E);
3979
Editor^.SetCurPtr(0,0);
3980
Editor^.SelectAll(false);
3987
constructor TTextScroller.Init(var Bounds: TRect; ASpeed: integer; AText: PUnsortedStringCollection);
3989
inherited Init(Bounds,'');
3990
EventMask:=EventMask or evIdle;
3991
Speed:=ASpeed; Lines:=AText;
3994
function TTextScroller.GetLineCount: integer;
3997
if Lines=nil then Count:=0 else
3998
Count:=Lines^.Count;
3999
GetLineCount:=Count;
4002
function TTextScroller.GetLine(I: integer): string;
4005
if I<Lines^.Count then
4006
S:=GetStr(Lines^.At(I))
4012
procedure TTextScroller.HandleEvent(var Event: TEvent);
4018
inherited HandleEvent(Event);
4021
procedure TTextScroller.Update;
4023
if abs(GetDosTicks-LastTT)<Speed then Exit;
4025
LastTT:=GetDosTicks;
4028
procedure TTextScroller.Reset;
4031
LastTT:=GetDosTicks;
4035
procedure TTextScroller.Scroll;
4038
if TopLine>=GetLineCount then
4043
procedure TTextScroller.Draw;
4050
Count:=GetLineCount;
4051
for Y:=0 to Size.Y-1 do
4053
if Count=0 then S:='' else
4054
S:=GetLine((TopLine+Y) mod Count);
4055
if copy(S,1,1)=^C then
4056
S:=CharStr(' ',Max(0,(Size.X-(length(S)-1)) div 2))+copy(S,2,255);
4057
MoveChar(B,' ',C,Size.X);
4059
WriteLine(0,Y,Size.X,1,B);
4063
destructor TTextScroller.Done;
4066
if Lines<>nil then Dispose(Lines, Done);
4069
constructor TFPAboutDialog.Init;
4071
C: PUnsortedStringCollection;
4074
procedure AddLine(S: string);
4076
C^.Insert(NewStr(S));
4079
R.Assign(0,0,58,14{$ifdef NODEBUG}-1{$endif});
4080
inherited Init(R, dialog_about);
4082
GetExtent(R); R.Grow(-3,-2);
4083
R2.Copy(R); R2.B.Y:=R2.A.Y+1;
4084
Insert(New(PStaticText, Init(R2, ^C'FreePascal IDE for '+source_info.name)));
4086
Insert(New(PStaticText, Init(R2, ^C'Target CPU: '+target_cpu_string)));
4088
Insert(New(PStaticText, Init(R2, ^C'Version '+VersionStr+' '+{$i %date%})));
4090
{$ifdef USE_GRAPH_SWITCH}
4091
Insert(New(PStaticText, Init(R2, ^C'With Graphic Support')));
4093
{$endif USE_GRAPH_SWITCH}
4094
Insert(New(PStaticText, Init(R2, FormatStrStr2(^C'(%s %s)',label_about_compilerversion,Version_String))));
4096
if pos('Fake',GDBVersion)=0 then
4099
Insert(New(PStaticText, Init(R2, FormatStrStr2(^C'(%s %s)',label_about_debugger,GDBVersion))));
4105
Insert(New(PStaticText, Init(R2, ^C'Copyright (C) 1998-2005 by')));
4107
Insert(New(PStaticText, Init(R2, ^C'B�rczi G�bor')));
4109
Insert(New(PStaticText, Init(R2, ^C'Pierre Muller')));
4111
Insert(New(PStaticText, Init(R2, ^C'and')));
4113
Insert(New(PStaticText, Init(R2, ^C'Peter Vreman')));
4114
New(C, Init(50,10));
4117
AddLine(^C'< Original concept >');
4118
AddLine(^C'Borland International, Inc.');
4120
AddLine(^C'< Compiler development >');
4121
AddLine(^C'Carl-Eric Codere');
4122
AddLine(^C'Daniel Mantione');
4123
AddLine(^C'Florian Kl�mpfl');
4124
AddLine(^C'Jonas Maebe');
4125
AddLine(^C'Mich�el Van Canneyt');
4126
AddLine(^C'Peter Vreman');
4127
AddLine(^C'Pierre Muller');
4129
AddLine(^C'< IDE development >');
4130
AddLine(^C'B�rczi G�bor');
4131
AddLine(^C'Peter Vreman');
4132
AddLine(^C'Pierre Muller');
4136
R.Grow(-1,-1); Inc(R.A.Y,3);
4137
New(Scroller, Init(R, 10, C));
4140
R.Move(0,-1); R.B.Y:=R.A.Y+1;
4141
New(TitleST, Init(R, ^C'Team'));
4148
procedure TFPAboutDialog.ToggleInfo;
4150
if Scroller=nil then Exit;
4151
if Scroller^.GetState(sfVisible) then
4164
procedure TFPAboutDialog.HandleEvent(var Event: TEvent);
4168
case Event.KeyCode of
4169
kbAltI : { just like in BP }
4176
inherited HandleEvent(Event);
4179
constructor TFPASCIIChart.Init;
4182
HelpCtx:=hcASCIITableWindow;
4183
Number:=SearchFreeWindowNo;
4187
procedure TFPASCIIChart.Store(var S: TStream);
4192
constructor TFPASCIIChart.Load(var S: TStream);
4197
procedure TFPASCIIChart.HandleEvent(var Event: TEvent);
4198
var W: PSourceWindow;
4202
case Event.KeyCode of
4210
case Event.Command of
4213
W:=FirstEditorWindow;
4214
if Assigned(W) and Assigned(Report) then
4215
Message(W,evCommand,cmAddChar,pointer(ptrint(ord(Report^.AsciiChar))));
4218
cmSearchWindow+1..cmSearchWindow+99 :
4219
if (Event.Command-cmSearchWindow=Number) then
4223
inherited HandleEvent(Event);
4226
destructor TFPASCIIChart.Done;
4232
function TVideoModeListBox.GetText(Item: pointer; MaxLen: sw_integer): string;
4237
S:=IntToStr(P^.Col)+'x'+IntToStr(P^.Row)+' ';
4242
GetText:=copy(S,1,MaxLen);
4245
constructor TFPDesktop.Init(var Bounds: TRect);
4247
inherited Init(Bounds);
4250
procedure TFPDesktop.InitBackground;
4251
var AV: PANSIBackground;
4256
FileName:=LocateFile(BackgroundPath);
4257
if FileName<>'' then
4261
AV^.GrowMode:=gfGrowHiX+gfGrowHiY;
4262
if AV^.LoadFile(FileName)=false then
4264
Dispose(AV, Done); AV:=nil;
4266
if Assigned(AV) then
4270
if Assigned(Background)=false then
4271
inherited InitBackground;
4274
constructor TFPDesktop.Load(var S: TStream);
4279
procedure TFPDesktop.Store(var S: TStream);
4284
constructor TFPToolTip.Init(var Bounds: TRect; const AText: string; AAlign: TAlign);
4286
inherited Init(Bounds);
4291
procedure TFPToolTip.Draw;
4293
procedure DrawLine(Y: integer; S: string);
4296
S:=copy(S,1,Size.X-2);
4299
alRight : S:=LExpand(' '+S,Size.X);
4300
alCenter : S:=Center(S,Size.X);
4302
MoveChar(B,' ',C,Size.X);
4304
WriteLine(0,Y,Size.X,1,B);
4311
for Y:=0 to Size.Y-1 do
4315
function TFPToolTip.GetText: string;
4317
GetText:=GetStr(Text);
4320
procedure TFPToolTip.SetText(const AText: string);
4322
if AText<>GetText then
4324
if Assigned(Text) then DisposeStr(Text);
4325
Text:=NewStr(AText);
4330
function TFPToolTip.GetAlign: TAlign;
4335
procedure TFPToolTip.SetAlign(AAlign: TAlign);
4337
if AAlign<>Align then
4344
destructor TFPToolTip.Done;
4346
if Assigned(Text) then DisposeStr(Text); Text:=nil;
4350
function TFPToolTip.GetPalette: PPalette;
4351
const S: string[length(CFPToolTip)] = CFPToolTip;
4356
constructor TFPMemo.Init(var Bounds: TRect; AHScrollBar, AVScrollBar:
4357
PScrollBar; AIndicator: PIndicator);
4359
inherited Init(Bounds,AHScrollBar,AVScrollBar,AIndicator,nil);
4360
SetFlags(Flags and not (efPersistentBlocks) or efSyntaxHighlight);
4363
function TFPMemo.GetPalette: PPalette;
4364
const P: string[length(CFPMemo)] = CFPMemo;
4369
function TFPMemo.GetSpecSymbolCount(SpecClass: TSpecSymbolClass): integer;
4371
GetSpecSymbolCount:=0;
4374
function TFPMemo.GetSpecSymbol(SpecClass: TSpecSymbolClass; Index: integer): pstring;
4380
function TFPMemo.IsReservedWord(const S: string): boolean;
4382
IsReservedWord:=false;
4385
constructor TFPCodeMemo.Init(var Bounds: TRect; AHScrollBar, AVScrollBar:
4386
PScrollBar; AIndicator: PIndicator);
4388
inherited Init(Bounds,AHScrollBar,AVScrollBar,AIndicator);
4391
function TFPCodeMemo.GetSpecSymbolCount(SpecClass: TSpecSymbolClass): integer;
4393
GetSpecSymbolCount:=FreePascalSpecSymbolCount[SpecClass];
4396
function TFPCodeMemo.GetSpecSymbol(SpecClass: TSpecSymbolClass; Index: integer): pstring;
4398
GetSpecSymbol:=@FreePascalEmptyString;
4402
0 : GetSpecSymbol:=@FreePascalCommentPrefix1;
4403
1 : GetSpecSymbol:=@FreePascalCommentPrefix2;
4404
2 : GetSpecSymbol:=@FreePascalCommentPrefix3;
4406
ssCommentSingleLinePrefix :
4408
0 : GetSpecSymbol:=@FreePascalCommentSingleLinePrefix;
4412
0 : GetSpecSymbol:=@FreePascalCommentSuffix1;
4413
1 : GetSpecSymbol:=@FreePascalCommentSuffix2;
4416
GetSpecSymbol:=@FreePascalStringPrefix;
4418
GetSpecSymbol:=@FreePascalStringSuffix;
4419
{ must be uppercased to avoid calling UpCaseStr in MatchesAnyAsmSymbol PM }
4421
GetSpecSymbol:=@FreePascalAsmPrefix;
4423
GetSpecSymbol:=@FreePascalAsmSuffix;
4425
GetSpecSymbol:=@FreePascalDirectivePrefix;
4427
GetSpecSymbol:=@FreePascalDirectiveSuffix;
4431
function TFPCodeMemo.IsReservedWord(const S: string): boolean;
4433
IsReservedWord:=IsFPReservedWord(S);
4438
function VESASetVideoModeProc(const VideoMode: TVideoMode; Params: Longint): Boolean; {$ifndef FPC}far;{$endif}
4440
VESASetVideoModeProc:=VESASetMode(Params);
4443
procedure InitVESAScreenModes;
4444
var ML: TVESAModeList;
4445
MI: TVESAModeInfoBlock;
4448
if VESAInit=false then Exit;
4449
if VESAGetModeList(ML)=false then Exit;
4450
for I:=1 to ML.Count do
4452
if VESAGetModeInfo(ML.Modes[I],MI) then
4455
if (Attributes and vesa_vma_GraphicsMode)=0 then
4457
if ((Attributes and vesa_vma_GraphicsMode)=0) or
4458
{ only allow 4 bit i.e. 16 color modes }
4459
(((Attributes and vesa_vma_CanBeSetInCurrentConfig)<>0) and
4460
(BitsPerPixel=8)) then
4462
RegisterVesaVideoMode(ML.Modes[I]);
4466
procedure DoneVESAScreenModes;
4472
procedure NoDebugger;
4474
InformationBox(msg_nodebuggersupportavailable,nil);
4477
procedure RegisterFPViews;
4479
RegisterType(RSourceEditor);
4480
RegisterType(RSourceWindow);
4481
RegisterType(RFPHelpViewer);
4482
RegisterType(RFPHelpWindow);
4483
RegisterType(RClipboardWindow);
4484
RegisterType(RMessageListBox);
4485
RegisterType(RFPDesktop);
4486
RegisterType(RFPASCIIChart);
4487
RegisterType(RFPDlgWindow);
4489
RegisterType(RGDBWindow);
4490
RegisterType(RGDBSourceEditor);
4497
$Log: fpviews.pas,v $
4498
Revision 1.59 2005/03/07 17:16:56 peter
4499
* ignore reserved tokens of length 1
4501
Revision 1.58 2005/02/14 17:13:18 peter
4504
Revision 1.57 2005/01/16 00:43:03 florian
4505
* fixed disassembly window on sparc
4507
Revision 1.56 2005/01/08 13:43:44 florian
4508
* updated version and copyright
4510
Revision 1.55 2005/01/08 11:43:18 florian
4511
+ vector unit window
4513
Revision 1.54 2005/01/07 19:09:28 florian
4514
* highlight keywords of all language modes