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;
   LoadDesktop;
   ParseUserScreen;
+  { why are the screen contents parsed at startup? Gabor }
 
   { Update IDE }
   IDEApp.Update;
@@ -236,7 +237,10 @@ BEGIN
 END.
 {
   $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
 
   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);
 var R: extended;
-    Re: real;
+{    Re: real;}
 begin
   if (State and sfSelected)<>0 then
   case Event.What of
@@ -404,7 +404,7 @@ begin
        kbCtrlEnter :
          begin
            ClearEvent(Event);
-           CD^.GetDisplay(R); Re:=R;
+           CD^.GetDisplay(R); {Re:=R;}
            Close;
            CalcClipboard:=R;
            Message(Application,evBroadcast,cmCalculatorPaste,nil);
@@ -463,7 +463,10 @@ end;
 end.
 {
   $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
 
   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;
     C: PCodeCompleteWordList;
     I: integer;
+    S1,S2,S3: string;
+    W: word;
 begin
   New(C, Init(10,20));
   if Assigned(CodeCompleteWords) then

+ 9 - 2
ide/text/fpcodtmp.pas

@@ -252,6 +252,8 @@ end;
 
 constructor TCodeTemplateDialog.Init(const ATitle: string; ATemplate: PCodeTemplate);
 var R,R2,R3: TRect;
+    Items: PSItem;
+    I,KeyCount: sw_integer;
 begin
   R.Assign(0,0,52,15);
   inherited Init(R,ATitle);
@@ -262,7 +264,7 @@ begin
   New(ShortCutIL, Init(R, 128)); Insert(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;
-  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)));
 
   InsertButtons(@Self);
@@ -274,6 +276,7 @@ function TCodeTemplateDialog.Execute: Word;
 var R: word;
     S: string;
     L: PUnsortedStringCollection;
+    W: word;
 begin
   New(L, Init(10,10));
   S:=Template^.GetShortCut;
@@ -311,7 +314,7 @@ begin
   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;
   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
   begin
     ReadOnly:=true;
@@ -389,6 +392,8 @@ var R: word;
     C: PCodeTemplateCollection;
     L: PUnsortedStringCollection;
     I: integer;
+    S1,S2,S3: string;
+    W: word;
 begin
   New(C, Init(10,20));
   if Assigned(CodeTemplates) then
@@ -418,6 +423,8 @@ var P,P2: PCodeTemplate;
     IC: boolean;
     S: string;
     L: PUnsortedStringCollection;
+    I: sw_integer;
+    W: word;
     Cmd: word;
     CanExit: boolean;
 begin

+ 17 - 9
ide/text/fpcompil.pas

@@ -61,7 +61,7 @@ type
       procedure   Store(var S: TStream);
     private
       {CompileShowed : boolean;}
-      Mode   : TCompileMode;
+      {Mode   : TCompileMode;}
       MsgLB  : PCompilerMessageListBox;
       {CurrST,
       InfoST : PColorStaticText;}
@@ -435,10 +435,11 @@ end;
 
 procedure TCompilerStatusDialog.Update;
 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
   StatusS,KeyS: string;
 begin
@@ -454,7 +455,7 @@ begin
     cpLinking   :
       begin
         StatusS:='Linking '+ExeFile;
-        KeyS:=CtrlBS;
+        KeyS:={CtrlBS}PleaseWaitS;
       end;
     cpDone      :
       begin
@@ -553,6 +554,10 @@ begin
      RedirDisableAll;
 {$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,
        status.currentline,status.currentcolumn);
      { update info messages }
@@ -648,9 +653,9 @@ begin
       Exit;
     end;
 { Show Compiler Messages Window }
-  if not CompilerMessageWindow^.GetState(sfVisible) then
+{  if not CompilerMessageWindow^.GetState(sfVisible) then
    CompilerMessageWindow^.Show;
-  CompilerMessageWindow^.MakeFirst;
+  CompilerMessageWindow^.MakeFirst;}
   CompilerMessageWindow^.ClearMessages;
   { Tell why we compile }
   NeedRecompile(true);
@@ -868,7 +873,10 @@ end;
 end.
 {
   $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
 
   Revision 1.53  2000/03/21 23:33:18  pierre

+ 14 - 1
ide/text/fpconst.pas

@@ -34,6 +34,7 @@ const
      SwitchesName         = 'fp.cfg';
      DesktopName          = 'fp.dsk';
      BrowserName          = 'fp.brw';
+     BackgroundName       = 'fp.ans';
 
      ToolCaptureName      = '__tool__.out'; { all '$' signs replaces with '_'s }
      FilterCaptureName    = '_filter_.out';
@@ -206,6 +207,11 @@ const
 
      cmDebuggerStopped   = 2600;
 
+     cmSymBrowse         = 2700;
+     cmSymGotoSource     = 2701;
+     cmSymTrackSource    = 2702;
+     cmSymOptions        = 2703;
+
      { Help constants }
      hcSourceWindow      = 8000;
      hcHelpWindow        = 8001;
@@ -313,6 +319,10 @@ const
      hcMsgClear          = hcShift+cmMsgClear;
      hcMsgGotoSource     = hcShift+cmMsgGotoSource;
      hcMsgTrackSource    = hcShift+cmMsgTrackSource;
+     hcSymBrowse         = hcShift+cmSymBrowse;
+     hcSymGotoSource     = hcShift+cmSymGotoSource;
+     hcSymTrackSource    = hcShift+cmSymTrackSource;
+     hcSymOptions        = hcShift+cmSymOptions;
      hcGotoCursor        = hcShift+cmGotoCursor;
      hcNewBreakpoint     = hcShift+cmNewBreakpoint;
      hcEditBreakpoint    = hcShift+cmEditBreakpoint;
@@ -386,7 +396,10 @@ implementation
 END.
 {
   $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
 
   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;
     S: String;
     X,X1 : Sw_integer;
+    Btn: PButton;
 const White = 15;
 begin
   Desktop^.GetExtent(R); R.A.Y:=R.B.Y-18;
@@ -1674,16 +1675,24 @@ begin
   X:=(R.B.X-R.A.X) div 4;
   X1:=R.A.X+(X div 2);
   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;
   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;
   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;
   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;
   Update;
   BreakpointsWindow:=@self;
@@ -2731,10 +2740,10 @@ end;
        p,po : pchar;
        p1 : pchar;
     {$ifndef NODEBUG}
-       reg,value : string;
+{       reg,value : string;
        buffer : array[0..255] of char;
        v : dword;
-       code : word;
+       code : word;}
     {$endif}
 
     begin
@@ -2826,7 +2835,7 @@ end;
 
     var
        rs : tfpuregs;
-       color :byte;
+{       color :byte;
 
     procedure SetColor(x,y : longint);
     begin
@@ -2834,7 +2843,7 @@ end;
         color:=7
       else
         color:=8;
-    end;
+    end;}
 
     begin
        inherited draw;
@@ -3331,7 +3340,10 @@ end.
 
 {
   $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
 
   Revision 1.57  2000/03/14 14:22:30  pierre

+ 20 - 4
ide/text/fpdesk.pas

@@ -45,7 +45,7 @@ implementation
 uses Dos,
      Objects,Drivers,Video,
      Views,App,HistList,BrowCol,
-     WResource,WViews,WEditor,
+     WResourc,WViews,WEditor,
      WUtils,
 {$ifndef NODEBUG}
      fpdebug,
@@ -259,7 +259,6 @@ end;
 function ReadOpenWindows(F: PResourceFile): boolean;
 var S: PMemoryStream;
     OK: boolean;
-    R : TRect;
     W: word;
     WI: TWindowInfo;
     Title: string;
@@ -406,6 +405,11 @@ begin
      (P^.HelpCtx=hcASCIITableWindow)
    then
      W:=PWindow(P);
+
+  if Assigned(W) and (P^.HelpCtx=hcSourceWindow) then
+    if SW^.Editor^.FileName='' then
+      W:=nil;
+
   if W=nil then Exit;
   FillChar(WI,sizeof(WI),0);
   Title:=W^.GetTitle(255);
@@ -458,6 +462,12 @@ begin
       PutSubViewPtr(S^,ASCIIChart);
       PutSubViewPtr(S^,MessagesWindow);
     end;}
+{    PV:=Application^.Last;
+    while PV<>nil do
+    begin
+      CollectInfo(PV);
+      PV:=PV^.PrevView;
+    end;}
     PV:=Desktop^.Last;
     while PV<>nil do
     begin
@@ -671,7 +681,10 @@ begin
     VOK:=ReadVideoMode(F,VM);
     if VOK and ((VM.Col<>ScreenMode.Col) or
        (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
       OK:=OK and ReadHistory(F);
     if ((DesktopFileFlags and dfWatches)<>0) then
@@ -779,7 +792,10 @@ end;
 END.
 {
   $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
 
   Revision 1.24  2000/03/20 19:19:46  pierre

+ 70 - 5
ide/text/fpide.pas

@@ -131,6 +131,8 @@ type
       procedure UpdateTools;
     end;
 
+procedure PutEvent(TargetView: PView; E: TEvent);
+procedure PutCommand(TargetView: PView; What, Command: Word; InfoPtr: Pointer);
 
 var
   IDEApp: TIDEApp;
@@ -156,6 +158,61 @@ uses
   FPTemplt,FPCalc,FPUsrScr,FPTools,{$ifndef NODEBUG}FPDebug,{$endif}FPRedir,
   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}
 begin
@@ -185,6 +242,7 @@ begin
   InsideDone:=false;
   MenuBar^.GetBounds(R); R.A.X:=R.B.X-8;
   New(ClockView, Init(R));
+  ClockView^.GrowMode:=gfGrowLoX+gfGrowHiX;
   Application^.Insert(ClockView);
   New(ClipboardWindow, Init);
   Desktop^.Insert(ClipboardWindow);
@@ -437,7 +495,11 @@ begin
 end;
 
 procedure TIDEApp.GetEvent(var Event: TEvent);
+var P: PView;
 begin
+  { first of all dispatch queued targeted events }
+  while GetTargetedEvent(P,Event) do
+    P^.HandleEvent(Event);
   inherited GetEvent(Event);
   if Event.What<>evNothing then
     LastEvent:=GetDosTicks
@@ -773,10 +835,10 @@ end;
 
 procedure TIDEApp.UpdateRecentFileList;
 var P: PMenuItem;
-    ID,I: word;
+    {ID,}I: word;
     FileMenu: PMenuItem;
 begin
-  ID:=cmRecentFileBase;
+{  ID:=cmRecentFileBase;}
   FileMenu:=SearchSubMenu(MenuBar^.Menu,menuFile);
   repeat
 {    Inc(ID);
@@ -813,12 +875,12 @@ end;
 
 procedure TIDEApp.UpdateTools;
 var P: PMenuItem;
-    ID,I: word;
+{    ID,}I: word;
     ToolsMenu: PMenuItem;
     S1,S2,S3: string;
     W: word;
 begin
-  ID:=cmToolsBase;
+{  ID:=cmToolsBase;}
   ToolsMenu:=SearchSubMenu(MenuBar^.Menu,menuTools);
   repeat
     P:=GetMenuItemBefore(ToolsMenu^.SubMenu,nil);
@@ -927,7 +989,10 @@ end;
 END.
 {
   $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
 
   Revision 1.55  2000/03/13 20:41:35  pierre

+ 6 - 3
ide/text/fpmrun.inc

@@ -242,7 +242,7 @@ procedure TIDEApp.DoToggleBreak;
 var
   W : PSourceWindow;
   FileName : string;
-  b : boolean;
+{  b : boolean;}
   LineNr : longint;
 {$endif}
 begin
@@ -259,7 +259,7 @@ begin
     begin
       FileName:=W^.Editor^.FileName;
       LineNr:=W^.Editor^.CurPos.Y+1;
-      b:=BreakpointsCollection^.ToggleFileLine(FileName,LineNr);
+{      b:=}BreakpointsCollection^.ToggleFileLine(FileName,LineNr);
       {W^.Editor^.SetLineBreakState(LineNr,b);
         already done PM }
     end;
@@ -270,7 +270,10 @@ end;
 
 {
   $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
 
   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 AddIt(P: PView); {$ifndef FPC}far;{$endif}
 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);
 end;
 begin
@@ -165,7 +168,10 @@ end;
 
 {
   $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
 
   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_modules    = 'Mod~u~les';
       menu_search_globals    = 'G~l~obals';
-      menu_search_symbol     = 'S~y~mbol';
+      menu_search_symbol     = 'S~y~mbol...';
 
       menu_run               = '~R~un';
       menu_run_run           = '~R~un';
@@ -222,7 +222,10 @@ unit fpstring;
 end.
 {
   $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
        FSplit(,n,d,e) (correctly FSplit(,d,n,e))
   [*] 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.
 
  **********************************************************************}
+{$i globdir.inc}
 unit FPSymbol;
 
 interface
 
-uses Objects,Drivers,Views,Dialogs,Outline,
+uses Objects,Drivers,Views,Menus,Dialogs,Outline,
      BrowCol,
+     WViews,
      FPViews;
 
 const
@@ -53,15 +55,23 @@ type
 
 
     PSymbolView = ^TSymbolView;
-    TSymbolView = object(TListBox)
+    TSymbolView = object(TLocalMenuListBox)
       constructor  Init(var Bounds: TRect; AHScrollBar, AVScrollBar: PScrollBar);
       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     GetLocalMenu: PMenu; virtual;
+      procedure    ClearHighlights;
+      procedure    AutoTrackSource; virtual;
+      procedure    Browse; virtual;
+      procedure    GotoSource; virtual;
+      procedure    TrackSource; virtual;
+      procedure    OptionsDlg; virtual;
     private
       MyBW         : PBrowserWindow;
-      function     TrackReference(R: PReference): boolean; virtual;
+      function     TrackReference(R: PReference; AutoTrack: boolean): boolean; virtual;
       function     GotoReference(R: PReference): boolean; virtual;
     end;
 
@@ -74,8 +84,8 @@ type
       procedure   HandleEvent(var Event: TEvent); virtual;
       procedure   Draw; 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
       Symbols: PSymbolCollection;
       SymbolsValue : PGDBValueCollection;
@@ -89,8 +99,9 @@ type
       procedure   HandleEvent(var Event: TEvent); virtual;
       function    GetText(Item,MaxLen: Sw_Integer): String; 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
       References: PReferenceCollection;
     end;
@@ -118,6 +129,7 @@ type
       procedure    Adjust(Node: Pointer; Expand: Boolean); virtual;
       function     IsExpanded(Node: Pointer): Boolean; virtual;
       procedure    Selected(I: Integer); virtual;
+      procedure    HandleEvent(var Event: TEvent); virtual;
       function     GetPalette: PPalette; virtual;
     private
       Root         : PObjectSymbol;
@@ -194,8 +206,8 @@ uses Commands,App,
 {$ifdef BROWSERCOL}
      symconst,
 {$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 SendCloseIfBrowser(P: PView); {$ifndef FPC}far;{$endif}
@@ -438,6 +450,7 @@ end;
 
 procedure TGDBValue.GetValue;
 begin
+{$ifdef BROWSERCOL}
 {$ifndef NODEBUG}
   if not assigned(Debugger) then
     exit;
@@ -453,6 +466,7 @@ begin
       GDBI:=Debugger^.RunCount;
     end;
 {$endif ndef NODEBUG}
+{$endif BROWSERCOL}
 end;
 
 function TGDBValue.GetText : String;
@@ -483,6 +497,54 @@ begin
   if assigned(HScrollBar) then
     HScrollBar^.SetRange(1,80);
   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;
 
 procedure TSymbolView.HandleEvent(var Event: TEvent);
@@ -494,9 +556,11 @@ begin
         DontClear:=false;
         case Event.KeyCode of
           kbEnter :
-            GotoItem(Focused);
+            Browse;
+          kbCtrlEnter :
+            GotoSource;
           kbSpaceBar :
-            TrackItem(Focused);
+            TrackSource;
           kbRight,kbLeft :
             if HScrollBar<>nil then
               HScrollBar^.HandleEvent(Event);
@@ -505,8 +569,37 @@ begin
         if DontClear=false then ClearEvent(Event);
       end;
     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;
   inherited HandleEvent(Event);
 end;
@@ -518,14 +611,27 @@ begin
   GetPalette:=@P;
 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
   SelectItem(Item);
+  GotoItem:=true;
 end;
 
-procedure TSymbolView.TrackItem(Item: sw_integer);
+function TSymbolView.TrackItem(Item: sw_integer; AutoTrack: boolean): boolean;
 begin
   SelectItem(Item);
+  TrackItem:=true;
 end;
 
 function LastBrowserWindow: PBrowserWindow;
@@ -541,15 +647,18 @@ begin
   LastBrowserWindow:=BW;
 end;
 
-function TSymbolView.TrackReference(R: PReference): boolean;
+function TSymbolView.TrackReference(R: PReference; AutoTrack: boolean): boolean;
 var W: PSourceWindow;
     BW: PBrowserWindow;
     P: TPoint;
 begin
-  Message(Desktop,evBroadcast,cmClearLineHighlights,nil);
+  ClearHighlights;
   Desktop^.Lock;
   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
   begin
     BW:=LastBrowserWindow;
@@ -563,6 +672,8 @@ begin
     W^.Editor^.SetLineFlagExclusive(lfHighlightRow,P.Y);
   end;
   Desktop^.UnLock;
+  if Assigned(W)=false then
+    ErrorBox('Can''t find '+R^.GetFileName,nil);
   TrackReference:=W<>nil;
 end;
 
@@ -571,8 +682,11 @@ var W: PSourceWindow;
 begin
   Desktop^.Lock;
   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;
+  if Assigned(W)=false then
+    ErrorBox('Can''t find '+R^.GetFileName,nil);
   GotoReference:=W<>nil;
 end;
 
@@ -651,18 +765,34 @@ begin
   DrawView;
 end;
 
-procedure TSymbolScopeView.GotoItem(Item: sw_integer);
+function TSymbolScopeView.GotoItem(Item: sw_integer): boolean;
+var S: PSymbol;
+    OK: boolean;
 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;
 
-procedure TSymbolScopeView.TrackItem(Item: sw_integer);
+function TSymbolScopeView.TrackItem(Item: sw_integer; AutoTrack: boolean): boolean;
 var S: PSymbol;
+    OK: boolean;
 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;
 
 procedure TSymbolScopeView.SetGDBCol;
@@ -714,11 +844,32 @@ end;
 
 procedure TSymbolReferenceView.HandleEvent(var Event: TEvent);
 var OldFocus: sw_integer;
+    DontClear: boolean;
 begin
   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);
   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;
 
 function TSymbolReferenceView.GetText(Item,MaxLen: Sw_Integer): String;
@@ -730,16 +881,22 @@ begin
   GetText:=copy(S,1,MaxLen);
 end;
 
-procedure TSymbolReferenceView.GotoItem(Item: sw_integer);
+function TSymbolReferenceView.GotoItem(Item: sw_integer): boolean;
+var OK: boolean;
 begin
-  if Range=0 then Exit;
-  GotoReference(List^.At(Item));
+  OK:=Range>0;
+  if OK then
+    OK:=GotoReference(List^.At(Item));
+  GotoItem:=OK;
 end;
 
-procedure TSymbolReferenceView.TrackItem(Item: sw_integer);
+function TSymbolReferenceView.TrackItem(Item: sw_integer; AutoTrack: boolean): boolean;
+var OK: boolean;
 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;
 
 procedure TSymbolReferenceView.SelectItem(Item: Sw_Integer);
@@ -856,6 +1013,28 @@ begin
   IsExpanded:=PObjectSymbol(Node)^.Expanded;
 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;
 const P: string[length(CBrowserOutline)] = CBrowserOutline;
 begin
@@ -1005,6 +1184,7 @@ begin
         DontClear:=false; Idx:=-1;
         for I:=0 to GetItemCount-1 do
           if GetCtrlCode(GetItem(I)^.Sign)=Event.KeyCode then
+           if (Flags and (1 shl I))<>0 then
             begin
               Idx:=I;
               Break;
@@ -1097,7 +1277,9 @@ begin
     end;
   if assigned(AInheritance) then
     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;
       Insert(InheritanceView);
       InheritanceView^.MyBW:=@Self;
@@ -1220,18 +1402,17 @@ begin
 end;
 
 procedure TBrowserWindow.SetState(AState: Word; Enable: Boolean);
-var OldState: word;
+{var OldState: word;}
 begin
-  OldState:=State;
+{  OldState:=State;}
   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
-      Message(Desktop,evBroadcast,cmClearLineHighlights,nil);
+      Message(Desktop,evBroadcast,cmClearLineHighlights,nil);}
 end;
 
 procedure TBrowserWindow.Close;
 begin
-  Message(Desktop,evBroadcast,cmClearLineHighlights,nil);
   inherited Close;
 end;
 
@@ -1370,7 +1551,10 @@ end;
 END.
 {
   $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
 
   Revision 1.23  2000/03/15 10:29:03  pierre

+ 5 - 2
ide/text/fptools.pas

@@ -105,7 +105,7 @@ type
     PMessagesWindow = ^TMessagesWindow;
     TMessagesWindow = object(TFPWindow)
       constructor Init;
-      procedure   Update; {virtual;}
+      procedure   Update; virtual;
       procedure   HandleEvent(var Event: TEvent); virtual;
       function    GetPalette: PPalette; virtual;
       constructor Load(var S: TStream);
@@ -1507,7 +1507,10 @@ end;
 END.
 {
   $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
 
   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.
 
  **********************************************************************}
-
+{$i globdir.inc}
 unit FPUsrScr;
 
 interface
@@ -141,6 +141,9 @@ uses
     ,Go32
     {$endif}
   {$endif}
+  {$ifdef VESA}
+    ,VESA
+  {$endif}
   ;
 
 function TScreen.GetWidth: integer;
@@ -353,7 +356,11 @@ begin
   MI.Mode:=r.al;
   MI.Page:=r.bh;
   MI.Cols:=r.ah;
+{$ifdef VESA}
+  VESAGetMode(MI.Mode);
+{$endif}
   MI.Rows:=MI.ScreenSize div (MI.Cols*2);
+  if MI.Rows=51 then MI.Rows:=50;
   r.ah:=$03;
   r.bh:=MI.Page;
   intr($10,r);
@@ -392,17 +399,31 @@ end;
 
 procedure TDOSScreen.SetVideoMode(MI: TDOSVideoInfo);
 var r: registers;
+    CM: TDOSVideoInfo;
 {$ifdef TP}
     P: pointer;
     Sel: longint;
 {$I realintr.inc}
 {$endif}
 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
-     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;
   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);
@@ -702,7 +723,10 @@ end;
 end.
 {
   $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
 
   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;
 var
   i      : longint;
+{$ifdef Linux}
   NoPath : boolean;
+{$endif}
 begin
-  NoPath:=true;
+  {$ifdef Linux}NoPath:=true;{$endif}
   for i:=length(s) downto 1 do
    begin
      case s[i] of
@@ -662,7 +664,10 @@ end;
 END.
 {
   $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
 
   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;
       LastExitCode     : integer = 0;
       ASCIIChart       : PFPASCIIChart = nil;
+      BackgroundPath   : string{$ifdef GABOR}[80]{$endif} = BackgroundName;
       DesktopPath      : string{$ifdef GABOR}[80]{$endif} = DesktopName;
       DesktopFileFlags : longint = dfHistoryLists+dfOpenWindows+
                                    dfCodeCompleteWords+dfCodeTemplates;
@@ -99,7 +100,10 @@ implementation
 END.
 {
   $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
     + UseMouse variable
 

+ 45 - 8
ide/text/fpviews.pas

@@ -27,7 +27,7 @@ uses
 {$else}
   WEditor,WCEdit,
 {$endif}
-  WUtils,WHelp,WHlpView,WViews,
+  WUtils,WHelp,WHlpView,WViews,WANSI,
   Comphook,
   FPConst,FPUsrScr;
 
@@ -66,7 +66,7 @@ type
       procedure   SetState(AState: Word; Enable: Boolean); virtual;
       constructor Load(var S: TStream);
       procedure   Store(var S: TStream);
-      procedure   Update;
+      procedure   Update; virtual;
     end;
 
     PFPHelpViewer = ^TFPHelpViewer;
@@ -346,6 +346,8 @@ type
 
     PFPDesktop = ^TFPDesktop;
     TFPDesktop = object(TDesktop)
+      constructor Init(var Bounds: TRect);
+      procedure   InitBackground; virtual;
       constructor Load(var S: TStream);
       procedure   Store(var S: TStream);
     end;
@@ -766,8 +768,11 @@ begin
   end;
   Match:=OK;
 end;
+var W: PView;
 begin
-  SearchWindow:=PWindow(Desktop^.FirstThat(@Match));
+  W:=Application^.FirstThat(@Match);
+  if Assigned(W)=false then W:=Desktop^.FirstThat(@Match);
+  SearchWindow:=PWindow(W);
 end;
 
 function SearchFreeWindowNo: integer;
@@ -1003,8 +1008,8 @@ begin
        if is_grouped_action then
          AddToolMessage('','Group '+ActionString[action]+' '+IntToStr(ActionCount)+' elementary actions',0,0)
        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;
   if Core^.RedoList^.count>0 then
     AddToolCommand('RedoList Dump');
@@ -1014,8 +1019,8 @@ begin
        if is_grouped_action then
          AddToolMessage('','Group '+ActionString[action]+' '+IntToStr(ActionCount)+' elementary actions',0,0)
        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;
   UpdateToolMessages;
   if Assigned(MessagesWindow) then
@@ -3107,6 +3112,35 @@ begin
   GetText:=copy(S,1,MaxLen);
 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);
 begin
   inherited Load(S);
@@ -3308,7 +3342,10 @@ end;
 END.
 {
   $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
 
   Revision 1.65  2000/03/21 23:25:16  pierre

+ 15 - 1
ide/text/globdir.inc

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

+ 1 - 2
ide/text/test.pas

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

+ 42 - 11
ide/text/wcedit.pas

@@ -45,10 +45,11 @@ type
       Text        : PString;
       EditorInfos : PEditorLineInfoCollection;
       Flags       : longint;
+      Owner       : PCustomCodeEditorCore;
       procedure AddEditorInfo(Index: sw_integer; AEditor: PCustomCodeEditor); virtual;
       procedure RemoveEditorInfo(AEditor: PCustomCodeEditor); virtual;
     public
-      constructor Init(const AText: string; AFlags: longint);
+      constructor Init(AOwner: PCustomCodeEditorCore; const AText: string; AFlags: longint);
       function    GetText: string; virtual;
       procedure   SetText(const AText: string); virtual;
       function    GetEditorInfo(Editor: PCustomCodeEditor): PEditorLineInfo; virtual;
@@ -266,10 +267,11 @@ const
   );
 {$endif}
 
-constructor TLine.Init(const AText: string; AFlags: longint);
+constructor TLine.Init(AOwner: PCustomCodeEditorCore; const AText: string; AFlags: longint);
 begin
   inherited Init(AText,AFlags);
   New(EditorInfos, Init(10,10));
+  Owner:=AOwner;
 end;
 
 procedure TLine.AddEditorInfo(Index: sw_integer; AEditor: PCustomCodeEditor);
@@ -311,6 +313,8 @@ end;
 procedure TLine.SetFlags(AFlags: longint);
 begin
   Flags:=AFlags;
+  if Assigned(Owner) then
+    Owner^.ContentsChanged;
 end;
 
 destructor TLine.Done;
@@ -482,7 +486,7 @@ begin
   AddCount:=0;
   while (Lines^.Count<I+1) do
    begin
-     LinesInsert(-1,New(PLine, Init('',0)));
+     LinesInsert(-1,New(PLine, Init(@Self,'',0)));
      Inc(AddCount);
    end;
   if AddCount>0 then
@@ -584,12 +588,12 @@ end;
 
 procedure TCodeEditorCore.InsertLine(LineNo: sw_integer; const S: string);
 begin
-  LinesInsert(LineNo, New(PLine, Init(S,0)));
+  LinesInsert(LineNo, New(PLine, Init(@Self,S,0)));
 end;
 
 procedure TCodeEditorCore.AddLine(const S: string);
 begin
-  LinesInsert(-1,New(PLine, Init(S,0)));
+  LinesInsert(-1,New(PLine, Init(@Self,S,0)));
 end;
 
 procedure TCodeEditorCore.AddAction(AAction: byte; AStartPos, AEndPos: TPoint; AText: string);
@@ -1129,11 +1133,26 @@ procedure TCodeEditor.Undo;
 var
   Temp,Idx,Last,Count : Longint;
   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}
 begin
 {$ifdef Undo}
   Core^.SetStoreUndo(False);
   Lock;
+  MinY:=-1;
+  MaxY:=-1;
   if Core^.UndoList^.count > 0 then
   begin
     Last:=Core^.UndoList^.count-1;
@@ -1163,6 +1182,7 @@ begin
                 if assigned(text) then
                   for Temp := 1 to length(Text^) do
                     DelChar;
+                SetMinMax(StartPos.Y);
               end;
             eaDeleteText :
               begin
@@ -1171,22 +1191,26 @@ begin
                 if assigned(text) then
                   for Temp := 1 to length(Text^) do
                     AddChar(Text^[Temp]);
+                SetMinMax(EndPos.Y);
                 SetCurPtr(StartPos.X,StartPos.Y);
               end;
             eaInsertLine :
               begin
                 SetCurPtr(EndPos.X,EndPos.Y);
                 SetDisplayText(EndPos.Y,Copy(GetDisplayText(EndPos.Y),EndPos.X+1,255));
+                SetMinMax(EndPos.Y);
                 BackSpace;
                 SetCurPtr(StartPos.X,StartPos.Y);
+                SetMinMax(StartPos.Y);
               end;
             eaDeleteLine :
               begin
                 SetCurPtr(EndPos.X,EndPos.Y);
-                {DelEnd;wrong for eaCut at least }
+                DelEnd;{ wrong for eaCut at least }
                 InsertNewLine;
                 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;
             eaSelectionChanged :
               begin
@@ -1219,6 +1243,8 @@ begin
         SetCmdState(UndoCmd,false);
       SetCmdState(RedoCmd,true);
       Message(Application,evBroadcast,cmCommandSetChanged,nil);
+      if MinY<>-1 then
+        UpdateAttrsRange(MinY,MaxY,attrAll);
       DrawView;
     end;
   Core^.SetStoreUndo(True);
@@ -1284,9 +1310,10 @@ begin
           begin
             SetCurPtr(StartPos.X,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);
           end;
         eaSelectionChanged :
@@ -1727,4 +1754,8 @@ begin
 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
     Copyright (c) 1998 by Berczi Gabor
 
@@ -748,7 +747,7 @@ end;
 
 function IsWordSeparator(C: char): boolean;
 begin
-  IsWordSeparator:=C in[' ',#0,#255,':','=','''','"','.',',','/',';','$','#','(',')','<','>','^','*','+','-','?','&'];
+  IsWordSeparator:=C in[' ',#0,#255,':','=','''','"','.',',','/',';','$','#','(',')','<','>','^','*','+','-','?','&','[',']'];
 end;
 
 function IsSpace(C: char): boolean;
@@ -2007,11 +2006,9 @@ var
   end;
 
 var CurLine: Sw_integer;
-    Line,NextLine,PrevLine,OldLine: PCustomLine;
-    B: PEditorBinding;
+    Line,NextLine,PrevLine{,OldLine}: PCustomLine;
     PrevLI,LI,NextLI: PEditorLineInfo;
 begin
-  B:=SearchBinding(Editor);
   if (not Editor^.IsFlagSet(efSyntaxHighlight)) or (FromLine>=GetLineCount) then
   begin
     SetLineFormat(Editor,FromLine,'');
@@ -2059,7 +2056,7 @@ begin
        CurrentCommentType:=0;
        InDirective:=false;
      end;
-    OldLine:=Line;
+{    OldLine:=Line;}
     LI^.BeginsWithAsm:=InAsm;
     LI^.BeginsWithComment:=InComment;
     LI^.BeginsWithDirective:=InDirective;
@@ -2793,6 +2790,7 @@ procedure TCustomCodeEditor.SetLineFlagExclusive(Flags: longint; LineNo: sw_inte
 var I,Count: sw_integer;
     L: PCustomLine;
 begin
+  Lock;
   Count:=GetLineCount;
   for I:=0 to Count-1 do
   begin
@@ -2802,6 +2800,7 @@ begin
     else
       L^.SetFlags(L^.GetFlags and (not Flags));
   end;
+  UnLock;
 end;
 
 procedure TCustomCodeEditor.HandleEvent(var Event: TEvent);
@@ -3601,7 +3600,7 @@ begin
   end;
   IndentStr:=CharStr(' ',Ind);
 end;
-var SelBack: sw_integer;
+var {SelBack: sw_integer;}
     SCP: TPoint;
     HoldUndo : Boolean;
 begin
@@ -3613,11 +3612,11 @@ begin
   if CurPos.Y<GetLineCount then S:=GetLineText(CurPos.Y) else S:='';
   if Overwrite=false then
   begin
-    SelBack:=0;
+{    SelBack:=0;}
     if GetLineCount>0 then
     begin
       S:=GetDisplayText(CurPos.Y);
-      SelBack:=length(S)-SelEnd.X;
+{      SelBack:=length(S)-SelEnd.X;}
       SetDisplayText(CurPos.Y,RTrim(S,not IsFlagSet(efUseTabCharacters)));
     end;
     SetDisplayText(CurPos.Y,copy(S,1,CurPos.X-1+1));
@@ -3950,43 +3949,52 @@ begin
   LineCount:=(SelEnd.Y-SelStart.Y)+1;
   LineDelta:=0; LastX:=CurPos.X;
   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;
   SetCurPtr(LastX,CurLine-1);
   UpdateAttrs(CurPos.Y,attrAll);
@@ -4890,14 +4898,14 @@ begin
 end;
 
 procedure TCustomCodeEditor.SetCurPtr(X,Y: sw_integer);
-var OldPos,OldSEnd,OldSStart: TPoint;
+var OldPos,{OldSEnd,}OldSStart: TPoint;
     Extended: boolean;
 begin
   Lock;
   X:=Max(0,Min(MaxLineLength+1,X));
   Y:=Max(0,Min(GetLineCount-1,Y));
   OldPos:=CurPos;
-  OldSEnd:=SelEnd;
+{  OldSEnd:=SelEnd;}
   OldSStart:=SelStart;
   CurPos.X:=X;
   CurPos.Y:=Y;
@@ -5488,7 +5496,7 @@ begin
         if (Length(FileDir)>1) and (FileDir[2]=':') then
           begin
             { 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
             else
               DriveNumber:=Ord(FileDir[1])-ord('A')+1;
@@ -5522,7 +5530,12 @@ begin
         Re:=Application^.ExecuteDialog(New(PFileDialog, Init(DefExt,
           Title, '~N~ame', fdOkButton, FileId)), @Name);
         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;
           edReadBlock  : AskOW:=false;
         else AskOW:=true;
@@ -5587,7 +5600,10 @@ end;
 END.
 {
   $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
 
   Revision 1.85  2000/03/21 23:17:47  pierre

+ 14 - 4
ide/text/whelp.pas

@@ -440,12 +440,11 @@ end;
 
 procedure THelpFile.MaintainTopicCache;
 var Count: sw_integer;
-    MinP: PTopic;
     MinLRU: longint;
 procedure CountThem(P: PTopic); {$ifndef FPC}far;{$endif}
 begin if (P^.Text<>nil) or (P^.Links<>nil) then Inc(Count); end;
 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;
 begin
   Count:=0; Topics^.ForEach(@CountThem);
@@ -494,7 +493,15 @@ begin
       rtIndex       : begin IndexTablePos:=L; {OK:=ReadIndexTable; }end;
       rtCompression : begin F^.Seek(L); OK:=ReadCompression; 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;
     if OK then
        begin Inc(L, SizeOf(THLPRecordHeader)); Inc(L, R.Size); F^.Seek(L); OK:=(F^.Status=stOK); end
@@ -970,7 +977,10 @@ end;
 END.
 {
   $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
 
   Revision 1.16  2000/01/03 14:59:03  marco

+ 13 - 2
ide/text/whlpview.pas

@@ -104,7 +104,7 @@ type
         destructor  Done; virtual;
       private
         Width,Margin: sw_integer;
-        StockItem: boolean;
+{        StockItem: boolean;}
         procedure  ReBuild;
       end;
 
@@ -951,6 +951,14 @@ var NormalColor, LinkColor,
     C: word;
     CurP: TPoint;
 begin
+  if LockFlag>0 then
+    begin
+      DrawCalled:=true;
+      Exit;
+    end;
+  DrawCalled:=false;
+
+
   NormalColor:=GetColor(1); LinkColor:=GetColor(2);
   SelectColor:=GetColor(3); SelectionColor:=GetColor(4);
 {$ifndef EDITORS}
@@ -1139,7 +1147,10 @@ end;
 END.
 {
   $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
 
   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.
 
  **********************************************************************}
+{$i globdir.inc}
 unit WinClip;
 
 interface
 
-{$i globdir.inc}
 {$ifdef WinClipSupported}
 
 function WinClipboardSupported : boolean;
@@ -32,20 +32,23 @@ function SetTextWinClipBoardData(p : pchar;l : longint) : boolean;
 implementation
 
 {$ifdef WinClipSupported}
-{$ifdef go32v2}
+{$ifdef DOS}
   uses
-    strings,go32;
+{$ifdef go32v2}
+    go32,{ sorry Gabor, but its still not compiling without that ! }
 {$endif go32v2}
+    strings,dos,pmode;
+{$endif DOS}
 
 {$ifdef win32}
   uses
     strings,windows;
 {$endif win32}
 
-{$ifdef go32v2}
+{$ifdef DOS}
 function WinClipboardSupported : boolean;
 var
-  r : Registers;
+  r : registers;
 begin
   r.ax:=$1700;
   RealIntr($2F,r);
@@ -88,7 +91,7 @@ begin
   RealIntr($2F,r);
   InternGetDataSize:=(r.dx shl 16) + r.ax;
 end;
-{$endif go32v2}
+{$endif DOS}
 
 {$ifdef win32}
 function WinClipboardSupported : boolean;
@@ -135,11 +138,11 @@ end;
 
 function GetTextWinClipBoardData(var p : pchar;var l : longint) : boolean;
 var
-{$ifdef go32v2}
+{$ifdef DOS}
   r : Registers;
   tb_all : longint;
   tb_seg,tb_ofs,tb_sel : word;
-{$endif go32v2}
+{$endif DOS}
 {$ifdef win32}
   h : HGlobal;
   pp : pchar;
@@ -208,11 +211,11 @@ end;
 
 function SetTextWinClipBoardData(p : pchar;l : longint) : boolean;
 var
-{$ifdef go32v2}
+{$ifdef DOS}
   r : Registers;
   tb_all : longint;
   tb_seg,tb_ofs,tb_sel : word;
-{$endif go32v2}
+{$endif DOS}
 {$ifdef win32}
   h : HGlobal;
   pp : pchar;
@@ -270,7 +273,10 @@ end.
 
 {
  $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
      OEM to ANSI conversion
    * GetClipboardDataSize for Win32
@@ -278,4 +284,4 @@ end.
  Revision 1.3  1999/10/14 14:22:23  florian
    * 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);
       destructor  Done; virtual;
     private
-      ReadOnly: boolean;
+{      ReadOnly: boolean;}
       Sections: PCollection;
       FileName: PString;
     end;
@@ -478,7 +478,10 @@ end;
 END.
 {
   $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
 
   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.
 
  **********************************************************************}
-unit WResource;
+unit WResourc;
 
 interface
 
@@ -791,7 +791,10 @@ end;
 END.
 {
   $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
        FSplit(,n,d,e) (correctly FSplit(,d,n,e))
   [*] CodeComplete had a very ugly bug - coordinates were document-relative

+ 32 - 17
ide/text/wutils.pas

@@ -25,7 +25,7 @@ uses
 
 type
   PByteArray = ^TByteArray;
-  TByteArray = array[0..65520] of byte;
+  TByteArray = array[0..MaxBytes] of byte;
 
   PNoDisposeCollection = ^TNoDisposeCollection;
   TNoDisposeCollection = object(TCollection)
@@ -91,6 +91,7 @@ function RTrim(const S: string): string;
 function Trim(const S: string): string;
 function IntToStr(L: longint): string;
 function StrToInt(const S: string): longint;
+function IntToHex(L: longint): string;
 function GetStr(P: PString): string;
 function GetPChar(P: PChar): string;
 function BoolToStr(B: boolean; const TrueS, FalseS: string): string;
@@ -236,18 +237,6 @@ begin
   UpcaseStr[0]:=S[0];
 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;
 begin
   if length(S)<MinLen then
@@ -298,6 +287,29 @@ begin
   StrToInt:=L;
 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;
 begin
   if P=nil then GetStr:='' else GetStr:=P^;
@@ -596,7 +608,7 @@ end;
 function TTextCollection.LookUp(const S: string; var Idx: sw_integer): string;
 var OLI,ORI,Left,Right,Mid: integer;
     LeftP,RightP,MidP: PString;
-    LeftS,MidS,RightS: string;
+    {LeftS,}MidS{,RightS}: string;
     FoundS: string;
     UpS : string;
 begin
@@ -610,8 +622,8 @@ begin
       OLI:=Left; ORI:=Right;
       Mid:=Left+(Right-Left) div 2;
       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
         begin
           Idx:=Mid; FoundS:=GetStr(MidP);
@@ -679,7 +691,10 @@ end;
 END.
 {
   $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
 
   Revision 1.17  2000/03/20 19:19:45  pierre

+ 7 - 6
ide/text/wviews.pas

@@ -274,10 +274,8 @@ procedure TrackMouse;
 var
   Mouse: TPoint;
   R: TRect;
-  OldC: PMenuItem;
 begin
   MakeLocal(E.Where, Mouse);
-  OldC:=Current;
   Current := Menu^.Items;
   while Current <> nil do
   begin
@@ -291,7 +289,7 @@ begin
   end;
   if (Current<>nil) and IsDisabled(Current) then
   begin
-     Current:={OldC}nil;
+     Current:=nil;
      MouseActive:=false;
   end;
 end;
@@ -1610,9 +1608,9 @@ begin
 end;
 
 procedure TDDHelperLB.SetState(AState: Word; Enable: Boolean);
-var OState: longint;
+{var OState: longint;}
 begin
-  OState:=State;
+{  OState:=State;}
   inherited SetState(AState,Enable);
 {  if (((State xor OState) and sfFocused)<>0) and (GetState(sfFocused)=false) then
     Link^.DropList(false);}
@@ -2079,7 +2077,10 @@ end;
 END.
 {
   $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
 
   Revision 1.10  1999/08/03 20:22:46  peter