Browse Source

adapted to wcedit addition

pierre 25 years ago
parent
commit
0a2e9c3bbd
3 changed files with 140 additions and 50 deletions
  1. 9 3
      ide/text/fpsymbol.pas
  2. 124 43
      ide/text/fpviews.pas
  3. 7 4
      ide/text/whlpview.pas

+ 9 - 3
ide/text/fpsymbol.pas

@@ -39,11 +39,12 @@ type
       constructor Init(Const AExpr : String;ASym : PSymbol);
       constructor Init(Const AExpr : String;ASym : PSymbol);
       procedure GetValue;
       procedure GetValue;
       function  GetText : String;
       function  GetText : String;
+      destructor Done;virtual;
+    private
       expr : Pstring;
       expr : Pstring;
       St   : Pstring;
       St   : Pstring;
       S    : PSymbol;
       S    : PSymbol;
       GDBI : longint;
       GDBI : longint;
-      destructor Done;virtual;
       end;
       end;
 
 
     TGDBValueCollection = Object(TCollection)
     TGDBValueCollection = Object(TCollection)
@@ -559,7 +560,7 @@ begin
         Desktop^.Delete(W);
         Desktop^.Delete(W);
         Desktop^.InsertBefore(W,BW^.NextView);
         Desktop^.InsertBefore(W,BW^.NextView);
       end;
       end;
-    W^.Editor^.SetHighlightRow(P.Y);
+    W^.Editor^.SetLineFlagExclusive(lfHighlightRow,P.Y);
   end;
   end;
   Desktop^.UnLock;
   Desktop^.UnLock;
   TrackReference:=W<>nil;
   TrackReference:=W<>nil;
@@ -1358,8 +1359,10 @@ begin
   PB:=New(PBrowserWindow, Init(R,
   PB:=New(PBrowserWindow, Init(R,
     st2,SearchFreeWindowNo,S,Line,st,
     st2,SearchFreeWindowNo,S,Line,st,
     Symbols,References,Inheritance,MemInfo));
     Symbols,References,Inheritance,MemInfo));
+{$ifndef GABOR}
   if (S^.typ=varsym) or (assigned(ParentBrowser) and ParentBrowser^.IsValid) then
   if (S^.typ=varsym) or (assigned(ParentBrowser) and ParentBrowser^.IsValid) then
      PB^.IsValid:=true;
      PB^.IsValid:=true;
+{$endif}
 
 
   Desktop^.Insert(PB);
   Desktop^.Insert(PB);
 end;
 end;
@@ -1367,7 +1370,10 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.23  2000-03-15 10:29:03  pierre
+  Revision 1.24  2000-03-21 23:26:55  pierre
+   adapted to wcedit addition
+
+  Revision 1.23  2000/03/15 10:29:03  pierre
    * TGDBValue object
    * TGDBValue object
 
 
   Revision 1.22  2000/03/08 16:53:21  pierre
   Revision 1.22  2000/03/08 16:53:21  pierre

+ 124 - 43
ide/text/fpviews.pas

@@ -25,7 +25,7 @@ uses
 {$ifdef EDITORS}
 {$ifdef EDITORS}
   Editors,
   Editors,
 {$else}
 {$else}
-  WEditor,
+  WEditor,WCEdit,
 {$endif}
 {$endif}
   WUtils,WHelp,WHlpView,WViews,
   WUtils,WHelp,WHlpView,WViews,
   Comphook,
   Comphook,
@@ -80,8 +80,8 @@ type
       constructor Init(var Bounds: TRect; ATitle: TTitleStr; ASourceFileID: word; AContext: THelpCtx; ANumber: Integer);
       constructor Init(var Bounds: TRect; ATitle: TTitleStr; ASourceFileID: word; AContext: THelpCtx; ANumber: Integer);
       destructor  Done;virtual;
       destructor  Done;virtual;
       procedure   InitHelpView; virtual;
       procedure   InitHelpView; virtual;
-      procedure   Show; virtual;
-      procedure   Hide; virtual;
+      procedure   Show; {virtual;}
+      procedure   Hide; {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);
@@ -173,7 +173,7 @@ type
 
 
     PGDBSourceEditor = ^TGDBSourceEditor;
     PGDBSourceEditor = ^TGDBSourceEditor;
     TGDBSourceEditor = object(TSourceEditor)
     TGDBSourceEditor = object(TSourceEditor)
-      function   InsertLine : Sw_integer;virtual;
+      function   InsertNewLine : Sw_integer;virtual;
       function   Valid(Command: Word): Boolean; virtual;
       function   Valid(Command: Word): Boolean; virtual;
       procedure  AddLine(const S: string); virtual;
       procedure  AddLine(const S: string); virtual;
       procedure  AddErrorLine(const S: string); virtual;
       procedure  AddErrorLine(const S: string); virtual;
@@ -353,7 +353,7 @@ type
     PFPCodeMemo = ^TFPCodeMemo;
     PFPCodeMemo = ^TFPCodeMemo;
     TFPCodeMemo = object(TCodeEditor)
     TFPCodeMemo = object(TCodeEditor)
       constructor Init(var Bounds: TRect; AHScrollBar, AVScrollBar:
       constructor Init(var Bounds: TRect; AHScrollBar, AVScrollBar:
-                    PScrollBar; AIndicator: PIndicator; ABufSize:Sw_Word);
+                    PScrollBar; AIndicator: PIndicator);
       function    IsReservedWord(const S: string): boolean; virtual;
       function    IsReservedWord(const S: string): boolean; virtual;
       function    GetSpecSymbolCount(SpecClass: TSpecSymbolClass): integer; virtual;
       function    GetSpecSymbolCount(SpecClass: TSpecSymbolClass): integer; virtual;
       function    GetSpecSymbol(SpecClass: TSpecSymbolClass; Index: integer): string; virtual;
       function    GetSpecSymbol(SpecClass: TSpecSymbolClass; Index: integer): string; virtual;
@@ -382,8 +382,13 @@ procedure TranslateMouseClick(View: PView; var Event: TEvent);
 
 
 function GetNextEditorBounds(var Bounds: TRect): boolean;
 function GetNextEditorBounds(var Bounds: TRect): boolean;
 function OpenEditorWindow(Bounds: PRect; FileName: string; CurX,CurY: sw_integer): PSourceWindow;
 function OpenEditorWindow(Bounds: PRect; FileName: string; CurX,CurY: sw_integer): PSourceWindow;
+function IOpenEditorWindow(Bounds: PRect; FileName: string; CurX,CurY: sw_integer; ShowIt: boolean): PSourceWindow;
 function SearchOnDesktop(FileName : string;tryexts:boolean) : PSourceWindow;
 function SearchOnDesktop(FileName : string;tryexts:boolean) : PSourceWindow;
-function TryToOpenFile(Bounds: PRect; FileName: string; CurX,CurY: sw_integer;tryexts:boolean): PSourceWindow;
+function TryToOpenFile(Bounds: PRect; FileName: string; CurX,CurY: sw_integer;tryexts: boolean): PSourceWindow;
+function ITryToOpenFile(Bounds: PRect; FileName: string; CurX,CurY: sw_integer;tryexts, ShowIt,
+         ForceNewWindow:boolean): PSourceWindow;
+
+function SearchWindow(const Title: string): PWindow;
 
 
 function StartEditor(Editor: PCodeEditor; FileName: string): boolean;
 function StartEditor(Editor: PCodeEditor; FileName: string): boolean;
 
 
@@ -737,6 +742,34 @@ begin
   SearchWindowWithNo:=P;
   SearchWindowWithNo:=P;
 end;
 end;
 
 
+function SearchWindow(const Title: string): PWindow;
+function Match(P: PView): boolean; {$ifndef FPC}far;{$endif}
+var W: PWindow;
+    OK: boolean;
+begin
+  W:=nil;
+  if (P^.HelpCtx=hcSourceWindow) or
+     (P^.HelpCtx=hcHelpWindow) or
+     (P^.HelpCtx=hcClipboardWindow) or
+     (P^.HelpCtx=hcCalcWindow) or
+     (P^.HelpCtx=hcInfoWindow) or
+     (P^.HelpCtx=hcBrowserWindow) or
+     (P^.HelpCtx=hcMessagesWindow) or
+     (P^.HelpCtx=hcGDBWindow) or
+     (P^.HelpCtx=hcBreakpointListWindow) or
+     (P^.HelpCtx=hcASCIITableWindow)
+    then W:=PWindow(P);
+  OK:=(W<>nil);
+  if OK then
+  begin
+    OK:=CompareText(W^.GetTitle(255),Title)=0;
+  end;
+  Match:=OK;
+end;
+begin
+  SearchWindow:=PWindow(Desktop^.FirstThat(@Match));
+end;
+
 function SearchFreeWindowNo: integer;
 function SearchFreeWindowNo: integer;
 var No: integer;
 var No: integer;
 begin
 begin
@@ -754,7 +787,8 @@ end;
 
 
 constructor TIntegerLine.Init(var Bounds: TRect; AMin, AMax: longint);
 constructor TIntegerLine.Init(var Bounds: TRect; AMin, AMax: longint);
 begin
 begin
-  inherited Init(Bounds, Bounds.B.X-Bounds.A.X-1);
+  if inherited Init(Bounds, Bounds.B.X-Bounds.A.X-1)=false then
+    Fail;
   Validator:=New(PRangeValidator, Init(AMin, AMax));
   Validator:=New(PRangeValidator, Init(AMin, AMax));
 end;
 end;
 
 
@@ -764,11 +798,34 @@ end;
 *****************************************************************************}
 *****************************************************************************}
 
 
 {$ifndef EDITORS}
 {$ifndef EDITORS}
+
+function SearchCoreForFileName(const AFileName: string): PCodeEditorCore;
+var EC: PCodeEditorCore;
+function Check(P: PView): boolean; {$ifndef FPC}far;{$endif}
+var OK: boolean;
+begin
+  OK:=P^.HelpCtx=hcSourceWindow;
+  if OK then
+  with PSourceWindow(P)^ do
+  if CompareText(Editor^.FileName,AFileName)=0 then
+  begin
+    EC:=Editor^.Core;
+  end;
+  Check:=OK;
+end;
+begin
+  EC:=nil;
+  Desktop^.FirstThat(@Check);
+  SearchCoreForFileName:=EC;
+end;
+
 constructor TSourceEditor.Init(var Bounds: TRect; AHScrollBar, AVScrollBar:
 constructor TSourceEditor.Init(var Bounds: TRect; AHScrollBar, AVScrollBar:
           PScrollBar; AIndicator: PIndicator;const AFileName: string);
           PScrollBar; AIndicator: PIndicator;const AFileName: string);
+var EC: PCodeEditorCore;
 begin
 begin
-  inherited Init(Bounds,AHScrollBar,AVScrollBar,AIndicator,AFileName);
-  StoreUndo:=true;
+  EC:=SearchCoreForFileName(AFileName);
+  inherited Init(Bounds,AHScrollBar,AVScrollBar,AIndicator,EC,AFileName);
+  SetStoreUndo(true);
 end;
 end;
 
 
 function TSourceEditor.GetSpecSymbolCount(SpecClass: TSpecSymbolClass): integer;
 function TSourceEditor.GetSpecSymbolCount(SpecClass: TSpecSymbolClass): integer;
@@ -899,7 +956,7 @@ end;
 procedure TSourceEditor.ModifiedChanged;
 procedure TSourceEditor.ModifiedChanged;
 begin
 begin
   inherited ModifiedChanged;
   inherited ModifiedChanged;
-  if (@Self<>Clipboard) and Modified then
+  if (@Self<>Clipboard) and GetModified then
     EditorModified:=true;
     EditorModified:=true;
 end;
 end;
 
 
@@ -940,8 +997,8 @@ var
 begin
 begin
   ClearToolMessages;
   ClearToolMessages;
   AddToolCommand('UndoList Dump');
   AddToolCommand('UndoList Dump');
-  for i:=0 to UndoList^.count-1 do
-    with UndoList^.At(i)^ do
+  for i:=0 to Core^.UndoList^.count-1 do
+    with Core^.UndoList^.At(i)^ do
       begin
       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)
@@ -949,10 +1006,10 @@ begin
          AddToolMessage('',ActionString[action]+' '+IntToStr(StartPos.X)+':'+IntToStr(StartPos.Y)+
          AddToolMessage('',ActionString[action]+' '+IntToStr(StartPos.X)+':'+IntToStr(StartPos.Y)+
            ' '+IntToStr(EndPos.X)+':'+IntToStr(EndPos.Y)+' "'+GetStr(Text)+'"',0,0);
            ' '+IntToStr(EndPos.X)+':'+IntToStr(EndPos.Y)+' "'+GetStr(Text)+'"',0,0);
       end;
       end;
-  if RedoList^.count>0 then
+  if Core^.RedoList^.count>0 then
     AddToolCommand('RedoList Dump');
     AddToolCommand('RedoList Dump');
-  for i:=0 to RedoList^.count-1 do
-    with RedoList^.At(i)^ do
+  for i:=0 to Core^.RedoList^.count-1 do
+    with Core^.RedoList^.At(i)^ do
       begin
       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)
@@ -967,13 +1024,13 @@ end;
 
 
 procedure TSourceEditor.UndoAll;
 procedure TSourceEditor.UndoAll;
 begin
 begin
-  While UndoList^.count>0 do
+  While Core^.UndoList^.count>0 do
     Undo;
     Undo;
 end;
 end;
 
 
 procedure TSourceEditor.RedoAll;
 procedure TSourceEditor.RedoAll;
 begin
 begin
-  While RedoList^.count>0 do
+  While Core^.RedoList^.count>0 do
     Redo;
     Redo;
 end;
 end;
 
 
@@ -1033,7 +1090,7 @@ end;
 
 
 constructor TFPHeapView.Init(var Bounds: TRect);
 constructor TFPHeapView.Init(var Bounds: TRect);
 begin
 begin
-  inherited Init(Bounds);
+  if inherited Init(Bounds)=false then Fail;
   Options:=Options or gfGrowHiX or gfGrowHiY;
   Options:=Options or gfGrowHiX or gfGrowHiY;
   EventMask:=EventMask or evIdle;
   EventMask:=EventMask or evIdle;
   GrowMode:=gfGrowAll;
   GrowMode:=gfGrowAll;
@@ -1041,7 +1098,7 @@ end;
 
 
 constructor TFPHeapView.InitKb(var Bounds: TRect);
 constructor TFPHeapView.InitKb(var Bounds: TRect);
 begin
 begin
-  inherited InitKb(Bounds);
+  if inherited InitKb(Bounds)=false then Fail;
   Options:=Options or gfGrowHiX or gfGrowHiY;
   Options:=Options or gfGrowHiX or gfGrowHiY;
   EventMask:=EventMask or evIdle;
   EventMask:=EventMask or evIdle;
   GrowMode:=gfGrowAll;
   GrowMode:=gfGrowAll;
@@ -1241,11 +1298,11 @@ begin
     begin
     begin
       if Editor^.LoadFile=false then
       if Editor^.LoadFile=false then
         ErrorBox(#3'Error reading file.',nil)
         ErrorBox(#3'Error reading file.',nil)
-      else if Editor^.Modified then
+      else if Editor^.GetModified then
         begin
         begin
           PA[1]:=@AFileName;
           PA[1]:=@AFileName;
-          longint(PA[2]):=Editor^.ChangedLine;
-          EditorDialog(edChangedOnloading,@PA);
+(*          longint(PA[2]):=Editor^.ChangedLine;
+          EditorDialog(edChangedOnloading,@PA);*)
         end;
         end;
    end;
    end;
   Insert(Editor);
   Insert(Editor);
@@ -1256,9 +1313,18 @@ end;
 
 
 procedure TSourceWindow.UpdateTitle;
 procedure TSourceWindow.UpdateTitle;
 var Name: string;
 var Name: string;
+    Count: sw_integer;
 begin
 begin
   if Editor^.FileName<>'' then
   if Editor^.FileName<>'' then
-  begin Name:=SmartPath(Editor^.FileName); SetTitle(Name); end;
+  begin
+    Name:=SmartPath(Editor^.FileName);
+    Count:=Editor^.Core^.GetBindingCount;
+    if Count>1 then
+    begin
+      Name:=Name+':'+IntToStr(Editor^.Core^.GetBindingIndex(Editor)+1);
+    end;
+    SetTitle(Name);
+  end;
 end;
 end;
 
 
 procedure TSourceWindow.SetTitle(ATitle: string);
 procedure TSourceWindow.SetTitle(ATitle: string);
@@ -1288,10 +1354,10 @@ begin
         case Event.Command of
         case Event.Command of
           cmSave :
           cmSave :
             if Editor^.IsClipboard=false then
             if Editor^.IsClipboard=false then
-            Editor^.Save;
+              Editor^.Save;
           cmSaveAs :
           cmSaveAs :
             if Editor^.IsClipboard=false then
             if Editor^.IsClipboard=false then
-            Editor^.SaveAs;
+              Editor^.SaveAs;
         else DontClear:=true;
         else DontClear:=true;
         end;
         end;
         if DontClear=false then ClearEvent(Event);
         if DontClear=false then ClearEvent(Event);
@@ -1414,16 +1480,16 @@ begin
    if Silent then exit;
    if Silent then exit;
    inherited AddLine(S);
    inherited AddLine(S);
    { display like breakpoints in red }
    { display like breakpoints in red }
-   Lines^.At(GetLineCount-1)^.IsBreakpoint:=true;
+   SetLineFlagState(GetLineCount-1,lfBreakpoint,true);
    LimitsChanged;
    LimitsChanged;
 end;
 end;
 
 
-function TGDBSourceEditor.InsertLine: Sw_integer;
+function TGDBSourceEditor.InsertNewLine: Sw_integer;
 Var
 Var
   S : string;
   S : string;
 
 
 begin
 begin
-  if IsReadOnly then begin InsertLine:=-1; Exit; end;
+  if IsReadOnly then begin InsertNewLine:=-1; Exit; end;
   if CurPos.Y<GetLineCount then S:=GetDisplayText(CurPos.Y) else S:='';
   if CurPos.Y<GetLineCount then S:=GetDisplayText(CurPos.Y) else S:='';
   s:=Copy(S,1,CurPos.X);
   s:=Copy(S,1,CurPos.X);
   if assigned(Debugger) then
   if assigned(Debugger) then
@@ -1438,7 +1504,7 @@ begin
       end
       end
     else if AutoRepeat then
     else if AutoRepeat then
       Debugger^.Command(LastCommand);
       Debugger^.Command(LastCommand);
-  InsertLine:=inherited InsertLine;
+  InsertNewLine:=inherited InsertNewLine;
 end;
 end;
 
 
 
 
@@ -1761,7 +1827,7 @@ begin
     begin
     begin
       W^.Select;
       W^.Select;
       W^.Editor^.TrackCursor(true);
       W^.Editor^.TrackCursor(true);
-      W^.Editor^.SetHighlightRow(Row);
+      W^.Editor^.SetLineFlagExclusive(lfHighlightRow,Row);
     end;
     end;
   if Assigned(Owner) then
   if Assigned(Owner) then
     Owner^.Select;
     Owner^.Select;
@@ -2577,7 +2643,7 @@ begin
   GetNextEditorBounds:=P<>nil;
   GetNextEditorBounds:=P<>nil;
 end;
 end;
 
 
-function OpenEditorWindow(Bounds: PRect; FileName: string; CurX,CurY: sw_integer): PSourceWindow;
+function IOpenEditorWindow(Bounds: PRect; FileName: string; CurX,CurY: sw_integer; ShowIt: boolean): PSourceWindow;
 var R: TRect;
 var R: TRect;
     W: PSourceWindow;
     W: PSourceWindow;
 begin
 begin
@@ -2585,6 +2651,8 @@ begin
     GetNextEditorBounds(R);
     GetNextEditorBounds(R);
   PushStatus('Opening source file... ('+SmartPath(FileName)+')');
   PushStatus('Opening source file... ('+SmartPath(FileName)+')');
   New(W, Init(R, FileName));
   New(W, Init(R, FileName));
+  if ShowIt=false then
+    W^.Hide;
   if W<>nil then
   if W<>nil then
   begin
   begin
     if (CurX<>0) or (CurY<>0) then
     if (CurX<>0) or (CurY<>0) then
@@ -2598,18 +2666,19 @@ begin
     Message(Application,evBroadcast,cmUpdate,nil);
     Message(Application,evBroadcast,cmUpdate,nil);
   end;
   end;
   PopStatus;
   PopStatus;
-  OpenEditorWindow:=W;
+  IOpenEditorWindow:=W;
+end;
+
+function OpenEditorWindow(Bounds: PRect; FileName: string; CurX,CurY: sw_integer): PSourceWindow;
+begin
+  OpenEditorWindow:=IOpenEditorWindow(Bounds,FileName,CurX,CurY,true);
 end;
 end;
 
 
 function SearchOnDesktop(FileName : string;tryexts:boolean) : PSourceWindow;
 function SearchOnDesktop(FileName : string;tryexts:boolean) : PSourceWindow;
 var
 var
-    V: PView;
-    W: PWindow;
-    I: integer;
     D,DS : DirStr;
     D,DS : DirStr;
     N,NS : NameStr;
     N,NS : NameStr;
     E,ES : ExtStr;
     E,ES : ExtStr;
-    Found : boolean;
     SName : string;
     SName : string;
 
 
 function IsSearchedFile(W : PSourceWindow) : boolean;
 function IsSearchedFile(W : PSourceWindow) : boolean;
@@ -2656,6 +2725,12 @@ begin
 end;
 end;
 
 
 function TryToOpenFile(Bounds: PRect; FileName: string; CurX,CurY: sw_integer;tryexts:boolean): PSourceWindow;
 function TryToOpenFile(Bounds: PRect; FileName: string; CurX,CurY: sw_integer;tryexts:boolean): PSourceWindow;
+begin
+  TryToOpenFile:=ITryToOpenFile(Bounds,FileName,CurX,CurY,tryexts,true,false);
+end;
+
+function ITryToOpenFile(Bounds: PRect; FileName: string; CurX,CurY: sw_integer;tryexts:boolean;
+         ShowIt,ForceNewWindow: boolean): PSourceWindow;
 var D : DirStr;
 var D : DirStr;
     N : NameStr;
     N : NameStr;
     E : ExtStr;
     E : ExtStr;
@@ -2703,7 +2778,7 @@ var D : DirStr;
     else
     else
       begin
       begin
         FileName:=FExpand(D+N+E);
         FileName:=FExpand(D+N+E);
-        W:=OpenEditorWindow(Bounds,FileName,CurX,CurY);
+        W:=IOpenEditorWindow(Bounds,FileName,CurX,CurY,ShowIt);
       end;
       end;
     TryToOpen:=W;
     TryToOpen:=W;
   end;
   end;
@@ -2711,7 +2786,10 @@ var D : DirStr;
 var
 var
   W : PSourceWindow;
   W : PSourceWindow;
 begin
 begin
-  W:=SearchOnDesktop(FileName,tryexts);
+  if ForceNewWindow then
+    W:=nil
+  else
+    W:=SearchOnDesktop(FileName,tryexts);
   if W<>nil then
   if W<>nil then
     begin
     begin
       NewEditorOpened:=false;
       NewEditorOpened:=false;
@@ -2736,7 +2814,7 @@ begin
       if assigned(W) then
       if assigned(W) then
         W^.Editor^.SetCurPtr(CurX,CurY);
         W^.Editor^.SetCurPtr(CurX,CurY);
     end;
     end;
-  TryToOpenFile:=W;
+  ITryToOpenFile:=W;
 end;
 end;
 
 
 function StartEditor(Editor: PCodeEditor; FileName: string): boolean;
 function StartEditor(Editor: PCodeEditor; FileName: string): boolean;
@@ -2745,7 +2823,7 @@ var OK: boolean;
     R: TRect;
     R: TRect;
 begin
 begin
   R.Assign(0,0,0,0);
   R.Assign(0,0,0,0);
-  New(E, Init(R,nil,nil,nil,FileName));
+  New(E, Init(R,nil,nil,nil,nil,FileName));
   OK:=E<>nil;
   OK:=E<>nil;
   if OK then OK:=E^.LoadFile;
   if OK then OK:=E^.LoadFile;
   if OK then
   if OK then
@@ -3109,9 +3187,9 @@ begin
 end;
 end;
 
 
 constructor TFPCodeMemo.Init(var Bounds: TRect; AHScrollBar, AVScrollBar:
 constructor TFPCodeMemo.Init(var Bounds: TRect; AHScrollBar, AVScrollBar:
-          PScrollBar; AIndicator: PIndicator; ABufSize:Sw_Word);
+          PScrollBar; AIndicator: PIndicator);
 begin
 begin
-  inherited Init(Bounds,AHScrollBar,AVScrollBar,AIndicator,ABufSize);
+  inherited Init(Bounds,AHScrollBar,AVScrollBar,AIndicator,nil);
   SetFlags(Flags and not (efPersistentBlocks) or efSyntaxHighlight);
   SetFlags(Flags and not (efPersistentBlocks) or efSyntaxHighlight);
 end;
 end;
 
 
@@ -3227,7 +3305,10 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.64  2000-03-14 13:59:41  pierre
+  Revision 1.65  2000-03-21 23:25:16  pierre
+   adapted to wcedit addition
+
+  Revision 1.64  2000/03/14 13:59:41  pierre
    + add a warning if Changed on loading
    + add a warning if Changed on loading
 
 
   Revision 1.63  2000/03/13 20:39:25  pierre
   Revision 1.63  2000/03/13 20:39:25  pierre

+ 7 - 4
ide/text/whlpview.pas

@@ -22,7 +22,7 @@ uses
 {$ifdef EDITORS}
 {$ifdef EDITORS}
   Editors,
   Editors,
 {$else}
 {$else}
-  WEditor,
+  WEditor,WCEdit,
 {$endif}
 {$endif}
   WUtils,WHelp;
   WUtils,WHelp;
 
 
@@ -542,8 +542,8 @@ end;
 
 
 constructor THelpViewer.Init(var Bounds: TRect; AHScrollBar, AVScrollBar: PScrollBar);
 constructor THelpViewer.Init(var Bounds: TRect; AHScrollBar, AVScrollBar: PScrollBar);
 begin
 begin
-  inherited Init(Bounds, AHScrollBar, AVScrollBar, nil, 0);
-  Flags:=efInsertMode; IsReadOnly:=true;
+  inherited Init(Bounds, AHScrollBar, AVScrollBar, nil, nil);
+  Flags:=efInsertMode; ReadOnly:=true;
   New(WordList, Init(50,50));
   New(WordList, Init(50,50));
   Margin:=1; CurLink:=-1;
   Margin:=1; CurLink:=-1;
 end;
 end;
@@ -1139,7 +1139,10 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.11  2000-02-07 08:29:13  michael
+  Revision 1.12  2000-03-21 23:21:38  pierre
+   adapted to wcedit addition
+
+  Revision 1.11  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