Browse Source

lot of Gabor changes : see fixes.txt

pierre 25 years ago
parent
commit
60e99fb8fd

+ 45 - 0
ide/text/fixes.txt

@@ -0,0 +1,45 @@
+========================= Fixes to apply ==============================
+
+The GO32 mouse.inc (API) displays a message ("No mouse driver found!") when
+it doesn't find a mouse driver. This message should be removed.
+
+========================= Already fixed ================================
+
+ [*] when saving a file with different name (or saving a new file) the
+     default extension of '.pas' wasn't applied to the name specified
+ [*] THelpViewer didn't care about LockFlag, and thus flickered on complex
+     updates
+ [*] sever sheets of the symbol browser were selectable thru keyboard, even
+     when they were disabled/non-visible
+ [*] Ctrl--> and Ctrl-<- skipped over '[' and ']'
+ [*] unsaved new windows (nonamexx.pas) aren't stored to desktop file any more
+     (on the next startup the IDE tried to open the file with no name)
+ [*] clock view didn't stay in the upper left corner when the desktop has been
+     resized (for ex. at video-mode change)
+ [*] the IDE didn't switch correctly between video modes
+     (especially 80x50 caused trouble)
+ [*] buttons in Breakpoints window didn't move when resizing the window
+ [*] tracking source didn't work correctly (for ex. in symbol browser,msgs,..)
+ [*] symbol browser didn't respond to Ctrl+Enter (goto source)
+ [*] symbol browser views' behaviour unified
+ [*] BuildObjectTree failed to build the object tree correctly when there were
+     multiple objects defined with the same name. for ex. in object pascal mode
+     there are 2 objects called TObject (the built-in base object for classes
+     and the one in objects.pp) and thus the entire object tree of TObject
+     object was "lost"
+ [*] in the linking state the text 'Please wait...' is displayed now, instead
+     of 'Press Esc to cancel' (which won't work and is incorrect)
+ [+] Inheritance symbol viewer scrolls now, and acts on [Ctrl+]Left,Right keys
+
+========================== Other improvements ============================
+
+ [+] at startup the IDE checks whether there's a file called FP.ANS in any
+     of the search directories, and if it founds one, then loads it as the
+     background for the desktop (the file is interpreted as an ANSI file)
+     (Peter, you can finally put your favorite FPC-logo on your desktop now ;)
+ [+] 'Auto track source' option implemented (-> symbol browser)
+ [+] 'Compiler messages' window is only shown when there's something to
+     display (ie. if there's no error/message, then it won't be shown)
+
+=========================== Todo ========================================
+

+ 5 - 1
ide/text/fp.pas

@@ -193,6 +193,7 @@ BEGIN
   InitDesktopFile;
   InitDesktopFile;
   LoadDesktop;
   LoadDesktop;
   ParseUserScreen;
   ParseUserScreen;
+  { why are the screen contents parsed at startup? Gabor }
 
 
   { Update IDE }
   { Update IDE }
   IDEApp.Update;
   IDEApp.Update;
@@ -236,7 +237,10 @@ BEGIN
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.42  2000-03-21 23:34:10  pierre
+  Revision 1.43  2000-04-18 11:42:36  pierre
+   lot of Gabor changes : see fixes.txt
+
+  Revision 1.42  2000/03/21 23:34:10  pierre
    adapted to wcedit addition by Gabor
    adapted to wcedit addition by Gabor
 
 
   Revision 1.41  2000/03/13 20:41:34  pierre
   Revision 1.41  2000/03/13 20:41:34  pierre

+ 6 - 3
ide/text/fpcalc.pas

@@ -385,7 +385,7 @@ end;
 
 
 procedure TCalculator.HandleEvent(var Event: TEvent);
 procedure TCalculator.HandleEvent(var Event: TEvent);
 var R: extended;
 var R: extended;
-    Re: real;
+{    Re: real;}
 begin
 begin
   if (State and sfSelected)<>0 then
   if (State and sfSelected)<>0 then
   case Event.What of
   case Event.What of
@@ -404,7 +404,7 @@ begin
        kbCtrlEnter :
        kbCtrlEnter :
          begin
          begin
            ClearEvent(Event);
            ClearEvent(Event);
-           CD^.GetDisplay(R); Re:=R;
+           CD^.GetDisplay(R); {Re:=R;}
            Close;
            Close;
            CalcClipboard:=R;
            CalcClipboard:=R;
            Message(Application,evBroadcast,cmCalculatorPaste,nil);
            Message(Application,evBroadcast,cmCalculatorPaste,nil);
@@ -463,7 +463,10 @@ end;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.8  2000-03-21 23:34:10  pierre
+  Revision 1.9  2000-04-18 11:42:36  pierre
+   lot of Gabor changes : see fixes.txt
+
+  Revision 1.8  2000/03/21 23:34:10  pierre
    adapted to wcedit addition by Gabor
    adapted to wcedit addition by Gabor
 
 
   Revision 1.7  1999/09/13 16:24:42  peter
   Revision 1.7  1999/09/13 16:24:42  peter

+ 2 - 0
ide/text/fpcodcmp.pas

@@ -186,6 +186,8 @@ function TCodeCompleteDialog.Execute: Word;
 var R: word;
 var R: word;
     C: PCodeCompleteWordList;
     C: PCodeCompleteWordList;
     I: integer;
     I: integer;
+    S1,S2,S3: string;
+    W: word;
 begin
 begin
   New(C, Init(10,20));
   New(C, Init(10,20));
   if Assigned(CodeCompleteWords) then
   if Assigned(CodeCompleteWords) then

+ 9 - 2
ide/text/fpcodtmp.pas

@@ -252,6 +252,8 @@ end;
 
 
 constructor TCodeTemplateDialog.Init(const ATitle: string; ATemplate: PCodeTemplate);
 constructor TCodeTemplateDialog.Init(const ATitle: string; ATemplate: PCodeTemplate);
 var R,R2,R3: TRect;
 var R,R2,R3: TRect;
+    Items: PSItem;
+    I,KeyCount: sw_integer;
 begin
 begin
   R.Assign(0,0,52,15);
   R.Assign(0,0,52,15);
   inherited Init(R,ATitle);
   inherited Init(R,ATitle);
@@ -262,7 +264,7 @@ begin
   New(ShortCutIL, Init(R, 128)); Insert(ShortcutIL);
   New(ShortCutIL, Init(R, 128)); Insert(ShortcutIL);
   R2.Copy(R); R2.Move(-1,-1); Insert(New(PLabel, Init(R2, '~S~hortcut', ShortcutIL)));
   R2.Copy(R); R2.Move(-1,-1); Insert(New(PLabel, Init(R2, '~S~hortcut', ShortcutIL)));
   R.Move(0,3); R.B.Y:=R.A.Y+8;
   R.Move(0,3); R.B.Y:=R.A.Y+8;
-  New(CodeMemo, Init(R, nil,nil,nil)); Insert(CodeMemo);
+  New(CodeMemo, Init(R, nil,nil,nil{,4096 does not compile !! })); Insert(CodeMemo);
   R2.Copy(R); R2.Move(-1,-1); R2.B.Y:=R2.A.Y+1; Insert(New(PLabel, Init(R2, '~T~emplate content', CodeMemo)));
   R2.Copy(R); R2.Move(-1,-1); R2.B.Y:=R2.A.Y+1; Insert(New(PLabel, Init(R2, '~T~emplate content', CodeMemo)));
 
 
   InsertButtons(@Self);
   InsertButtons(@Self);
@@ -274,6 +276,7 @@ function TCodeTemplateDialog.Execute: Word;
 var R: word;
 var R: word;
     S: string;
     S: string;
     L: PUnsortedStringCollection;
     L: PUnsortedStringCollection;
+    W: word;
 begin
 begin
   New(L, Init(10,10));
   New(L, Init(10,10));
   S:=Template^.GetShortCut;
   S:=Template^.GetShortCut;
@@ -311,7 +314,7 @@ begin
   GetExtent(R); R.Grow(-2,-2); Inc(R.A.Y,12);
   GetExtent(R); R.Grow(-2,-2); Inc(R.A.Y,12);
   R2.Copy(R); R2.Move(1,0); R2.A.X:=R2.B.X-1;
   R2.Copy(R); R2.Move(1,0); R2.A.X:=R2.B.X-1;
   New(SB, Init(R2)); Insert(SB);
   New(SB, Init(R2)); Insert(SB);
-  New(TemplateViewer, Init(R,nil,SB,nil));
+  New(TemplateViewer, Init(R,nil,SB,nil{,4096 does not compile }));
   with TemplateViewer^ do
   with TemplateViewer^ do
   begin
   begin
     ReadOnly:=true;
     ReadOnly:=true;
@@ -389,6 +392,8 @@ var R: word;
     C: PCodeTemplateCollection;
     C: PCodeTemplateCollection;
     L: PUnsortedStringCollection;
     L: PUnsortedStringCollection;
     I: integer;
     I: integer;
+    S1,S2,S3: string;
+    W: word;
 begin
 begin
   New(C, Init(10,20));
   New(C, Init(10,20));
   if Assigned(CodeTemplates) then
   if Assigned(CodeTemplates) then
@@ -418,6 +423,8 @@ var P,P2: PCodeTemplate;
     IC: boolean;
     IC: boolean;
     S: string;
     S: string;
     L: PUnsortedStringCollection;
     L: PUnsortedStringCollection;
+    I: sw_integer;
+    W: word;
     Cmd: word;
     Cmd: word;
     CanExit: boolean;
     CanExit: boolean;
 begin
 begin

+ 17 - 9
ide/text/fpcompil.pas

@@ -61,7 +61,7 @@ type
       procedure   Store(var S: TStream);
       procedure   Store(var S: TStream);
     private
     private
       {CompileShowed : boolean;}
       {CompileShowed : boolean;}
-      Mode   : TCompileMode;
+      {Mode   : TCompileMode;}
       MsgLB  : PCompilerMessageListBox;
       MsgLB  : PCompilerMessageListBox;
       {CurrST,
       {CurrST,
       InfoST : PColorStaticText;}
       InfoST : PColorStaticText;}
@@ -435,10 +435,11 @@ end;
 
 
 procedure TCompilerStatusDialog.Update;
 procedure TCompilerStatusDialog.Update;
 const
 const
-  CtrlBS   = 'Press ESC to cancel';
-  SuccessS = 'Compile successful: ~Press Enter~';
-  FailS    = 'Compile failed';
-  AbortS   = 'Compile aborted';
+  CtrlBS      = 'Press ESC to cancel';
+  SuccessS    = 'Compile successful: ~Press Enter~';
+  FailS       = 'Compile failed';
+  AbortS      = 'Compile aborted';
+  PleaseWaitS = 'Please wait...';
 var
 var
   StatusS,KeyS: string;
   StatusS,KeyS: string;
 begin
 begin
@@ -454,7 +455,7 @@ begin
     cpLinking   :
     cpLinking   :
       begin
       begin
         StatusS:='Linking '+ExeFile;
         StatusS:='Linking '+ExeFile;
-        KeyS:=CtrlBS;
+        KeyS:={CtrlBS}PleaseWaitS;
       end;
       end;
     cpDone      :
     cpDone      :
       begin
       begin
@@ -553,6 +554,10 @@ begin
      RedirDisableAll;
      RedirDisableAll;
 {$endif}
 {$endif}
 
 
+     if not CompilerMessageWindow^.GetState(sfVisible) then
+       CompilerMessageWindow^.Show;
+     if Desktop^.First<>PView(CompilerMessageWindow) then
+       CompilerMessageWindow^.MakeFirst;
      CompilerMessageWindow^.AddMessage(Level,S,status.currentsourcepath+status.currentsource,
      CompilerMessageWindow^.AddMessage(Level,S,status.currentsourcepath+status.currentsource,
        status.currentline,status.currentcolumn);
        status.currentline,status.currentcolumn);
      { update info messages }
      { update info messages }
@@ -648,9 +653,9 @@ begin
       Exit;
       Exit;
     end;
     end;
 { Show Compiler Messages Window }
 { Show Compiler Messages Window }
-  if not CompilerMessageWindow^.GetState(sfVisible) then
+{  if not CompilerMessageWindow^.GetState(sfVisible) then
    CompilerMessageWindow^.Show;
    CompilerMessageWindow^.Show;
-  CompilerMessageWindow^.MakeFirst;
+  CompilerMessageWindow^.MakeFirst;}
   CompilerMessageWindow^.ClearMessages;
   CompilerMessageWindow^.ClearMessages;
   { Tell why we compile }
   { Tell why we compile }
   NeedRecompile(true);
   NeedRecompile(true);
@@ -868,7 +873,10 @@ end;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.54  2000-03-23 22:23:21  pierre
+  Revision 1.55  2000-04-18 11:42:36  pierre
+   lot of Gabor changes : see fixes.txt
+
+  Revision 1.54  2000/03/23 22:23:21  pierre
    + Use PushStatus in ParseUserScreen
    + Use PushStatus in ParseUserScreen
 
 
   Revision 1.53  2000/03/21 23:33:18  pierre
   Revision 1.53  2000/03/21 23:33:18  pierre

+ 14 - 1
ide/text/fpconst.pas

@@ -34,6 +34,7 @@ const
      SwitchesName         = 'fp.cfg';
      SwitchesName         = 'fp.cfg';
      DesktopName          = 'fp.dsk';
      DesktopName          = 'fp.dsk';
      BrowserName          = 'fp.brw';
      BrowserName          = 'fp.brw';
+     BackgroundName       = 'fp.ans';
 
 
      ToolCaptureName      = '__tool__.out'; { all '$' signs replaces with '_'s }
      ToolCaptureName      = '__tool__.out'; { all '$' signs replaces with '_'s }
      FilterCaptureName    = '_filter_.out';
      FilterCaptureName    = '_filter_.out';
@@ -206,6 +207,11 @@ const
 
 
      cmDebuggerStopped   = 2600;
      cmDebuggerStopped   = 2600;
 
 
+     cmSymBrowse         = 2700;
+     cmSymGotoSource     = 2701;
+     cmSymTrackSource    = 2702;
+     cmSymOptions        = 2703;
+
      { Help constants }
      { Help constants }
      hcSourceWindow      = 8000;
      hcSourceWindow      = 8000;
      hcHelpWindow        = 8001;
      hcHelpWindow        = 8001;
@@ -313,6 +319,10 @@ const
      hcMsgClear          = hcShift+cmMsgClear;
      hcMsgClear          = hcShift+cmMsgClear;
      hcMsgGotoSource     = hcShift+cmMsgGotoSource;
      hcMsgGotoSource     = hcShift+cmMsgGotoSource;
      hcMsgTrackSource    = hcShift+cmMsgTrackSource;
      hcMsgTrackSource    = hcShift+cmMsgTrackSource;
+     hcSymBrowse         = hcShift+cmSymBrowse;
+     hcSymGotoSource     = hcShift+cmSymGotoSource;
+     hcSymTrackSource    = hcShift+cmSymTrackSource;
+     hcSymOptions        = hcShift+cmSymOptions;
      hcGotoCursor        = hcShift+cmGotoCursor;
      hcGotoCursor        = hcShift+cmGotoCursor;
      hcNewBreakpoint     = hcShift+cmNewBreakpoint;
      hcNewBreakpoint     = hcShift+cmNewBreakpoint;
      hcEditBreakpoint    = hcShift+cmEditBreakpoint;
      hcEditBreakpoint    = hcShift+cmEditBreakpoint;
@@ -386,7 +396,10 @@ implementation
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.35  2000-03-14 14:16:13  pierre
+  Revision 1.36  2000-04-18 11:42:36  pierre
+   lot of Gabor changes : see fixes.txt
+
+  Revision 1.35  2000/03/14 14:16:13  pierre
    + cmDebuggerStopped
    + cmDebuggerStopped
 
 
   Revision 1.34  2000/02/07 11:51:40  pierre
   Revision 1.34  2000/02/07 11:51:40  pierre

+ 21 - 9
ide/text/fpdebug.pas

@@ -1643,6 +1643,7 @@ var R,R2: TRect;
     ST: PStaticText;
     ST: PStaticText;
     S: String;
     S: String;
     X,X1 : Sw_integer;
     X,X1 : Sw_integer;
+    Btn: PButton;
 const White = 15;
 const White = 15;
 begin
 begin
   Desktop^.GetExtent(R); R.A.Y:=R.B.Y-18;
   Desktop^.GetExtent(R); R.A.Y:=R.B.Y-18;
@@ -1674,16 +1675,24 @@ begin
   X:=(R.B.X-R.A.X) div 4;
   X:=(R.B.X-R.A.X) div 4;
   X1:=R.A.X+(X div 2);
   X1:=R.A.X+(X div 2);
   R.A.X:=X1-3;R.B.X:=X1+7;
   R.A.X:=X1-3;R.B.X:=X1+7;
-  Insert(New(PButton, Init(R, '~C~lose', cmClose, bfDefault)));
+  New(Btn, Init(R, '~C~lose', cmClose, bfDefault));
+  Btn^.GrowMode:=gfGrowLoY+gfGrowHiY;
+  Insert(Btn);
   X1:=X1+X;
   X1:=X1+X;
   R.A.X:=X1-3;R.B.X:=X1+7;
   R.A.X:=X1-3;R.B.X:=X1+7;
-  Insert(New(PButton, Init(R, '~N~ew', cmNewBreakpoint, bfNormal)));
+  New(Btn, Init(R, '~N~ew', cmNewBreakpoint, bfNormal));
+  Btn^.GrowMode:=gfGrowLoY+gfGrowHiY;
+  Insert(Btn);
   X1:=X1+X;
   X1:=X1+X;
   R.A.X:=X1-3;R.B.X:=X1+7;
   R.A.X:=X1-3;R.B.X:=X1+7;
-  Insert(New(PButton, Init(R, '~E~dit', cmEditBreakpoint, bfNormal)));
+  New(Btn, Init(R, '~E~dit', cmEditBreakpoint, bfNormal));
+  Btn^.GrowMode:=gfGrowLoY+gfGrowHiY;
+  Insert(Btn);
   X1:=X1+X;
   X1:=X1+X;
   R.A.X:=X1-3;R.B.X:=X1+7;
   R.A.X:=X1-3;R.B.X:=X1+7;
-  Insert(New(PButton, Init(R, '~D~elete', cmDeleteBreakpoint, bfNormal)));
+  New(Btn, Init(R, '~D~elete', cmDeleteBreakpoint, bfNormal));
+  Btn^.GrowMode:=gfGrowLoY+gfGrowHiY;
+  Insert(Btn);
   BreakLB^.Select;
   BreakLB^.Select;
   Update;
   Update;
   BreakpointsWindow:=@self;
   BreakpointsWindow:=@self;
@@ -2731,10 +2740,10 @@ end;
        p,po : pchar;
        p,po : pchar;
        p1 : pchar;
        p1 : pchar;
     {$ifndef NODEBUG}
     {$ifndef NODEBUG}
-       reg,value : string;
+{       reg,value : string;
        buffer : array[0..255] of char;
        buffer : array[0..255] of char;
        v : dword;
        v : dword;
-       code : word;
+       code : word;}
     {$endif}
     {$endif}
 
 
     begin
     begin
@@ -2826,7 +2835,7 @@ end;
 
 
     var
     var
        rs : tfpuregs;
        rs : tfpuregs;
-       color :byte;
+{       color :byte;
 
 
     procedure SetColor(x,y : longint);
     procedure SetColor(x,y : longint);
     begin
     begin
@@ -2834,7 +2843,7 @@ end;
         color:=7
         color:=7
       else
       else
         color:=8;
         color:=8;
-    end;
+    end;}
 
 
     begin
     begin
        inherited draw;
        inherited draw;
@@ -3331,7 +3340,10 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.58  2000-03-21 23:32:38  pierre
+  Revision 1.59  2000-04-18 11:42:36  pierre
+   lot of Gabor changes : see fixes.txt
+
+  Revision 1.58  2000/03/21 23:32:38  pierre
    adapted to wcedit addition by Gabor
    adapted to wcedit addition by Gabor
 
 
   Revision 1.57  2000/03/14 14:22:30  pierre
   Revision 1.57  2000/03/14 14:22:30  pierre

+ 20 - 4
ide/text/fpdesk.pas

@@ -45,7 +45,7 @@ implementation
 uses Dos,
 uses Dos,
      Objects,Drivers,Video,
      Objects,Drivers,Video,
      Views,App,HistList,BrowCol,
      Views,App,HistList,BrowCol,
-     WResource,WViews,WEditor,
+     WResourc,WViews,WEditor,
      WUtils,
      WUtils,
 {$ifndef NODEBUG}
 {$ifndef NODEBUG}
      fpdebug,
      fpdebug,
@@ -259,7 +259,6 @@ end;
 function ReadOpenWindows(F: PResourceFile): boolean;
 function ReadOpenWindows(F: PResourceFile): boolean;
 var S: PMemoryStream;
 var S: PMemoryStream;
     OK: boolean;
     OK: boolean;
-    R : TRect;
     W: word;
     W: word;
     WI: TWindowInfo;
     WI: TWindowInfo;
     Title: string;
     Title: string;
@@ -406,6 +405,11 @@ begin
      (P^.HelpCtx=hcASCIITableWindow)
      (P^.HelpCtx=hcASCIITableWindow)
    then
    then
      W:=PWindow(P);
      W:=PWindow(P);
+
+  if Assigned(W) and (P^.HelpCtx=hcSourceWindow) then
+    if SW^.Editor^.FileName='' then
+      W:=nil;
+
   if W=nil then Exit;
   if W=nil then Exit;
   FillChar(WI,sizeof(WI),0);
   FillChar(WI,sizeof(WI),0);
   Title:=W^.GetTitle(255);
   Title:=W^.GetTitle(255);
@@ -458,6 +462,12 @@ begin
       PutSubViewPtr(S^,ASCIIChart);
       PutSubViewPtr(S^,ASCIIChart);
       PutSubViewPtr(S^,MessagesWindow);
       PutSubViewPtr(S^,MessagesWindow);
     end;}
     end;}
+{    PV:=Application^.Last;
+    while PV<>nil do
+    begin
+      CollectInfo(PV);
+      PV:=PV^.PrevView;
+    end;}
     PV:=Desktop^.Last;
     PV:=Desktop^.Last;
     while PV<>nil do
     while PV<>nil do
     begin
     begin
@@ -671,7 +681,10 @@ begin
     VOK:=ReadVideoMode(F,VM);
     VOK:=ReadVideoMode(F,VM);
     if VOK and ((VM.Col<>ScreenMode.Col) or
     if VOK and ((VM.Col<>ScreenMode.Col) or
        (VM.Row<>ScreenMode.Row) or (VM.Color<>ScreenMode.Color)) then
        (VM.Row<>ScreenMode.Row) or (VM.Color<>ScreenMode.Color)) then
-      Application^.SetScreenVideoMode(VM);
+      begin
+        if Assigned(Application) then
+          Application^.SetScreenVideoMode(VM);
+      end;
     if ((DesktopFileFlags and dfHistoryLists)<>0) then
     if ((DesktopFileFlags and dfHistoryLists)<>0) then
       OK:=OK and ReadHistory(F);
       OK:=OK and ReadHistory(F);
     if ((DesktopFileFlags and dfWatches)<>0) then
     if ((DesktopFileFlags and dfWatches)<>0) then
@@ -779,7 +792,10 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.25  2000-03-21 23:32:05  pierre
+  Revision 1.26  2000-04-18 11:42:36  pierre
+   lot of Gabor changes : see fixes.txt
+
+  Revision 1.25  2000/03/21 23:32:05  pierre
    adapted to wcedit addition by Gabor
    adapted to wcedit addition by Gabor
 
 
   Revision 1.24  2000/03/20 19:19:46  pierre
   Revision 1.24  2000/03/20 19:19:46  pierre

+ 70 - 5
ide/text/fpide.pas

@@ -131,6 +131,8 @@ type
       procedure UpdateTools;
       procedure UpdateTools;
     end;
     end;
 
 
+procedure PutEvent(TargetView: PView; E: TEvent);
+procedure PutCommand(TargetView: PView; What, Command: Word; InfoPtr: Pointer);
 
 
 var
 var
   IDEApp: TIDEApp;
   IDEApp: TIDEApp;
@@ -156,6 +158,61 @@ uses
   FPTemplt,FPCalc,FPUsrScr,FPTools,{$ifndef NODEBUG}FPDebug,{$endif}FPRedir,
   FPTemplt,FPCalc,FPUsrScr,FPTools,{$ifndef NODEBUG}FPDebug,{$endif}FPRedir,
   FPDesk,FPCodCmp,FPCodTmp;
   FPDesk,FPCodCmp,FPCodTmp;
 
 
+type
+   TTargetedEvent = record
+     Target: PView;
+     Event: TEvent;
+   end;
+
+const
+     TargetedEventHead   : integer = 0;
+     TargetedEventTail   : integer = 0;
+var
+     TargetedEvents      : array[0..10] of TTargetedEvent;
+
+function IncTargetedEventPtr(I: integer): integer;
+begin
+  Inc(I);
+  if I>High(TargetedEvents) then I:=Low(TargetedEvents);
+  IncTargetedEventPtr:=I;
+end;
+
+procedure PutEvent(TargetView: PView; E: TEvent);
+begin
+  if IncTargetedEventPtr(TargetedEventHead)=TargetedEventTail then Exit;
+  with TargetedEvents[TargetedEventHead] do
+  begin
+    Target:=TargetView;
+    Event:=E;
+  end;
+  TargetedEventHead:=IncTargetedEventPtr(TargetedEventHead);
+end;
+
+procedure PutCommand(TargetView: PView; What, Command: Word; InfoPtr: Pointer);
+var E: TEvent;
+begin
+  FillChar(E,Sizeof(E),0);
+  E.What:=What;
+  E.Command:=Command;
+  E.InfoPtr:=InfoPtr;
+  PutEvent(TargetView,E);
+end;
+
+function GetTargetedEvent(var P: PView; var E: TEvent): boolean;
+var OK: boolean;
+begin
+  OK:=TargetedEventHead<>TargetedEventTail;
+  if OK then
+  begin
+    with TargetedEvents[TargetedEventTail] do
+    begin
+      P:=Target;
+      E:=Event;
+    end;
+    TargetedEventTail:=IncTargetedEventPtr(TargetedEventTail);
+  end;
+  GetTargetedEvent:=OK;
+end;
 
 
 function IDEUseSyntaxHighlight(Editor: PFileEditor): boolean; {$ifndef FPC}far;{$endif}
 function IDEUseSyntaxHighlight(Editor: PFileEditor): boolean; {$ifndef FPC}far;{$endif}
 begin
 begin
@@ -185,6 +242,7 @@ begin
   InsideDone:=false;
   InsideDone:=false;
   MenuBar^.GetBounds(R); R.A.X:=R.B.X-8;
   MenuBar^.GetBounds(R); R.A.X:=R.B.X-8;
   New(ClockView, Init(R));
   New(ClockView, Init(R));
+  ClockView^.GrowMode:=gfGrowLoX+gfGrowHiX;
   Application^.Insert(ClockView);
   Application^.Insert(ClockView);
   New(ClipboardWindow, Init);
   New(ClipboardWindow, Init);
   Desktop^.Insert(ClipboardWindow);
   Desktop^.Insert(ClipboardWindow);
@@ -437,7 +495,11 @@ begin
 end;
 end;
 
 
 procedure TIDEApp.GetEvent(var Event: TEvent);
 procedure TIDEApp.GetEvent(var Event: TEvent);
+var P: PView;
 begin
 begin
+  { first of all dispatch queued targeted events }
+  while GetTargetedEvent(P,Event) do
+    P^.HandleEvent(Event);
   inherited GetEvent(Event);
   inherited GetEvent(Event);
   if Event.What<>evNothing then
   if Event.What<>evNothing then
     LastEvent:=GetDosTicks
     LastEvent:=GetDosTicks
@@ -773,10 +835,10 @@ end;
 
 
 procedure TIDEApp.UpdateRecentFileList;
 procedure TIDEApp.UpdateRecentFileList;
 var P: PMenuItem;
 var P: PMenuItem;
-    ID,I: word;
+    {ID,}I: word;
     FileMenu: PMenuItem;
     FileMenu: PMenuItem;
 begin
 begin
-  ID:=cmRecentFileBase;
+{  ID:=cmRecentFileBase;}
   FileMenu:=SearchSubMenu(MenuBar^.Menu,menuFile);
   FileMenu:=SearchSubMenu(MenuBar^.Menu,menuFile);
   repeat
   repeat
 {    Inc(ID);
 {    Inc(ID);
@@ -813,12 +875,12 @@ end;
 
 
 procedure TIDEApp.UpdateTools;
 procedure TIDEApp.UpdateTools;
 var P: PMenuItem;
 var P: PMenuItem;
-    ID,I: word;
+{    ID,}I: word;
     ToolsMenu: PMenuItem;
     ToolsMenu: PMenuItem;
     S1,S2,S3: string;
     S1,S2,S3: string;
     W: word;
     W: word;
 begin
 begin
-  ID:=cmToolsBase;
+{  ID:=cmToolsBase;}
   ToolsMenu:=SearchSubMenu(MenuBar^.Menu,menuTools);
   ToolsMenu:=SearchSubMenu(MenuBar^.Menu,menuTools);
   repeat
   repeat
     P:=GetMenuItemBefore(ToolsMenu^.SubMenu,nil);
     P:=GetMenuItemBefore(ToolsMenu^.SubMenu,nil);
@@ -927,7 +989,10 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.56  2000-03-21 23:30:49  pierre
+  Revision 1.57  2000-04-18 11:42:37  pierre
+   lot of Gabor changes : see fixes.txt
+
+  Revision 1.56  2000/03/21 23:30:49  pierre
    adapted to wcedit addition by Gabor
    adapted to wcedit addition by Gabor
 
 
   Revision 1.55  2000/03/13 20:41:35  pierre
   Revision 1.55  2000/03/13 20:41:35  pierre

+ 6 - 3
ide/text/fpmrun.inc

@@ -242,7 +242,7 @@ procedure TIDEApp.DoToggleBreak;
 var
 var
   W : PSourceWindow;
   W : PSourceWindow;
   FileName : string;
   FileName : string;
-  b : boolean;
+{  b : boolean;}
   LineNr : longint;
   LineNr : longint;
 {$endif}
 {$endif}
 begin
 begin
@@ -259,7 +259,7 @@ begin
     begin
     begin
       FileName:=W^.Editor^.FileName;
       FileName:=W^.Editor^.FileName;
       LineNr:=W^.Editor^.CurPos.Y+1;
       LineNr:=W^.Editor^.CurPos.Y+1;
-      b:=BreakpointsCollection^.ToggleFileLine(FileName,LineNr);
+{      b:=}BreakpointsCollection^.ToggleFileLine(FileName,LineNr);
       {W^.Editor^.SetLineBreakState(LineNr,b);
       {W^.Editor^.SetLineBreakState(LineNr,b);
         already done PM }
         already done PM }
     end;
     end;
@@ -270,7 +270,10 @@ end;
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.30  2000-03-21 23:27:35  pierre
+  Revision 1.31  2000-04-18 11:42:37  pierre
+   lot of Gabor changes : see fixes.txt
+
+  Revision 1.30  2000/03/21 23:27:35  pierre
    Gabor fixes to avoid unused vars
    Gabor fixes to avoid unused vars
 
 
   Revision 1.29  2000/03/08 16:58:12  pierre
   Revision 1.29  2000/03/08 16:58:12  pierre

+ 8 - 2
ide/text/fpmwnd.inc

@@ -111,7 +111,10 @@ end;
 procedure TWindowListDialog.UpdateList;
 procedure TWindowListDialog.UpdateList;
 procedure AddIt(P: PView); {$ifndef FPC}far;{$endif}
 procedure AddIt(P: PView); {$ifndef FPC}far;{$endif}
 begin
 begin
-  if (P<>pointer(Desktop^.Background)) and (P^.GetState(sfVisible)) then
+  if (P<>pointer(Desktop^.Background)) and
+     (P^.GetState(sfDisabled)=false) and
+     ((P^.Options and ofSelectable)<>0) and
+     (P^.GetState(sfVisible)) then
      C^.Insert(P);
      C^.Insert(P);
 end;
 end;
 begin
 begin
@@ -165,7 +168,10 @@ end;
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.15  2000-03-07 21:51:52  pierre
+  Revision 1.16  2000-04-18 11:42:37  pierre
+   lot of Gabor changes : see fixes.txt
+
+  Revision 1.15  2000/03/07 21:51:52  pierre
    * Reconginze UserScreenWindow
    * Reconginze UserScreenWindow
 
 
   Revision 1.14  2000/01/28 22:36:46  pierre
   Revision 1.14  2000/01/28 22:36:46  pierre

+ 5 - 2
ide/text/fpstring.pas

@@ -59,7 +59,7 @@ unit fpstring;
       menu_search_objects    = '~O~bjects';
       menu_search_objects    = '~O~bjects';
       menu_search_modules    = 'Mod~u~les';
       menu_search_modules    = 'Mod~u~les';
       menu_search_globals    = 'G~l~obals';
       menu_search_globals    = 'G~l~obals';
-      menu_search_symbol     = 'S~y~mbol';
+      menu_search_symbol     = 'S~y~mbol...';
 
 
       menu_run               = '~R~un';
       menu_run               = '~R~un';
       menu_run_run           = '~R~un';
       menu_run_run           = '~R~un';
@@ -222,7 +222,10 @@ unit fpstring;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.2  2000-02-07 08:29:13  michael
+  Revision 1.3  2000-04-18 11:42:37  pierre
+   lot of Gabor changes : see fixes.txt
+
+  Revision 1.2  2000/02/07 08:29:13  michael
   [*] the fake (!) TOKENS.PAS still contained the typo bug
   [*] the fake (!) TOKENS.PAS still contained the typo bug
        FSplit(,n,d,e) (correctly FSplit(,d,n,e))
        FSplit(,n,d,e) (correctly FSplit(,d,n,e))
   [*] CodeComplete had a very ugly bug - coordinates were document-relative
   [*] CodeComplete had a very ugly bug - coordinates were document-relative

+ 226 - 42
ide/text/fpsymbol.pas

@@ -13,12 +13,14 @@
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 
  **********************************************************************}
  **********************************************************************}
+{$i globdir.inc}
 unit FPSymbol;
 unit FPSymbol;
 
 
 interface
 interface
 
 
-uses Objects,Drivers,Views,Dialogs,Outline,
+uses Objects,Drivers,Views,Menus,Dialogs,Outline,
      BrowCol,
      BrowCol,
+     WViews,
      FPViews;
      FPViews;
 
 
 const
 const
@@ -53,15 +55,23 @@ type
 
 
 
 
     PSymbolView = ^TSymbolView;
     PSymbolView = ^TSymbolView;
-    TSymbolView = object(TListBox)
+    TSymbolView = object(TLocalMenuListBox)
       constructor  Init(var Bounds: TRect; AHScrollBar, AVScrollBar: PScrollBar);
       constructor  Init(var Bounds: TRect; AHScrollBar, AVScrollBar: PScrollBar);
       procedure    HandleEvent(var Event: TEvent); virtual;
       procedure    HandleEvent(var Event: TEvent); virtual;
-      procedure    GotoItem(Item: sw_integer); virtual;
-      procedure    TrackItem(Item: sw_integer); virtual;
+      procedure    SetState(AState: Word; Enable: Boolean); virtual;
+      function     GotoItem(Item: sw_integer): boolean; virtual;
+      function     TrackItem(Item: sw_integer; AutoTrack: boolean): boolean; virtual;
       function     GetPalette: PPalette; virtual;
       function     GetPalette: PPalette; virtual;
+      function     GetLocalMenu: PMenu; virtual;
+      procedure    ClearHighlights;
+      procedure    AutoTrackSource; virtual;
+      procedure    Browse; virtual;
+      procedure    GotoSource; virtual;
+      procedure    TrackSource; virtual;
+      procedure    OptionsDlg; virtual;
     private
     private
       MyBW         : PBrowserWindow;
       MyBW         : PBrowserWindow;
-      function     TrackReference(R: PReference): boolean; virtual;
+      function     TrackReference(R: PReference; AutoTrack: boolean): boolean; virtual;
       function     GotoReference(R: PReference): boolean; virtual;
       function     GotoReference(R: PReference): boolean; virtual;
     end;
     end;
 
 
@@ -74,8 +84,8 @@ type
       procedure   HandleEvent(var Event: TEvent); virtual;
       procedure   HandleEvent(var Event: TEvent); virtual;
       procedure   Draw; virtual;
       procedure   Draw; virtual;
       procedure   LookUp(S: string); virtual;
       procedure   LookUp(S: string); virtual;
-      procedure   GotoItem(Item: sw_integer); virtual;
-      procedure   TrackItem(Item: sw_integer); virtual;
+      function    GotoItem(Item: sw_integer): boolean; virtual;
+      function    TrackItem(Item: sw_integer; AutoTrack: boolean): boolean; virtual;
     private
     private
       Symbols: PSymbolCollection;
       Symbols: PSymbolCollection;
       SymbolsValue : PGDBValueCollection;
       SymbolsValue : PGDBValueCollection;
@@ -89,8 +99,9 @@ type
       procedure   HandleEvent(var Event: TEvent); virtual;
       procedure   HandleEvent(var Event: TEvent); virtual;
       function    GetText(Item,MaxLen: Sw_Integer): String; virtual;
       function    GetText(Item,MaxLen: Sw_Integer): String; virtual;
       procedure   SelectItem(Item: Sw_Integer); virtual;
       procedure   SelectItem(Item: Sw_Integer); virtual;
-      procedure   GotoItem(Item: sw_integer); virtual;
-      procedure   TrackItem(Item: sw_integer); virtual;
+      function    GotoItem(Item: sw_integer): boolean; virtual;
+      function    TrackItem(Item: sw_integer; AutoTrack: boolean): boolean; virtual;
+      procedure   Browse; virtual;
     private
     private
       References: PReferenceCollection;
       References: PReferenceCollection;
     end;
     end;
@@ -118,6 +129,7 @@ type
       procedure    Adjust(Node: Pointer; Expand: Boolean); virtual;
       procedure    Adjust(Node: Pointer; Expand: Boolean); virtual;
       function     IsExpanded(Node: Pointer): Boolean; virtual;
       function     IsExpanded(Node: Pointer): Boolean; virtual;
       procedure    Selected(I: Integer); virtual;
       procedure    Selected(I: Integer); virtual;
+      procedure    HandleEvent(var Event: TEvent); virtual;
       function     GetPalette: PPalette; virtual;
       function     GetPalette: PPalette; virtual;
     private
     private
       Root         : PObjectSymbol;
       Root         : PObjectSymbol;
@@ -194,8 +206,8 @@ uses Commands,App,
 {$ifdef BROWSERCOL}
 {$ifdef BROWSERCOL}
      symconst,
      symconst,
 {$endif BROWSERCOL}
 {$endif BROWSERCOL}
-     WEditor,WViews,WUtils,
-     FPConst,FPUtils,FPVars,{$ifndef FPDEBUG}FPDebug{$endif};
+     WUtils,WEditor,
+     FPConst,FPUtils,FPVars,{$ifndef FPDEBUG}FPDebug{$endif},FPIDE;
 
 
 procedure CloseAllBrowsers;
 procedure CloseAllBrowsers;
   procedure SendCloseIfBrowser(P: PView); {$ifndef FPC}far;{$endif}
   procedure SendCloseIfBrowser(P: PView); {$ifndef FPC}far;{$endif}
@@ -438,6 +450,7 @@ end;
 
 
 procedure TGDBValue.GetValue;
 procedure TGDBValue.GetValue;
 begin
 begin
+{$ifdef BROWSERCOL}
 {$ifndef NODEBUG}
 {$ifndef NODEBUG}
   if not assigned(Debugger) then
   if not assigned(Debugger) then
     exit;
     exit;
@@ -453,6 +466,7 @@ begin
       GDBI:=Debugger^.RunCount;
       GDBI:=Debugger^.RunCount;
     end;
     end;
 {$endif ndef NODEBUG}
 {$endif ndef NODEBUG}
+{$endif BROWSERCOL}
 end;
 end;
 
 
 function TGDBValue.GetText : String;
 function TGDBValue.GetText : String;
@@ -483,6 +497,54 @@ begin
   if assigned(HScrollBar) then
   if assigned(HScrollBar) then
     HScrollBar^.SetRange(1,80);
     HScrollBar^.SetRange(1,80);
   Options:=Options or (ofSelectable+ofTopSelect);
   Options:=Options or (ofSelectable+ofTopSelect);
+  EventMask:=EventMask or evBroadcast;
+end;
+
+procedure TSymbolView.ClearHighlights;
+begin
+  Message(Desktop,evBroadcast,cmClearLineHighlights,nil);
+end;
+
+procedure TSymbolView.AutoTrackSource;
+begin
+  if Range>0 then
+    TrackSource;
+end;
+
+procedure TSymbolView.OptionsDlg;
+begin
+  { Abstract }
+end;
+
+procedure TSymbolView.SetState(AState: Word; Enable: Boolean);
+var OState: longint;
+begin
+  OState:=State;
+  inherited SetState(AState,Enable);
+  if ((OState xor State) and sfFocused)<>0 then
+    if GetState(sfFocused) then
+      begin
+        if (MiscOptions and moAutoTrackSource)<>0 then
+          AutoTrackSource;
+      end
+    else
+      Message(Desktop,evBroadcast,cmClearLineHighlights,nil);
+end;
+
+procedure TSymbolView.Browse;
+begin
+  SelectItem(Focused);
+end;
+
+procedure TSymbolView.GotoSource;
+begin
+  if GotoItem(Focused) then
+    PutCommand(Owner,evCommand,cmClose,nil);
+end;
+
+procedure TSymbolView.TrackSource;
+begin
+  TrackItem(Focused,false);
 end;
 end;
 
 
 procedure TSymbolView.HandleEvent(var Event: TEvent);
 procedure TSymbolView.HandleEvent(var Event: TEvent);
@@ -494,9 +556,11 @@ begin
         DontClear:=false;
         DontClear:=false;
         case Event.KeyCode of
         case Event.KeyCode of
           kbEnter :
           kbEnter :
-            GotoItem(Focused);
+            Browse;
+          kbCtrlEnter :
+            GotoSource;
           kbSpaceBar :
           kbSpaceBar :
-            TrackItem(Focused);
+            TrackSource;
           kbRight,kbLeft :
           kbRight,kbLeft :
             if HScrollBar<>nil then
             if HScrollBar<>nil then
               HScrollBar^.HandleEvent(Event);
               HScrollBar^.HandleEvent(Event);
@@ -505,8 +569,37 @@ begin
         if DontClear=false then ClearEvent(Event);
         if DontClear=false then ClearEvent(Event);
       end;
       end;
     evMouseDown :
     evMouseDown :
-      if Event.double then
-        GotoItem(Focused);
+      begin
+        if Event.double then
+          begin
+            Browse;
+            ClearEvent(Event);
+          end;
+      end;
+    evCommand :
+      begin
+        DontClear:=false;
+        case Event.Command of
+          cmSymBrowse :
+            Browse;
+          cmSymGotoSource :
+            GotoSource;
+          cmSymTrackSource :
+            TrackSource;
+          cmSymOptions :
+            OptionsDlg;
+        else DontClear:=true;
+        end;
+        if DontClear=false then ClearEvent(Event);
+      end;
+    evBroadcast :
+      case Event.Command of
+        cmListFocusChanged :
+         if Event.InfoPtr=@Self then
+          if (MiscOptions and moAutoTrackSource)<>0 then
+            if GetState(sfFocused) then
+              AutoTrackSource;
+      end;
   end;
   end;
   inherited HandleEvent(Event);
   inherited HandleEvent(Event);
 end;
 end;
@@ -518,14 +611,27 @@ begin
   GetPalette:=@P;
   GetPalette:=@P;
 end;
 end;
 
 
-procedure TSymbolView.GotoItem(Item: sw_integer);
+function TSymbolView.GetLocalMenu: PMenu;
+begin
+  GetLocalMenu:=NewMenu(
+    NewItem('~B~rowse','',kbNoKey,cmSymBrowse,hcSymBrowse,
+    NewItem('~G~oto source','',kbNoKey,cmSymGotoSource,hcSymGotoSource,
+    NewItem('~T~rack source','',kbNoKey,cmSymTrackSource,hcSymTrackSource,
+    NewLine(
+    NewItem('~O~ptions...','',kbNoKey,cmSymOptions,hcSymOptions,
+    nil))))));
+end;
+
+function TSymbolView.GotoItem(Item: sw_integer): boolean;
 begin
 begin
   SelectItem(Item);
   SelectItem(Item);
+  GotoItem:=true;
 end;
 end;
 
 
-procedure TSymbolView.TrackItem(Item: sw_integer);
+function TSymbolView.TrackItem(Item: sw_integer; AutoTrack: boolean): boolean;
 begin
 begin
   SelectItem(Item);
   SelectItem(Item);
+  TrackItem:=true;
 end;
 end;
 
 
 function LastBrowserWindow: PBrowserWindow;
 function LastBrowserWindow: PBrowserWindow;
@@ -541,15 +647,18 @@ begin
   LastBrowserWindow:=BW;
   LastBrowserWindow:=BW;
 end;
 end;
 
 
-function TSymbolView.TrackReference(R: PReference): boolean;
+function TSymbolView.TrackReference(R: PReference; AutoTrack: boolean): boolean;
 var W: PSourceWindow;
 var W: PSourceWindow;
     BW: PBrowserWindow;
     BW: PBrowserWindow;
     P: TPoint;
     P: TPoint;
 begin
 begin
-  Message(Desktop,evBroadcast,cmClearLineHighlights,nil);
+  ClearHighlights;
   Desktop^.Lock;
   Desktop^.Lock;
   P.X:=R^.Position.X-1; P.Y:=R^.Position.Y-1;
   P.X:=R^.Position.X-1; P.Y:=R^.Position.Y-1;
-  W:=TryToOpenFile(nil,R^.GetFileName,P.X,P.Y,true);
+  if AutoTrack then
+    W:=SearchOnDesktop(R^.GetFileName,false)
+  else
+    W:=TryToOpenFile(nil,R^.GetFileName,P.X,P.Y,true);
   if W<>nil then
   if W<>nil then
   begin
   begin
     BW:=LastBrowserWindow;
     BW:=LastBrowserWindow;
@@ -563,6 +672,8 @@ begin
     W^.Editor^.SetLineFlagExclusive(lfHighlightRow,P.Y);
     W^.Editor^.SetLineFlagExclusive(lfHighlightRow,P.Y);
   end;
   end;
   Desktop^.UnLock;
   Desktop^.UnLock;
+  if Assigned(W)=false then
+    ErrorBox('Can''t find '+R^.GetFileName,nil);
   TrackReference:=W<>nil;
   TrackReference:=W<>nil;
 end;
 end;
 
 
@@ -571,8 +682,11 @@ var W: PSourceWindow;
 begin
 begin
   Desktop^.Lock;
   Desktop^.Lock;
   W:=TryToOpenFile(nil,R^.GetFileName,R^.Position.X-1,R^.Position.Y-1,true);
   W:=TryToOpenFile(nil,R^.GetFileName,R^.Position.X-1,R^.Position.Y-1,true);
-  if W<>nil then W^.Select;
+  if Assigned(W) then
+    W^.Select;
   Desktop^.UnLock;
   Desktop^.UnLock;
+  if Assigned(W)=false then
+    ErrorBox('Can''t find '+R^.GetFileName,nil);
   GotoReference:=W<>nil;
   GotoReference:=W<>nil;
 end;
 end;
 
 
@@ -651,18 +765,34 @@ begin
   DrawView;
   DrawView;
 end;
 end;
 
 
-procedure TSymbolScopeView.GotoItem(Item: sw_integer);
+function TSymbolScopeView.GotoItem(Item: sw_integer): boolean;
+var S: PSymbol;
+    OK: boolean;
 begin
 begin
-  SelectItem(Item);
+  OK:=Range>0;
+  if OK then
+  begin
+    S:=List^.At(Item);
+    OK:=(S^.References<>nil) and (S^.References^.Count>0);
+    if OK then
+      OK:=GotoReference(S^.References^.At(0));
+  end;
+  GotoItem:=OK;
 end;
 end;
 
 
-procedure TSymbolScopeView.TrackItem(Item: sw_integer);
+function TSymbolScopeView.TrackItem(Item: sw_integer; AutoTrack: boolean): boolean;
 var S: PSymbol;
 var S: PSymbol;
+    OK: boolean;
 begin
 begin
-  if Range=0 then Exit;
-  S:=List^.At(Item);
-  if (S^.References<>nil) and (S^.References^.Count>0) then
-    TrackReference(S^.References^.At(0));
+  OK:=Range>0;
+  if OK then
+  begin
+    S:=List^.At(Item);
+    OK:=(S^.References<>nil) and (S^.References^.Count>0);
+    if OK then
+      OK:=TrackReference(S^.References^.At(0),AutoTrack);
+  end;
+  TrackItem:=OK;
 end;
 end;
 
 
 procedure TSymbolScopeView.SetGDBCol;
 procedure TSymbolScopeView.SetGDBCol;
@@ -714,11 +844,32 @@ end;
 
 
 procedure TSymbolReferenceView.HandleEvent(var Event: TEvent);
 procedure TSymbolReferenceView.HandleEvent(var Event: TEvent);
 var OldFocus: sw_integer;
 var OldFocus: sw_integer;
+    DontClear: boolean;
 begin
 begin
   OldFocus:=Focused;
   OldFocus:=Focused;
+{  case Event.What of
+    evKeyDown :
+      begin
+        DontClear:=false;
+        case Event.KeyCode of
+          kbEnter :
+            TrackItem(Focused,false);
+          kbCtrlEnter :
+            GotoItem(Focused);
+        else DontClear:=true;
+        end;
+        if DontClear=false then ClearEvent(Event);
+      end;
+  end;}
   inherited HandleEvent(Event);
   inherited HandleEvent(Event);
   if OldFocus<>Focused then
   if OldFocus<>Focused then
-    Message(Desktop,evBroadcast,cmClearLineHighlights,nil);
+   if (MiscOptions and moAutoTrackSource)=0 then
+    ClearHighlights;
+end;
+
+procedure TSymbolReferenceView.Browse;
+begin
+  { do nothing here }
 end;
 end;
 
 
 function TSymbolReferenceView.GetText(Item,MaxLen: Sw_Integer): String;
 function TSymbolReferenceView.GetText(Item,MaxLen: Sw_Integer): String;
@@ -730,16 +881,22 @@ begin
   GetText:=copy(S,1,MaxLen);
   GetText:=copy(S,1,MaxLen);
 end;
 end;
 
 
-procedure TSymbolReferenceView.GotoItem(Item: sw_integer);
+function TSymbolReferenceView.GotoItem(Item: sw_integer): boolean;
+var OK: boolean;
 begin
 begin
-  if Range=0 then Exit;
-  GotoReference(List^.At(Item));
+  OK:=Range>0;
+  if OK then
+    OK:=GotoReference(List^.At(Item));
+  GotoItem:=OK;
 end;
 end;
 
 
-procedure TSymbolReferenceView.TrackItem(Item: sw_integer);
+function TSymbolReferenceView.TrackItem(Item: sw_integer; AutoTrack: boolean): boolean;
+var OK: boolean;
 begin
 begin
-  if Range=0 then Exit;
-  TrackReference(List^.At(Item));
+  OK:=Range>0;
+  if OK then
+    OK:=TrackReference(List^.At(Item),AutoTrack);
+  TrackItem:=OK;
 end;
 end;
 
 
 procedure TSymbolReferenceView.SelectItem(Item: Sw_Integer);
 procedure TSymbolReferenceView.SelectItem(Item: Sw_Integer);
@@ -856,6 +1013,28 @@ begin
   IsExpanded:=PObjectSymbol(Node)^.Expanded;
   IsExpanded:=PObjectSymbol(Node)^.Expanded;
 end;
 end;
 
 
+procedure TSymbolInheritanceView.HandleEvent(var Event: TEvent);
+var DontClear: boolean;
+begin
+  case Event.What of
+    evKeyDown :
+      begin
+        DontClear:=false;
+        case Event.KeyCode of
+          kbLeft,kbRight,
+          kbCtrlLeft,kbCtrlRight :
+            if Assigned(HScrollBar) then
+              HScrollBar^.HandleEvent(Event)
+            else
+              DontClear:=true;
+        else DontClear:=true;
+        end;
+        if DontClear=false then ClearEvent(Event);
+      end;
+  end;
+  inherited HandleEvent(Event);
+end;
+
 function TSymbolInheritanceView.GetPalette: PPalette;
 function TSymbolInheritanceView.GetPalette: PPalette;
 const P: string[length(CBrowserOutline)] = CBrowserOutline;
 const P: string[length(CBrowserOutline)] = CBrowserOutline;
 begin
 begin
@@ -1005,6 +1184,7 @@ begin
         DontClear:=false; Idx:=-1;
         DontClear:=false; Idx:=-1;
         for I:=0 to GetItemCount-1 do
         for I:=0 to GetItemCount-1 do
           if GetCtrlCode(GetItem(I)^.Sign)=Event.KeyCode then
           if GetCtrlCode(GetItem(I)^.Sign)=Event.KeyCode then
+           if (Flags and (1 shl I))<>0 then
             begin
             begin
               Idx:=I;
               Idx:=I;
               Break;
               Break;
@@ -1097,7 +1277,9 @@ begin
     end;
     end;
   if assigned(AInheritance) then
   if assigned(AInheritance) then
     begin
     begin
-      New(InheritanceView, Init(R, nil,nil, AInheritance));
+      HSB:=CreateHSB(R); Insert(HSB);
+      VSB:=CreateVSB(R); Insert(VSB);
+      New(InheritanceView, Init(R, HSB,VSB, AInheritance));
       InheritanceView^.GrowMode:=gfGrowHiX+gfGrowHiY;
       InheritanceView^.GrowMode:=gfGrowHiX+gfGrowHiY;
       Insert(InheritanceView);
       Insert(InheritanceView);
       InheritanceView^.MyBW:=@Self;
       InheritanceView^.MyBW:=@Self;
@@ -1220,18 +1402,17 @@ begin
 end;
 end;
 
 
 procedure TBrowserWindow.SetState(AState: Word; Enable: Boolean);
 procedure TBrowserWindow.SetState(AState: Word; Enable: Boolean);
-var OldState: word;
+{var OldState: word;}
 begin
 begin
-  OldState:=State;
+{  OldState:=State;}
   inherited SetState(AState,Enable);
   inherited SetState(AState,Enable);
-  if ((State xor OldState) and sfActive)<>0 then
+{  if ((State xor OldState) and sfActive)<>0 then
     if GetState(sfActive)=false then
     if GetState(sfActive)=false then
-      Message(Desktop,evBroadcast,cmClearLineHighlights,nil);
+      Message(Desktop,evBroadcast,cmClearLineHighlights,nil);}
 end;
 end;
 
 
 procedure TBrowserWindow.Close;
 procedure TBrowserWindow.Close;
 begin
 begin
-  Message(Desktop,evBroadcast,cmClearLineHighlights,nil);
   inherited Close;
   inherited Close;
 end;
 end;
 
 
@@ -1370,7 +1551,10 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.24  2000-03-21 23:26:55  pierre
+  Revision 1.25  2000-04-18 11:42:37  pierre
+   lot of Gabor changes : see fixes.txt
+
+  Revision 1.24  2000/03/21 23:26:55  pierre
    adapted to wcedit addition
    adapted to wcedit addition
 
 
   Revision 1.23  2000/03/15 10:29:03  pierre
   Revision 1.23  2000/03/15 10:29:03  pierre

+ 5 - 2
ide/text/fptools.pas

@@ -105,7 +105,7 @@ type
     PMessagesWindow = ^TMessagesWindow;
     PMessagesWindow = ^TMessagesWindow;
     TMessagesWindow = object(TFPWindow)
     TMessagesWindow = object(TFPWindow)
       constructor Init;
       constructor Init;
-      procedure   Update; {virtual;}
+      procedure   Update; virtual;
       procedure   HandleEvent(var Event: TEvent); virtual;
       procedure   HandleEvent(var Event: TEvent); virtual;
       function    GetPalette: PPalette; virtual;
       function    GetPalette: PPalette; virtual;
       constructor Load(var S: TStream);
       constructor Load(var S: TStream);
@@ -1507,7 +1507,10 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.16  2000-03-13 20:31:54  pierre
+  Revision 1.17  2000-04-18 11:42:37  pierre
+   lot of Gabor changes : see fixes.txt
+
+  Revision 1.16  2000/03/13 20:31:54  pierre
    * INIPath removed
    * INIPath removed
 
 
   Revision 1.15  2000/02/07 12:00:41  pierre
   Revision 1.15  2000/02/07 12:00:41  pierre

+ 30 - 6
ide/text/fpusrscr.pas

@@ -13,7 +13,7 @@
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 
  **********************************************************************}
  **********************************************************************}
-
+{$i globdir.inc}
 unit FPUsrScr;
 unit FPUsrScr;
 
 
 interface
 interface
@@ -141,6 +141,9 @@ uses
     ,Go32
     ,Go32
     {$endif}
     {$endif}
   {$endif}
   {$endif}
+  {$ifdef VESA}
+    ,VESA
+  {$endif}
   ;
   ;
 
 
 function TScreen.GetWidth: integer;
 function TScreen.GetWidth: integer;
@@ -353,7 +356,11 @@ begin
   MI.Mode:=r.al;
   MI.Mode:=r.al;
   MI.Page:=r.bh;
   MI.Page:=r.bh;
   MI.Cols:=r.ah;
   MI.Cols:=r.ah;
+{$ifdef VESA}
+  VESAGetMode(MI.Mode);
+{$endif}
   MI.Rows:=MI.ScreenSize div (MI.Cols*2);
   MI.Rows:=MI.ScreenSize div (MI.Cols*2);
+  if MI.Rows=51 then MI.Rows:=50;
   r.ah:=$03;
   r.ah:=$03;
   r.bh:=MI.Page;
   r.bh:=MI.Page;
   intr($10,r);
   intr($10,r);
@@ -392,17 +399,31 @@ end;
 
 
 procedure TDOSScreen.SetVideoMode(MI: TDOSVideoInfo);
 procedure TDOSScreen.SetVideoMode(MI: TDOSVideoInfo);
 var r: registers;
 var r: registers;
+    CM: TDOSVideoInfo;
 {$ifdef TP}
 {$ifdef TP}
     P: pointer;
     P: pointer;
     Sel: longint;
     Sel: longint;
 {$I realintr.inc}
 {$I realintr.inc}
 {$endif}
 {$endif}
 begin
 begin
-  r.ah:=$0f;
-  intr($10,r);
-  if r.al<>MI.Mode then
+  FillChar(CM,sizeof(CM),0);
+  GetVideoMode(CM);
+
+  if (CM.Mode<>MI.Mode) or (CM.Cols<>MI.Cols) or (CM.Rows<>MI.Rows) then
    begin
    begin
-     r.ah:=$00; r.al:=MI.Mode; intr($10,r);
+     {$ifdef VESA}
+     if MI.Mode>=$100 then
+       VESASetMode(MI.Mode)
+     else
+     {$endif}
+       begin
+         r.ah:=$00; r.al:=MI.Mode; intr($10,r);
+       end;
+     if (MI.Mode=3) and (MI.Cols=80) and (MI.Rows=50) then
+     begin
+       r.ax:=$1112; r.bx:=$0;
+       intr($10,r);
+     end;
    end;
    end;
   r.ah:=$05; r.al:=MI.Page; intr($10,r);
   r.ah:=$05; r.al:=MI.Page; intr($10,r);
   r.ah:=$02; r.bh:=MI.Page; r.dl:=MI.CurPos.X; r.dh:=MI.CurPos.Y; intr($10,r);
   r.ah:=$02; r.bh:=MI.Page; r.dl:=MI.CurPos.X; r.dh:=MI.CurPos.Y; intr($10,r);
@@ -702,7 +723,10 @@ end;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.10  2000-03-13 20:30:37  pierre
+  Revision 1.11  2000-04-18 11:42:37  pierre
+   lot of Gabor changes : see fixes.txt
+
+  Revision 1.10  2000/03/13 20:30:37  pierre
    + stores IDE screen before Switching for DOS
    + stores IDE screen before Switching for DOS
 
 
   Revision 1.9  2000/02/04 23:17:25  pierre
   Revision 1.9  2000/02/04 23:17:25  pierre

+ 7 - 2
ide/text/fputils.pas

@@ -151,9 +151,11 @@ end;
 function FixFileName(const s:string):string;
 function FixFileName(const s:string):string;
 var
 var
   i      : longint;
   i      : longint;
+{$ifdef Linux}
   NoPath : boolean;
   NoPath : boolean;
+{$endif}
 begin
 begin
-  NoPath:=true;
+  {$ifdef Linux}NoPath:=true;{$endif}
   for i:=length(s) downto 1 do
   for i:=length(s) downto 1 do
    begin
    begin
      case s[i] of
      case s[i] of
@@ -662,7 +664,10 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.14  2000-01-03 11:38:34  michael
+  Revision 1.15  2000-04-18 11:42:37  pierre
+   lot of Gabor changes : see fixes.txt
+
+  Revision 1.14  2000/01/03 11:38:34  michael
   Changes from Gabor
   Changes from Gabor
 
 
   Revision 1.13  1999/04/15 08:58:07  peter
   Revision 1.13  1999/04/15 08:58:07  peter

+ 5 - 1
ide/text/fpvars.pas

@@ -72,6 +72,7 @@ const ClipboardWindow  : PClipboardWindow = nil;
       StartupOptions   : longint = 0;
       StartupOptions   : longint = 0;
       LastExitCode     : integer = 0;
       LastExitCode     : integer = 0;
       ASCIIChart       : PFPASCIIChart = nil;
       ASCIIChart       : PFPASCIIChart = nil;
+      BackgroundPath   : string{$ifdef GABOR}[80]{$endif} = BackgroundName;
       DesktopPath      : string{$ifdef GABOR}[80]{$endif} = DesktopName;
       DesktopPath      : string{$ifdef GABOR}[80]{$endif} = DesktopName;
       DesktopFileFlags : longint = dfHistoryLists+dfOpenWindows+
       DesktopFileFlags : longint = dfHistoryLists+dfOpenWindows+
                                    dfCodeCompleteWords+dfCodeTemplates;
                                    dfCodeCompleteWords+dfCodeTemplates;
@@ -99,7 +100,10 @@ implementation
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.30  2000-03-13 20:35:36  pierre
+  Revision 1.31  2000-04-18 11:42:37  pierre
+   lot of Gabor changes : see fixes.txt
+
+  Revision 1.30  2000/03/13 20:35:36  pierre
     * IniPath replaced by IniFileName
     * IniPath replaced by IniFileName
     + UseMouse variable
     + UseMouse variable
 
 

+ 45 - 8
ide/text/fpviews.pas

@@ -27,7 +27,7 @@ uses
 {$else}
 {$else}
   WEditor,WCEdit,
   WEditor,WCEdit,
 {$endif}
 {$endif}
-  WUtils,WHelp,WHlpView,WViews,
+  WUtils,WHelp,WHlpView,WViews,WANSI,
   Comphook,
   Comphook,
   FPConst,FPUsrScr;
   FPConst,FPUsrScr;
 
 
@@ -66,7 +66,7 @@ type
       procedure   SetState(AState: Word; Enable: Boolean); virtual;
       procedure   SetState(AState: Word; Enable: Boolean); virtual;
       constructor Load(var S: TStream);
       constructor Load(var S: TStream);
       procedure   Store(var S: TStream);
       procedure   Store(var S: TStream);
-      procedure   Update;
+      procedure   Update; virtual;
     end;
     end;
 
 
     PFPHelpViewer = ^TFPHelpViewer;
     PFPHelpViewer = ^TFPHelpViewer;
@@ -346,6 +346,8 @@ type
 
 
     PFPDesktop = ^TFPDesktop;
     PFPDesktop = ^TFPDesktop;
     TFPDesktop = object(TDesktop)
     TFPDesktop = object(TDesktop)
+      constructor Init(var Bounds: TRect);
+      procedure   InitBackground; virtual;
       constructor Load(var S: TStream);
       constructor Load(var S: TStream);
       procedure   Store(var S: TStream);
       procedure   Store(var S: TStream);
     end;
     end;
@@ -766,8 +768,11 @@ begin
   end;
   end;
   Match:=OK;
   Match:=OK;
 end;
 end;
+var W: PView;
 begin
 begin
-  SearchWindow:=PWindow(Desktop^.FirstThat(@Match));
+  W:=Application^.FirstThat(@Match);
+  if Assigned(W)=false then W:=Desktop^.FirstThat(@Match);
+  SearchWindow:=PWindow(W);
 end;
 end;
 
 
 function SearchFreeWindowNo: integer;
 function SearchFreeWindowNo: integer;
@@ -1003,8 +1008,8 @@ begin
        if is_grouped_action then
        if is_grouped_action then
          AddToolMessage('','Group '+ActionString[action]+' '+IntToStr(ActionCount)+' elementary actions',0,0)
          AddToolMessage('','Group '+ActionString[action]+' '+IntToStr(ActionCount)+' elementary actions',0,0)
        else
        else
-         AddToolMessage('',ActionString[action]+' '+IntToStr(StartPos.X)+':'+IntToStr(StartPos.Y)+
-           ' '+IntToStr(EndPos.X)+':'+IntToStr(EndPos.Y)+' "'+GetStr(Text)+'"',0,0);
+         AddToolMessage('',ActionString[action]+' '+IntToStr(StartPos.Y+1)+':'+IntToStr(StartPos.X+1)+
+           ' '+IntToStr(EndPos.Y+1)+':'+IntToStr(EndPos.X+1)+' "'+GetStr(Text)+'"',0,0);
       end;
       end;
   if Core^.RedoList^.count>0 then
   if Core^.RedoList^.count>0 then
     AddToolCommand('RedoList Dump');
     AddToolCommand('RedoList Dump');
@@ -1014,8 +1019,8 @@ begin
        if is_grouped_action then
        if is_grouped_action then
          AddToolMessage('','Group '+ActionString[action]+' '+IntToStr(ActionCount)+' elementary actions',0,0)
          AddToolMessage('','Group '+ActionString[action]+' '+IntToStr(ActionCount)+' elementary actions',0,0)
        else
        else
-         AddToolMessage('',ActionString[action]+' '+IntToStr(StartPos.X)+':'+IntToStr(StartPos.Y)+
-         ' '+IntToStr(EndPos.X)+':'+IntToStr(EndPos.Y)+' "'+GetStr(Text)+'"',0,0);
+         AddToolMessage('',ActionString[action]+' '+IntToStr(StartPos.Y)+':'+IntToStr(StartPos.X+1)+
+         ' '+IntToStr(EndPos.Y+1)+':'+IntToStr(EndPos.X+1)+' "'+GetStr(Text)+'"',0,0);
       end;
       end;
   UpdateToolMessages;
   UpdateToolMessages;
   if Assigned(MessagesWindow) then
   if Assigned(MessagesWindow) then
@@ -3107,6 +3112,35 @@ begin
   GetText:=copy(S,1,MaxLen);
   GetText:=copy(S,1,MaxLen);
 end;
 end;
 
 
+constructor TFPDesktop.Init(var Bounds: TRect);
+begin
+  inherited Init(Bounds);
+end;
+
+procedure TFPDesktop.InitBackground;
+var AV: PANSIBackground;
+    FileName: string;
+    R: TRect;
+begin
+  AV:=nil;
+  FileName:=LocateFile(BackgroundPath);
+  if FileName<>'' then
+  begin
+    GetExtent(R);
+    New(AV, Init(R));
+    AV^.GrowMode:=gfGrowHiX+gfGrowHiY;
+    if AV^.LoadFile(FileName)=false then
+    begin
+      Dispose(AV, Done); AV:=nil;
+    end;
+    if Assigned(AV) then
+      Insert(AV);
+  end;
+  Background:=AV;
+  if Assigned(Background)=false then
+    inherited InitBackground;
+end;
+
 constructor TFPDesktop.Load(var S: TStream);
 constructor TFPDesktop.Load(var S: TStream);
 begin
 begin
   inherited Load(S);
   inherited Load(S);
@@ -3308,7 +3342,10 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.66  2000-03-23 22:22:25  pierre
+  Revision 1.67  2000-04-18 11:42:37  pierre
+   lot of Gabor changes : see fixes.txt
+
+  Revision 1.66  2000/03/23 22:22:25  pierre
    * file loading problem fixed
    * file loading problem fixed
 
 
   Revision 1.65  2000/03/21 23:25:16  pierre
   Revision 1.65  2000/03/21 23:25:16  pierre

+ 15 - 1
ide/text/globdir.inc

@@ -15,7 +15,7 @@
 {$ifdef TP}
 {$ifdef TP}
   {$define SUPPORTVESA}
   {$define SUPPORTVESA}
   {$define TPUNIXLF}
   {$define TPUNIXLF}
-  {$undef WinClipSupported}
+  {$define WinClipSupported}
 
 
   {$C FIXED PRELOAD PERMANENT}
   {$C FIXED PRELOAD PERMANENT}
   {
   {
@@ -65,6 +65,10 @@
   {$endif GDB_V418}
   {$endif GDB_V418}
 {$endif}
 {$endif}
 
 
+{ ----------- define DOS for DOS targets ---------- }
+{$ifdef GO32V2}{$define DOS}{$endif}
+{$ifdef TP}{$define DOS}{$endif}
+
 { include Undo/Redo code from Visa Harvey }
 { include Undo/Redo code from Visa Harvey }
 { let everybody try it out  PM }
 { let everybody try it out  PM }
 { undo should be a bit improved - it does work only with "normal" keystrokes.
 { undo should be a bit improved - it does work only with "normal" keystrokes.
@@ -90,10 +94,20 @@
 { $ undef UNDO}
 { $ undef UNDO}
 { $ undef DEBUGUNDO}
 { $ undef DEBUGUNDO}
 
 
+{$define BROWSERCOL}
+
+{$ifdef SUPPORTVESA}
+  {$define VESA}
+{$endif}
+
 {$ifdef GABOR}
 {$ifdef GABOR}
   {.$define NOOBJREG}
   {.$define NOOBJREG}
   {$define NODEBUG}
   {$define NODEBUG}
   {$define DEBUG}
   {$define DEBUG}
   {$undef EXEDEBUG}
   {$undef EXEDEBUG}
   {$undef USERESSTRINGS}
   {$undef USERESSTRINGS}
+{$endif}
+
+{$ifdef NOWINCLIP}
+  {$undef WINCLIPSUPPORTED}
 {$endif}
 {$endif}

+ 1 - 2
ide/text/test.pas

@@ -151,8 +151,7 @@ BEGIN
   writeln(IsOdd(3));
   writeln(IsOdd(3));
   writeln(Func1(5,5,Bool,T));
   writeln(Func1(5,5,Bool,T));
   new(X);
   new(X);
-  new(X^.next);
-  X^.next^.next:=X;
+  X^.next:=X;
   dispose(X);
   dispose(X);
  { for i:=1 to 99 do
  { for i:=1 to 99 do
     Writeln('Line ',i); }
     Writeln('Line ',i); }

+ 42 - 11
ide/text/wcedit.pas

@@ -45,10 +45,11 @@ type
       Text        : PString;
       Text        : PString;
       EditorInfos : PEditorLineInfoCollection;
       EditorInfos : PEditorLineInfoCollection;
       Flags       : longint;
       Flags       : longint;
+      Owner       : PCustomCodeEditorCore;
       procedure AddEditorInfo(Index: sw_integer; AEditor: PCustomCodeEditor); virtual;
       procedure AddEditorInfo(Index: sw_integer; AEditor: PCustomCodeEditor); virtual;
       procedure RemoveEditorInfo(AEditor: PCustomCodeEditor); virtual;
       procedure RemoveEditorInfo(AEditor: PCustomCodeEditor); virtual;
     public
     public
-      constructor Init(const AText: string; AFlags: longint);
+      constructor Init(AOwner: PCustomCodeEditorCore; const AText: string; AFlags: longint);
       function    GetText: string; virtual;
       function    GetText: string; virtual;
       procedure   SetText(const AText: string); virtual;
       procedure   SetText(const AText: string); virtual;
       function    GetEditorInfo(Editor: PCustomCodeEditor): PEditorLineInfo; virtual;
       function    GetEditorInfo(Editor: PCustomCodeEditor): PEditorLineInfo; virtual;
@@ -266,10 +267,11 @@ const
   );
   );
 {$endif}
 {$endif}
 
 
-constructor TLine.Init(const AText: string; AFlags: longint);
+constructor TLine.Init(AOwner: PCustomCodeEditorCore; const AText: string; AFlags: longint);
 begin
 begin
   inherited Init(AText,AFlags);
   inherited Init(AText,AFlags);
   New(EditorInfos, Init(10,10));
   New(EditorInfos, Init(10,10));
+  Owner:=AOwner;
 end;
 end;
 
 
 procedure TLine.AddEditorInfo(Index: sw_integer; AEditor: PCustomCodeEditor);
 procedure TLine.AddEditorInfo(Index: sw_integer; AEditor: PCustomCodeEditor);
@@ -311,6 +313,8 @@ end;
 procedure TLine.SetFlags(AFlags: longint);
 procedure TLine.SetFlags(AFlags: longint);
 begin
 begin
   Flags:=AFlags;
   Flags:=AFlags;
+  if Assigned(Owner) then
+    Owner^.ContentsChanged;
 end;
 end;
 
 
 destructor TLine.Done;
 destructor TLine.Done;
@@ -482,7 +486,7 @@ begin
   AddCount:=0;
   AddCount:=0;
   while (Lines^.Count<I+1) do
   while (Lines^.Count<I+1) do
    begin
    begin
-     LinesInsert(-1,New(PLine, Init('',0)));
+     LinesInsert(-1,New(PLine, Init(@Self,'',0)));
      Inc(AddCount);
      Inc(AddCount);
    end;
    end;
   if AddCount>0 then
   if AddCount>0 then
@@ -584,12 +588,12 @@ end;
 
 
 procedure TCodeEditorCore.InsertLine(LineNo: sw_integer; const S: string);
 procedure TCodeEditorCore.InsertLine(LineNo: sw_integer; const S: string);
 begin
 begin
-  LinesInsert(LineNo, New(PLine, Init(S,0)));
+  LinesInsert(LineNo, New(PLine, Init(@Self,S,0)));
 end;
 end;
 
 
 procedure TCodeEditorCore.AddLine(const S: string);
 procedure TCodeEditorCore.AddLine(const S: string);
 begin
 begin
-  LinesInsert(-1,New(PLine, Init(S,0)));
+  LinesInsert(-1,New(PLine, Init(@Self,S,0)));
 end;
 end;
 
 
 procedure TCodeEditorCore.AddAction(AAction: byte; AStartPos, AEndPos: TPoint; AText: string);
 procedure TCodeEditorCore.AddAction(AAction: byte; AStartPos, AEndPos: TPoint; AText: string);
@@ -1129,11 +1133,26 @@ procedure TCodeEditor.Undo;
 var
 var
   Temp,Idx,Last,Count : Longint;
   Temp,Idx,Last,Count : Longint;
   Is_grouped : boolean;
   Is_grouped : boolean;
+  MaxY,MinY : sw_integer;
+
+  procedure SetMinMax(y : sw_integer);
+    begin
+      if MinY=-1 then
+        MinY:=Y;
+      if Y<MinY then
+        MinY:=Y;
+      if MaxY=-1 then
+        MaxY:=Y;
+      if Y>MaxY then
+        MaxY:=Y;
+    end;
 {$endif Undo}
 {$endif Undo}
 begin
 begin
 {$ifdef Undo}
 {$ifdef Undo}
   Core^.SetStoreUndo(False);
   Core^.SetStoreUndo(False);
   Lock;
   Lock;
+  MinY:=-1;
+  MaxY:=-1;
   if Core^.UndoList^.count > 0 then
   if Core^.UndoList^.count > 0 then
   begin
   begin
     Last:=Core^.UndoList^.count-1;
     Last:=Core^.UndoList^.count-1;
@@ -1163,6 +1182,7 @@ begin
                 if assigned(text) then
                 if assigned(text) then
                   for Temp := 1 to length(Text^) do
                   for Temp := 1 to length(Text^) do
                     DelChar;
                     DelChar;
+                SetMinMax(StartPos.Y);
               end;
               end;
             eaDeleteText :
             eaDeleteText :
               begin
               begin
@@ -1171,22 +1191,26 @@ begin
                 if assigned(text) then
                 if assigned(text) then
                   for Temp := 1 to length(Text^) do
                   for Temp := 1 to length(Text^) do
                     AddChar(Text^[Temp]);
                     AddChar(Text^[Temp]);
+                SetMinMax(EndPos.Y);
                 SetCurPtr(StartPos.X,StartPos.Y);
                 SetCurPtr(StartPos.X,StartPos.Y);
               end;
               end;
             eaInsertLine :
             eaInsertLine :
               begin
               begin
                 SetCurPtr(EndPos.X,EndPos.Y);
                 SetCurPtr(EndPos.X,EndPos.Y);
                 SetDisplayText(EndPos.Y,Copy(GetDisplayText(EndPos.Y),EndPos.X+1,255));
                 SetDisplayText(EndPos.Y,Copy(GetDisplayText(EndPos.Y),EndPos.X+1,255));
+                SetMinMax(EndPos.Y);
                 BackSpace;
                 BackSpace;
                 SetCurPtr(StartPos.X,StartPos.Y);
                 SetCurPtr(StartPos.X,StartPos.Y);
+                SetMinMax(StartPos.Y);
               end;
               end;
             eaDeleteLine :
             eaDeleteLine :
               begin
               begin
                 SetCurPtr(EndPos.X,EndPos.Y);
                 SetCurPtr(EndPos.X,EndPos.Y);
-                {DelEnd;wrong for eaCut at least }
+                DelEnd;{ wrong for eaCut at least }
                 InsertNewLine;
                 InsertNewLine;
                 SetCurPtr(StartPos.X,StartPos.Y);
                 SetCurPtr(StartPos.X,StartPos.Y);
-                SetLineText(StartPos.Y,GetStr(Text));
+                SetLineText(StartPos.Y,Copy(GetDisplayText(StartPos.Y),1,StartPos.X)+GetStr(Text));
+                SetMinMax(StartPos.Y);
               end;
               end;
             eaSelectionChanged :
             eaSelectionChanged :
               begin
               begin
@@ -1219,6 +1243,8 @@ begin
         SetCmdState(UndoCmd,false);
         SetCmdState(UndoCmd,false);
       SetCmdState(RedoCmd,true);
       SetCmdState(RedoCmd,true);
       Message(Application,evBroadcast,cmCommandSetChanged,nil);
       Message(Application,evBroadcast,cmCommandSetChanged,nil);
+      if MinY<>-1 then
+        UpdateAttrsRange(MinY,MaxY,attrAll);
       DrawView;
       DrawView;
     end;
     end;
   Core^.SetStoreUndo(True);
   Core^.SetStoreUndo(True);
@@ -1284,9 +1310,10 @@ begin
           begin
           begin
             SetCurPtr(StartPos.X,StartPos.Y);
             SetCurPtr(StartPos.X,StartPos.Y);
             DeleteLine(StartPos.Y);
             DeleteLine(StartPos.Y);
-            { SetCurPtr(EndPos.X,EndPos.Y);
-            for Temp := 1 to length(GetStr(Text)) do
-              DelChar;}
+            SetCurPtr(EndPos.X,EndPos.Y);
+            SetDisplayText(StartPos.Y,RExpand(
+              copy(GetDisplayText(StartPos.Y),1,StartPos.X),StartPos.X)
+              +GetStr(Text));
             SetCurPtr(EndPos.X,EndPos.Y);
             SetCurPtr(EndPos.X,EndPos.Y);
           end;
           end;
         eaSelectionChanged :
         eaSelectionChanged :
@@ -1727,4 +1754,8 @@ begin
 end;
 end;
 
 
 
 
-END.
+END.
+{ 
+ $Log $ 
+ 
+}

+ 67 - 51
ide/text/weditor.pas

@@ -1,5 +1,4 @@
 {
 {
-    $Id$
     This file is part of the Free Pascal Integrated Development Environment
     This file is part of the Free Pascal Integrated Development Environment
     Copyright (c) 1998 by Berczi Gabor
     Copyright (c) 1998 by Berczi Gabor
 
 
@@ -748,7 +747,7 @@ end;
 
 
 function IsWordSeparator(C: char): boolean;
 function IsWordSeparator(C: char): boolean;
 begin
 begin
-  IsWordSeparator:=C in[' ',#0,#255,':','=','''','"','.',',','/',';','$','#','(',')','<','>','^','*','+','-','?','&'];
+  IsWordSeparator:=C in[' ',#0,#255,':','=','''','"','.',',','/',';','$','#','(',')','<','>','^','*','+','-','?','&','[',']'];
 end;
 end;
 
 
 function IsSpace(C: char): boolean;
 function IsSpace(C: char): boolean;
@@ -2007,11 +2006,9 @@ var
   end;
   end;
 
 
 var CurLine: Sw_integer;
 var CurLine: Sw_integer;
-    Line,NextLine,PrevLine,OldLine: PCustomLine;
-    B: PEditorBinding;
+    Line,NextLine,PrevLine{,OldLine}: PCustomLine;
     PrevLI,LI,NextLI: PEditorLineInfo;
     PrevLI,LI,NextLI: PEditorLineInfo;
 begin
 begin
-  B:=SearchBinding(Editor);
   if (not Editor^.IsFlagSet(efSyntaxHighlight)) or (FromLine>=GetLineCount) then
   if (not Editor^.IsFlagSet(efSyntaxHighlight)) or (FromLine>=GetLineCount) then
   begin
   begin
     SetLineFormat(Editor,FromLine,'');
     SetLineFormat(Editor,FromLine,'');
@@ -2059,7 +2056,7 @@ begin
        CurrentCommentType:=0;
        CurrentCommentType:=0;
        InDirective:=false;
        InDirective:=false;
      end;
      end;
-    OldLine:=Line;
+{    OldLine:=Line;}
     LI^.BeginsWithAsm:=InAsm;
     LI^.BeginsWithAsm:=InAsm;
     LI^.BeginsWithComment:=InComment;
     LI^.BeginsWithComment:=InComment;
     LI^.BeginsWithDirective:=InDirective;
     LI^.BeginsWithDirective:=InDirective;
@@ -2793,6 +2790,7 @@ procedure TCustomCodeEditor.SetLineFlagExclusive(Flags: longint; LineNo: sw_inte
 var I,Count: sw_integer;
 var I,Count: sw_integer;
     L: PCustomLine;
     L: PCustomLine;
 begin
 begin
+  Lock;
   Count:=GetLineCount;
   Count:=GetLineCount;
   for I:=0 to Count-1 do
   for I:=0 to Count-1 do
   begin
   begin
@@ -2802,6 +2800,7 @@ begin
     else
     else
       L^.SetFlags(L^.GetFlags and (not Flags));
       L^.SetFlags(L^.GetFlags and (not Flags));
   end;
   end;
+  UnLock;
 end;
 end;
 
 
 procedure TCustomCodeEditor.HandleEvent(var Event: TEvent);
 procedure TCustomCodeEditor.HandleEvent(var Event: TEvent);
@@ -3601,7 +3600,7 @@ begin
   end;
   end;
   IndentStr:=CharStr(' ',Ind);
   IndentStr:=CharStr(' ',Ind);
 end;
 end;
-var SelBack: sw_integer;
+var {SelBack: sw_integer;}
     SCP: TPoint;
     SCP: TPoint;
     HoldUndo : Boolean;
     HoldUndo : Boolean;
 begin
 begin
@@ -3613,11 +3612,11 @@ begin
   if CurPos.Y<GetLineCount then S:=GetLineText(CurPos.Y) else S:='';
   if CurPos.Y<GetLineCount then S:=GetLineText(CurPos.Y) else S:='';
   if Overwrite=false then
   if Overwrite=false then
   begin
   begin
-    SelBack:=0;
+{    SelBack:=0;}
     if GetLineCount>0 then
     if GetLineCount>0 then
     begin
     begin
       S:=GetDisplayText(CurPos.Y);
       S:=GetDisplayText(CurPos.Y);
-      SelBack:=length(S)-SelEnd.X;
+{      SelBack:=length(S)-SelEnd.X;}
       SetDisplayText(CurPos.Y,RTrim(S,not IsFlagSet(efUseTabCharacters)));
       SetDisplayText(CurPos.Y,RTrim(S,not IsFlagSet(efUseTabCharacters)));
     end;
     end;
     SetDisplayText(CurPos.Y,copy(S,1,CurPos.X-1+1));
     SetDisplayText(CurPos.Y,copy(S,1,CurPos.X-1+1));
@@ -3950,43 +3949,52 @@ begin
   LineCount:=(SelEnd.Y-SelStart.Y)+1;
   LineCount:=(SelEnd.Y-SelStart.Y)+1;
   LineDelta:=0; LastX:=CurPos.X;
   LineDelta:=0; LastX:=CurPos.X;
   CurLine:=SelStart.Y;
   CurLine:=SelStart.Y;
-  while (LineDelta<LineCount) do
-  begin
-    S:=GetDisplayText(CurLine);
-    if LineDelta=0 then StartX:=SelStart.X else StartX:=0;
-    if LineDelta=LineCount-1 then EndX:=SelEnd.X else EndX:=length(S);
-    if (LineDelta<LineCount-1) and ((StartX=0) and (EndX>=length(S))) then
-      begin
-      { delete the complete line }
-        DeleteLine(CurLine);
-        if CurLine>0 then
-          LastX:=length(GetDisplayText(CurLine-1))
-        else
-          LastX:=0;
-      end
-    else
-      begin
-        if GetStoreUndo then
-          begin
-            SPos.X:=StartX;
-            SPos.Y:=CurLine;
-            AddAction(eaDeleteText,SPos,SPos,Copy(S,StartX+1,EndX-StartX));
-          end;
-        SetDisplayText(CurLine,RExpand(copy(S,1,StartX),StartX)+copy(S,EndX+1,255));
-        LastX:=StartX;
-        if (StartX=0) and (0<LineDelta) and
-           not(((LineDelta=LineCount-1) and (StartX=0) and (StartX=EndX))) then
-          begin
-            S:=GetDisplayText(CurLine-1);
-            SetDisplayText(CurLine-1,S+GetLineText(CurLine));
-            DeleteLine(CurLine);
-            LastX:=length(S);
-          end
-        else
-         Inc(CurLine);
-      end;
-    Inc(LineDelta);
-  end;
+  { single line : easy }
+  if LineCount=1 then
+    begin
+      S:=GetDisplayText(CurLine);
+      StartX:=SelStart.X;
+      EndX:=SelEnd.X;
+      SetDisplayText(CurLine,RExpand(copy(S,1,StartX),StartX)
+        +copy(S,EndX+1,255));
+      if GetStoreUndo then
+        begin
+          SPos.X:=StartX;
+          SPos.Y:=CurLine;
+          AddAction(eaDeleteText,SPos,SPos,Copy(S,StartX+1,EndX-StartX));
+        end;
+      Inc(CurLine);
+      LastX:=SelStart.X;
+    end
+  { several lines : a bit less easy }
+  else
+    begin
+      S:=GetDisplayText(CurLine);
+      StartX:=SelStart.X;
+      EndX:=SelEnd.X;
+      SetDisplayText(CurLine,RExpand(copy(S,1,StartX),StartX)
+        +copy(GetDisplayText(CurLine+LineCount-1),EndX+1,255));
+      if GetStoreUndo then
+        begin
+          SPos.X:=StartX;
+          SPos.Y:=CurLine;
+          AddAction(eaDeleteText,SPos,SPos,Copy(S,StartX+1,255));
+          S:=GetDisplayText(CurLine+LineCount-1);
+        end;
+      Inc(CurLine);
+      Inc(LineDelta);
+      LastX:=SelStart.X;
+      while (LineDelta<LineCount) do
+        begin
+        { delete the complete line }
+          DeleteLine(CurLine);
+          Inc(LineDelta);
+        end;
+      if GetStoreUndo then
+        begin
+          AddAction(eaInsertText,SPos,SPos,Copy(S,EndX+1,255));
+        end;
+    end;
   HideSelect;
   HideSelect;
   SetCurPtr(LastX,CurLine-1);
   SetCurPtr(LastX,CurLine-1);
   UpdateAttrs(CurPos.Y,attrAll);
   UpdateAttrs(CurPos.Y,attrAll);
@@ -4890,14 +4898,14 @@ begin
 end;
 end;
 
 
 procedure TCustomCodeEditor.SetCurPtr(X,Y: sw_integer);
 procedure TCustomCodeEditor.SetCurPtr(X,Y: sw_integer);
-var OldPos,OldSEnd,OldSStart: TPoint;
+var OldPos,{OldSEnd,}OldSStart: TPoint;
     Extended: boolean;
     Extended: boolean;
 begin
 begin
   Lock;
   Lock;
   X:=Max(0,Min(MaxLineLength+1,X));
   X:=Max(0,Min(MaxLineLength+1,X));
   Y:=Max(0,Min(GetLineCount-1,Y));
   Y:=Max(0,Min(GetLineCount-1,Y));
   OldPos:=CurPos;
   OldPos:=CurPos;
-  OldSEnd:=SelEnd;
+{  OldSEnd:=SelEnd;}
   OldSStart:=SelStart;
   OldSStart:=SelStart;
   CurPos.X:=X;
   CurPos.X:=X;
   CurPos.Y:=Y;
   CurPos.Y:=Y;
@@ -5488,7 +5496,7 @@ begin
         if (Length(FileDir)>1) and (FileDir[2]=':') then
         if (Length(FileDir)>1) and (FileDir[2]=':') then
           begin
           begin
             { does not assume that lowercase are greater then uppercase ! }
             { does not assume that lowercase are greater then uppercase ! }
-            if (FileDir[1]>='a') and (FileDir[1]>='z') then
+            if (FileDir[1]>='a') and (FileDir[1]<='z') then
               DriveNumber:=Ord(FileDir[1])-ord('a')+1
               DriveNumber:=Ord(FileDir[1])-ord('a')+1
             else
             else
               DriveNumber:=Ord(FileDir[1])-ord('A')+1;
               DriveNumber:=Ord(FileDir[1])-ord('A')+1;
@@ -5522,7 +5530,12 @@ begin
         Re:=Application^.ExecuteDialog(New(PFileDialog, Init(DefExt,
         Re:=Application^.ExecuteDialog(New(PFileDialog, Init(DefExt,
           Title, '~N~ame', fdOkButton, FileId)), @Name);
           Title, '~N~ame', fdOkButton, FileId)), @Name);
         case Dialog of
         case Dialog of
-          edSaveAs     : AskOW:=(Name<>PString(Info)^);
+          edSaveAs     :
+            begin
+              if ExtOf(Name)='' then
+                Name:=Name+DefaultSaveExt;
+              AskOW:=(Name<>PString(Info)^);
+            end;
           edWriteBlock : AskOW:=true;
           edWriteBlock : AskOW:=true;
           edReadBlock  : AskOW:=false;
           edReadBlock  : AskOW:=false;
         else AskOW:=true;
         else AskOW:=true;
@@ -5587,7 +5600,10 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.86  2000-03-23 21:36:19  pierre
+  Revision 1.87  2000-04-18 11:42:38  pierre
+   lot of Gabor changes : see fixes.txt
+
+  Revision 1.86  2000/03/23 21:36:19  pierre
    * get correct position in indicator again
    * get correct position in indicator again
 
 
   Revision 1.85  2000/03/21 23:17:47  pierre
   Revision 1.85  2000/03/21 23:17:47  pierre

+ 14 - 4
ide/text/whelp.pas

@@ -440,12 +440,11 @@ end;
 
 
 procedure THelpFile.MaintainTopicCache;
 procedure THelpFile.MaintainTopicCache;
 var Count: sw_integer;
 var Count: sw_integer;
-    MinP: PTopic;
     MinLRU: longint;
     MinLRU: longint;
 procedure CountThem(P: PTopic); {$ifndef FPC}far;{$endif}
 procedure CountThem(P: PTopic); {$ifndef FPC}far;{$endif}
 begin if (P^.Text<>nil) or (P^.Links<>nil) then Inc(Count); end;
 begin if (P^.Text<>nil) or (P^.Links<>nil) then Inc(Count); end;
 procedure SearchLRU(P: PTopic); {$ifndef FPC}far;{$endif}
 procedure SearchLRU(P: PTopic); {$ifndef FPC}far;{$endif}
-begin if P^.LastAccess<MinLRU then begin MinLRU:=P^.LastAccess; MinP:=P; end; end;
+begin if P^.LastAccess<MinLRU then begin MinLRU:=P^.LastAccess; end; end;
 var P: PTopic;
 var P: PTopic;
 begin
 begin
   Count:=0; Topics^.ForEach(@CountThem);
   Count:=0; Topics^.ForEach(@CountThem);
@@ -494,7 +493,15 @@ begin
       rtIndex       : begin IndexTablePos:=L; {OK:=ReadIndexTable; }end;
       rtIndex       : begin IndexTablePos:=L; {OK:=ReadIndexTable; }end;
       rtCompression : begin F^.Seek(L); OK:=ReadCompression; end;
       rtCompression : begin F^.Seek(L); OK:=ReadCompression; end;
       rtIndexTags   : begin IndexTagsPos:=L; {OK:=ReadIndexTags; }end;
       rtIndexTags   : begin IndexTagsPos:=L; {OK:=ReadIndexTags; }end;
-    else {Skip};
+    else
+     begin
+     {$ifdef DEBUGMSG}
+       ErrorBox('Uknown help record tag 0x'+IntToHex(R.SClass)+' encountered, offset 0x'+IntToHex(L)+
+         ', size '+IntToStr(R.Size),nil);
+     {$else}
+       {Skip};
+     {$endif}
+     end;
     end;
     end;
     if OK then
     if OK then
        begin Inc(L, SizeOf(THLPRecordHeader)); Inc(L, R.Size); F^.Seek(L); OK:=(F^.Status=stOK); end
        begin Inc(L, SizeOf(THLPRecordHeader)); Inc(L, R.Size); F^.Seek(L); OK:=(F^.Status=stOK); end
@@ -970,7 +977,10 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.17  2000-02-07 11:47:25  pierre
+  Revision 1.18  2000-04-18 11:42:38  pierre
+   lot of Gabor changes : see fixes.txt
+
+  Revision 1.17  2000/02/07 11:47:25  pierre
    * Remove 64Kb limitation for FPC by Gabor
    * Remove 64Kb limitation for FPC by Gabor
 
 
   Revision 1.16  2000/01/03 14:59:03  marco
   Revision 1.16  2000/01/03 14:59:03  marco

+ 13 - 2
ide/text/whlpview.pas

@@ -104,7 +104,7 @@ type
         destructor  Done; virtual;
         destructor  Done; virtual;
       private
       private
         Width,Margin: sw_integer;
         Width,Margin: sw_integer;
-        StockItem: boolean;
+{        StockItem: boolean;}
         procedure  ReBuild;
         procedure  ReBuild;
       end;
       end;
 
 
@@ -951,6 +951,14 @@ var NormalColor, LinkColor,
     C: word;
     C: word;
     CurP: TPoint;
     CurP: TPoint;
 begin
 begin
+  if LockFlag>0 then
+    begin
+      DrawCalled:=true;
+      Exit;
+    end;
+  DrawCalled:=false;
+
+
   NormalColor:=GetColor(1); LinkColor:=GetColor(2);
   NormalColor:=GetColor(1); LinkColor:=GetColor(2);
   SelectColor:=GetColor(3); SelectionColor:=GetColor(4);
   SelectColor:=GetColor(3); SelectionColor:=GetColor(4);
 {$ifndef EDITORS}
 {$ifndef EDITORS}
@@ -1139,7 +1147,10 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.12  2000-03-21 23:21:38  pierre
+  Revision 1.13  2000-04-18 11:42:39  pierre
+   lot of Gabor changes : see fixes.txt
+
+  Revision 1.12  2000/03/21 23:21:38  pierre
    adapted to wcedit addition
    adapted to wcedit addition
 
 
   Revision 1.11  2000/02/07 08:29:13  michael
   Revision 1.11  2000/02/07 08:29:13  michael

+ 18 - 12
ide/text/winclip.pas

@@ -14,11 +14,11 @@
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 
  **********************************************************************}
  **********************************************************************}
+{$i globdir.inc}
 unit WinClip;
 unit WinClip;
 
 
 interface
 interface
 
 
-{$i globdir.inc}
 {$ifdef WinClipSupported}
 {$ifdef WinClipSupported}
 
 
 function WinClipboardSupported : boolean;
 function WinClipboardSupported : boolean;
@@ -32,20 +32,23 @@ function SetTextWinClipBoardData(p : pchar;l : longint) : boolean;
 implementation
 implementation
 
 
 {$ifdef WinClipSupported}
 {$ifdef WinClipSupported}
-{$ifdef go32v2}
+{$ifdef DOS}
   uses
   uses
-    strings,go32;
+{$ifdef go32v2}
+    go32,{ sorry Gabor, but its still not compiling without that ! }
 {$endif go32v2}
 {$endif go32v2}
+    strings,dos,pmode;
+{$endif DOS}
 
 
 {$ifdef win32}
 {$ifdef win32}
   uses
   uses
     strings,windows;
     strings,windows;
 {$endif win32}
 {$endif win32}
 
 
-{$ifdef go32v2}
+{$ifdef DOS}
 function WinClipboardSupported : boolean;
 function WinClipboardSupported : boolean;
 var
 var
-  r : Registers;
+  r : registers;
 begin
 begin
   r.ax:=$1700;
   r.ax:=$1700;
   RealIntr($2F,r);
   RealIntr($2F,r);
@@ -88,7 +91,7 @@ begin
   RealIntr($2F,r);
   RealIntr($2F,r);
   InternGetDataSize:=(r.dx shl 16) + r.ax;
   InternGetDataSize:=(r.dx shl 16) + r.ax;
 end;
 end;
-{$endif go32v2}
+{$endif DOS}
 
 
 {$ifdef win32}
 {$ifdef win32}
 function WinClipboardSupported : boolean;
 function WinClipboardSupported : boolean;
@@ -135,11 +138,11 @@ end;
 
 
 function GetTextWinClipBoardData(var p : pchar;var l : longint) : boolean;
 function GetTextWinClipBoardData(var p : pchar;var l : longint) : boolean;
 var
 var
-{$ifdef go32v2}
+{$ifdef DOS}
   r : Registers;
   r : Registers;
   tb_all : longint;
   tb_all : longint;
   tb_seg,tb_ofs,tb_sel : word;
   tb_seg,tb_ofs,tb_sel : word;
-{$endif go32v2}
+{$endif DOS}
 {$ifdef win32}
 {$ifdef win32}
   h : HGlobal;
   h : HGlobal;
   pp : pchar;
   pp : pchar;
@@ -208,11 +211,11 @@ end;
 
 
 function SetTextWinClipBoardData(p : pchar;l : longint) : boolean;
 function SetTextWinClipBoardData(p : pchar;l : longint) : boolean;
 var
 var
-{$ifdef go32v2}
+{$ifdef DOS}
   r : Registers;
   r : Registers;
   tb_all : longint;
   tb_all : longint;
   tb_seg,tb_ofs,tb_sel : word;
   tb_seg,tb_ofs,tb_sel : word;
-{$endif go32v2}
+{$endif DOS}
 {$ifdef win32}
 {$ifdef win32}
   h : HGlobal;
   h : HGlobal;
   pp : pchar;
   pp : pchar;
@@ -270,7 +273,10 @@ end.
 
 
 {
 {
  $Log$
  $Log$
- Revision 1.4  1999-11-05 13:46:26  pierre
+ Revision 1.5  2000-04-18 11:42:39  pierre
+  lot of Gabor changes : see fixes.txt
+
+ Revision 1.4  1999/11/05 13:46:26  pierre
    * Use CF_OEMTEXT under win32 and dx=7 under go32v2 to obtain
    * Use CF_OEMTEXT under win32 and dx=7 under go32v2 to obtain
      OEM to ANSI conversion
      OEM to ANSI conversion
    * GetClipboardDataSize for Win32
    * GetClipboardDataSize for Win32
@@ -278,4 +284,4 @@ end.
  Revision 1.3  1999/10/14 14:22:23  florian
  Revision 1.3  1999/10/14 14:22:23  florian
    * if no ini file is found the ide uses some useful defaults
    * if no ini file is found the ide uses some useful defaults
 
 
-}
+}

+ 5 - 2
ide/text/wini.pas

@@ -72,7 +72,7 @@ type
       procedure   DeleteEntry(const Section, Tag: string);
       procedure   DeleteEntry(const Section, Tag: string);
       destructor  Done; virtual;
       destructor  Done; virtual;
     private
     private
-      ReadOnly: boolean;
+{      ReadOnly: boolean;}
       Sections: PCollection;
       Sections: PCollection;
       FileName: PString;
       FileName: PString;
     end;
     end;
@@ -478,7 +478,10 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.8  1999-03-08 14:58:21  peter
+  Revision 1.9  2000-04-18 11:42:39  pierre
+   lot of Gabor changes : see fixes.txt
+
+  Revision 1.8  1999/03/08 14:58:21  peter
     + prompt with dialogs for tools
     + prompt with dialogs for tools
 
 
   Revision 1.7  1999/03/05 17:53:03  pierre
   Revision 1.7  1999/03/05 17:53:03  pierre

+ 5 - 2
ide/text/wresourc.pas

@@ -13,7 +13,7 @@
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 
  **********************************************************************}
  **********************************************************************}
-unit WResource;
+unit WResourc;
 
 
 interface
 interface
 
 
@@ -791,7 +791,10 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.8  2000-02-07 08:29:14  michael
+  Revision 1.9  2000-04-18 11:42:39  pierre
+   lot of Gabor changes : see fixes.txt
+
+  Revision 1.8  2000/02/07 08:29:14  michael
   [*] the fake (!) TOKENS.PAS still contained the typo bug
   [*] the fake (!) TOKENS.PAS still contained the typo bug
        FSplit(,n,d,e) (correctly FSplit(,d,n,e))
        FSplit(,n,d,e) (correctly FSplit(,d,n,e))
   [*] CodeComplete had a very ugly bug - coordinates were document-relative
   [*] CodeComplete had a very ugly bug - coordinates were document-relative

+ 32 - 17
ide/text/wutils.pas

@@ -25,7 +25,7 @@ uses
 
 
 type
 type
   PByteArray = ^TByteArray;
   PByteArray = ^TByteArray;
-  TByteArray = array[0..65520] of byte;
+  TByteArray = array[0..MaxBytes] of byte;
 
 
   PNoDisposeCollection = ^TNoDisposeCollection;
   PNoDisposeCollection = ^TNoDisposeCollection;
   TNoDisposeCollection = object(TCollection)
   TNoDisposeCollection = object(TCollection)
@@ -91,6 +91,7 @@ function RTrim(const S: string): string;
 function Trim(const S: string): string;
 function Trim(const S: string): string;
 function IntToStr(L: longint): string;
 function IntToStr(L: longint): string;
 function StrToInt(const S: string): longint;
 function StrToInt(const S: string): longint;
+function IntToHex(L: longint): string;
 function GetStr(P: PString): string;
 function GetStr(P: PString): string;
 function GetPChar(P: PChar): string;
 function GetPChar(P: PChar): string;
 function BoolToStr(B: boolean; const TrueS, FalseS: string): string;
 function BoolToStr(B: boolean; const TrueS, FalseS: string): string;
@@ -236,18 +237,6 @@ begin
   UpcaseStr[0]:=S[0];
   UpcaseStr[0]:=S[0];
 end;
 end;
 
 
-function LowerCaseStr(S: string): string;
-var
-  I: Longint;
-begin
-  for I:=1 to length(S) do
-    if S[I] in ['A'..'Z'] then
-      LowerCaseStr[I]:=chr(ord(S[I])+32)
-    else
-      LowerCaseStr[I]:=S[I];
-  LowercaseStr[0]:=S[0];
-end;
-
 function RExpand(const S: string; MinLen: byte): string;
 function RExpand(const S: string; MinLen: byte): string;
 begin
 begin
   if length(S)<MinLen then
   if length(S)<MinLen then
@@ -298,6 +287,29 @@ begin
   StrToInt:=L;
   StrToInt:=L;
 end;
 end;
 
 
+function IntToHex(L: longint): string;
+const HexNums : string[16] = '0123456789ABCDEF';
+var S: string;
+    R: real;
+function DivF(Mit,Mivel: real): longint;
+begin
+  DivF:=trunc(Mit/Mivel);
+end;
+function ModF(Mit,Mivel: real): longint;
+begin
+  ModF:=trunc(Mit-DivF(Mit,Mivel)*Mivel);
+end;
+begin
+  S:='';
+  R:=L; if R<0 then begin R:=R+2147483647+2147483647+2; end;
+  repeat
+    S:=HexNums[ModF(R,16)+1]+S;
+    R:=DivF(R,16);
+  until R=0;
+  IntToHex:=S;
+end;
+
+
 function GetStr(P: PString): string;
 function GetStr(P: PString): string;
 begin
 begin
   if P=nil then GetStr:='' else GetStr:=P^;
   if P=nil then GetStr:='' else GetStr:=P^;
@@ -596,7 +608,7 @@ end;
 function TTextCollection.LookUp(const S: string; var Idx: sw_integer): string;
 function TTextCollection.LookUp(const S: string; var Idx: sw_integer): string;
 var OLI,ORI,Left,Right,Mid: integer;
 var OLI,ORI,Left,Right,Mid: integer;
     LeftP,RightP,MidP: PString;
     LeftP,RightP,MidP: PString;
-    LeftS,MidS,RightS: string;
+    {LeftS,}MidS{,RightS}: string;
     FoundS: string;
     FoundS: string;
     UpS : string;
     UpS : string;
 begin
 begin
@@ -610,8 +622,8 @@ begin
       OLI:=Left; ORI:=Right;
       OLI:=Left; ORI:=Right;
       Mid:=Left+(Right-Left) div 2;
       Mid:=Left+(Right-Left) div 2;
       LeftP:=At(Left); RightP:=At(Right); MidP:=At(Mid);
       LeftP:=At(Left); RightP:=At(Right); MidP:=At(Mid);
-      LeftS:=UpCaseStr(LeftP^); MidS:=UpCaseStr(MidP^);
-      RightS:=UpCaseStr(RightP^);
+{      LeftS:=UpCaseStr(LeftP^); }MidS:=UpCaseStr(MidP^);
+{      RightS:=UpCaseStr(RightP^);}
       if copy(MidS,1,length(UpS))=UpS then
       if copy(MidS,1,length(UpS))=UpS then
         begin
         begin
           Idx:=Mid; FoundS:=GetStr(MidP);
           Idx:=Mid; FoundS:=GetStr(MidP);
@@ -679,7 +691,10 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.18  2000-03-21 23:19:13  pierre
+  Revision 1.19  2000-04-18 11:42:39  pierre
+   lot of Gabor changes : see fixes.txt
+
+  Revision 1.18  2000/03/21 23:19:13  pierre
    + TrimEndSlash and CompareText by Gabor
    + TrimEndSlash and CompareText by Gabor
 
 
   Revision 1.17  2000/03/20 19:19:45  pierre
   Revision 1.17  2000/03/20 19:19:45  pierre

+ 7 - 6
ide/text/wviews.pas

@@ -274,10 +274,8 @@ procedure TrackMouse;
 var
 var
   Mouse: TPoint;
   Mouse: TPoint;
   R: TRect;
   R: TRect;
-  OldC: PMenuItem;
 begin
 begin
   MakeLocal(E.Where, Mouse);
   MakeLocal(E.Where, Mouse);
-  OldC:=Current;
   Current := Menu^.Items;
   Current := Menu^.Items;
   while Current <> nil do
   while Current <> nil do
   begin
   begin
@@ -291,7 +289,7 @@ begin
   end;
   end;
   if (Current<>nil) and IsDisabled(Current) then
   if (Current<>nil) and IsDisabled(Current) then
   begin
   begin
-     Current:={OldC}nil;
+     Current:=nil;
      MouseActive:=false;
      MouseActive:=false;
   end;
   end;
 end;
 end;
@@ -1610,9 +1608,9 @@ begin
 end;
 end;
 
 
 procedure TDDHelperLB.SetState(AState: Word; Enable: Boolean);
 procedure TDDHelperLB.SetState(AState: Word; Enable: Boolean);
-var OState: longint;
+{var OState: longint;}
 begin
 begin
-  OState:=State;
+{  OState:=State;}
   inherited SetState(AState,Enable);
   inherited SetState(AState,Enable);
 {  if (((State xor OState) and sfFocused)<>0) and (GetState(sfFocused)=false) then
 {  if (((State xor OState) and sfFocused)<>0) and (GetState(sfFocused)=false) then
     Link^.DropList(false);}
     Link^.DropList(false);}
@@ -2079,7 +2077,10 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.11  2000-01-10 15:53:37  pierre
+  Revision 1.12  2000-04-18 11:42:39  pierre
+   lot of Gabor changes : see fixes.txt
+
+  Revision 1.11  2000/01/10 15:53:37  pierre
   * WViews objects were not registered
   * WViews objects were not registered
 
 
   Revision 1.10  1999/08/03 20:22:46  peter
   Revision 1.10  1999/08/03 20:22:46  peter