Browse Source

adapted to wcedit addition by Gabor

pierre 25 years ago
parent
commit
e0905e9811

+ 9 - 6
ide/text/fp.pas

@@ -1,4 +1,3 @@
-
 {
 {
     $Id$
     $Id$
     This file is part of the Free Pascal Integrated Development Environment
     This file is part of the Free Pascal Integrated Development Environment
@@ -31,13 +30,13 @@ uses
 {$ifdef go32v2}
 {$ifdef go32v2}
   dpmiexcp,
   dpmiexcp,
 {$endif go32v2}
 {$endif go32v2}
-{$ifdef debug}
+{$ifdef exedebug}
   lineinfo,
   lineinfo,
-{$endif debug}
+{$endif exedebug}
   Dos,Objects,
   Dos,Objects,
   BrowCol,
   BrowCol,
   Drivers,Views,App,Dialogs,ColorSel,Menus,StdDlg,Validate,
   Drivers,Views,App,Dialogs,ColorSel,Menus,StdDlg,Validate,
-  {$ifdef EDITORS}Editors{$else}WEditor{$endif},
+  {$ifdef EDITORS}Editors{$else}WEditor,WCEdit{$endif},
   ASCIITab,Calc,
   ASCIITab,Calc,
   WUtils,WViews,
   WUtils,WViews,
   FPIDE,FPCalc,FPCompile,
   FPIDE,FPCalc,FPCompile,
@@ -131,7 +130,8 @@ begin
 {$ifdef EDITORS}
 {$ifdef EDITORS}
   RegisterEditors;
   RegisterEditors;
 {$else}
 {$else}
-  RegisterCodeEditors;
+  RegisterWEditor;
+  RegisterWCEdit;
 {$endif}
 {$endif}
   RegisterFPCalc;
   RegisterFPCalc;
   RegisterFPCompile;
   RegisterFPCompile;
@@ -236,7 +236,10 @@ BEGIN
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.41  2000-03-13 20:41:34  pierre
+  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
     + option -S to disable the mouse
     + option -S to disable the mouse
     * adapted to changes in fpusrscr for DOS
     * adapted to changes in fpusrscr for DOS
 
 

+ 5 - 2
ide/text/fpcalc.pas

@@ -64,7 +64,7 @@ type
     CD : PCalcDisplay;
     CD : PCalcDisplay;
     constructor Init;
     constructor Init;
     procedure   HandleEvent(var Event: TEvent); virtual;
     procedure   HandleEvent(var Event: TEvent); virtual;
-    procedure   Show; virtual;
+    procedure   Show; {virtual;}
     procedure   Close; virtual;
     procedure   Close; virtual;
     constructor Load(var S: TStream);
     constructor Load(var S: TStream);
     procedure   Store(var S: TStream);
     procedure   Store(var S: TStream);
@@ -463,7 +463,10 @@ end;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.7  1999-09-13 16:24:42  peter
+  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
     + clock
     + clock
     * backspace unident like tp7
     * backspace unident like tp7
 
 

+ 0 - 2
ide/text/fpcodcmp.pas

@@ -186,8 +186,6 @@ 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

+ 3 - 10
ide/text/fpcodtmp.pas

@@ -252,8 +252,6 @@ 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);
@@ -264,7 +262,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,4096)); Insert(CodeMemo);
+  New(CodeMemo, Init(R, nil,nil,nil)); 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);
@@ -276,7 +274,6 @@ 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;
@@ -314,10 +311,10 @@ 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,4096));
+  New(TemplateViewer, Init(R,nil,SB,nil));
   with TemplateViewer^ do
   with TemplateViewer^ do
   begin
   begin
-    IsReadOnly:=true;
+    ReadOnly:=true;
     AlwaysShowScrollBars:=true;
     AlwaysShowScrollBars:=true;
   end;
   end;
   Insert(TemplateViewer);
   Insert(TemplateViewer);
@@ -392,8 +389,6 @@ 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
@@ -423,8 +418,6 @@ 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

+ 10 - 6
ide/text/fpcompil.pas

@@ -121,10 +121,11 @@ var
   y : longint;
   y : longint;
   Text,Attr : String;
   Text,Attr : String;
   DisplayCompilerWindow : boolean;
   DisplayCompilerWindow : boolean;
+  cc: integer;
 
 
     procedure SearchBackTrace;
     procedure SearchBackTrace;
       var AText,ModuleName,st : String;
       var AText,ModuleName,st : String;
-          p2,row : longint;
+          row : longint;
       begin
       begin
         if pos('  0x',Text)=1 then
         if pos('  0x',Text)=1 then
           begin
           begin
@@ -144,7 +145,7 @@ var
               begin
               begin
                 Text:=Copy(Text,Pos('line ',Text)+5,255);
                 Text:=Copy(Text,Pos('line ',Text)+5,255);
                 st:=Copy(Text,1,Pos(' ',Text)-1);
                 st:=Copy(Text,1,Pos(' ',Text)-1);
-                Val(st,row);
+                Val(st,row,cc);
               end
               end
             else
             else
               row:=0;
               row:=0;
@@ -165,9 +166,9 @@ var
           begin
           begin
             ModuleName:=Copy(Text,1,p2-1);
             ModuleName:=Copy(Text,1,p2-1);
             st:=Copy(Text,p2+1,255);
             st:=Copy(Text,p2+1,255);
-            Val(Copy(st,1,pos(',',st)-1),row);
+            Val(Copy(st,1,pos(',',st)-1),row,cc);
             st:=Copy(st,Pos(',',st)+1,255);
             st:=Copy(st,Pos(',',st)+1,255);
-            Val(Copy(st,1,pos(')',st)-1),col);
+            Val(Copy(st,1,pos(')',st)-1),col,cc);
             CompilerMessageWindow^.AddMessage(_type,Copy(Text,pos(':',Text)+1,255)
             CompilerMessageWindow^.AddMessage(_type,Copy(Text,pos(':',Text)+1,255)
               ,ModuleName,row,col);
               ,ModuleName,row,col);
             If EnableDisplay then
             If EnableDisplay then
@@ -604,7 +605,7 @@ begin
         FileName:=PrimaryFileMain
         FileName:=PrimaryFileMain
       else
       else
         begin
         begin
-          if P^.Editor^.Modified and (not P^.Editor^.Save) then
+          if P^.Editor^.GetModified and (not P^.Editor^.Save) then
             FileName:='*' { file not saved }
             FileName:='*' { file not saved }
           else
           else
             FileName:=P^.Editor^.FileName;
             FileName:=P^.Editor^.FileName;
@@ -865,7 +866,10 @@ end;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.52  2000-03-08 16:48:07  pierre
+  Revision 1.53  2000-03-21 23:33:18  pierre
+   adapted to wcedit addition by Gabor
+
+  Revision 1.52  2000/03/08 16:48:07  pierre
    + Read BackTrace from UseScreen
    + Read BackTrace from UseScreen
 
 
   Revision 1.51  2000/03/07 21:54:26  pierre
   Revision 1.51  2000/03/07 21:54:26  pierre

+ 16 - 13
ide/text/fpdebug.pas

@@ -679,7 +679,7 @@ procedure TDebugController.ResetDebuggerRows;
   begin
   begin
     if assigned(P) and
     if assigned(P) and
        (TypeOf(P^)=TypeOf(TSourceWindow)) then
        (TypeOf(P^)=TypeOf(TSourceWindow)) then
-       PSourceWindow(P)^.Editor^.SetDebuggerRow(-1);
+       PSourceWindow(P)^.Editor^.SetLineFlagExclusive(lfDebuggerRow,-1);
   end;
   end;
 
 
 begin
 begin
@@ -759,7 +759,7 @@ begin
         begin
         begin
           W^.Editor^.SetCurPtr(0,Line);
           W^.Editor^.SetCurPtr(0,Line);
           W^.Editor^.TrackCursor(CenterDebuggerRow);
           W^.Editor^.TrackCursor(CenterDebuggerRow);
-          W^.Editor^.SetDebuggerRow(Line);
+          W^.Editor^.SetLineFlagExclusive(lfDebuggerRow,Line);
           UpdateDebugViews;
           UpdateDebugViews;
 
 
           {if Not assigned(GDBWindow) or not GDBWindow^.GetState(sfActive) then
           {if Not assigned(GDBWindow) or not GDBWindow^.GetState(sfActive) then
@@ -778,7 +778,7 @@ begin
         W:=TryToOpenFile(nil,fn,0,Line,false);
         W:=TryToOpenFile(nil,fn,0,Line,false);
       if assigned(W) then
       if assigned(W) then
         begin
         begin
-          W^.Editor^.SetDebuggerRow(Line);
+          W^.Editor^.SetLineFlagExclusive(lfDebuggerRow,Line);
           W^.Editor^.TrackCursor(CenterDebuggerRow);
           W^.Editor^.TrackCursor(CenterDebuggerRow);
           UpdateDebugViews;
           UpdateDebugViews;
           {if Not assigned(GDBWindow) or not GDBWindow^.GetState(sfActive) then
           {if Not assigned(GDBWindow) or not GDBWindow^.GetState(sfActive) then
@@ -809,7 +809,7 @@ begin
            begin
            begin
              { should now be open }
              { should now be open }
               W:=TryToOpenFile(nil,fn,0,Line,true);
               W:=TryToOpenFile(nil,fn,0,Line,true);
-              W^.Editor^.SetDebuggerRow(Line);
+              W^.Editor^.SetLineFlagExclusive(lfDebuggerRow,Line);
               W^.Editor^.TrackCursor(CenterDebuggerRow);
               W^.Editor^.TrackCursor(CenterDebuggerRow);
               UpdateDebugViews;
               UpdateDebugViews;
               {if Not assigned(GDBWindow) or not GDBWindow^.GetState(sfActive) then
               {if Not assigned(GDBWindow) or not GDBWindow^.GetState(sfActive) then
@@ -1126,7 +1126,7 @@ begin
             b:=true
             b:=true
           else
           else
             b:=false;
             b:=false;
-          W^.Editor^.SetLineBreakState(Line,b);
+          W^.Editor^.SetLineFlagState(Line,lfBreakpoint,b);
         end;
         end;
     end;
     end;
 end;
 end;
@@ -1186,7 +1186,7 @@ procedure TBreakpointCollection.ShowBreakpoints(W : PSourceWindow);
   begin
   begin
     If assigned(P^.FileName) and
     If assigned(P^.FileName) and
       (GDBFileName(FExpand(P^.FileName^))=GDBFileName(FExpand(W^.Editor^.FileName))) then
       (GDBFileName(FExpand(P^.FileName^))=GDBFileName(FExpand(W^.Editor^.FileName))) then
-      W^.Editor^.SetLineBreakState(P^.Line,P^.state=bs_enabled);
+      W^.Editor^.SetLineFlagState(P^.Line,lfBreakpoint,P^.state=bs_enabled);
   end;
   end;
 
 
 begin
 begin
@@ -1203,7 +1203,7 @@ procedure TBreakpointCollection.ShowAllBreakpoints;
       begin
       begin
         W:=SearchOnDesktop(P^.FileName^,false);
         W:=SearchOnDesktop(P^.FileName^,false);
         if assigned(W) then
         if assigned(W) then
-          W^.Editor^.SetLineBreakState(P^.Line,P^.state=bs_enabled);
+          W^.Editor^.SetLineFlagState(P^.Line,lfBreakpoint,P^.state=bs_enabled);
       end;
       end;
   end;
   end;
 
 
@@ -1467,7 +1467,7 @@ begin
     begin
     begin
       W^.Select;
       W^.Select;
       W^.Editor^.TrackCursor(true);
       W^.Editor^.TrackCursor(true);
-      W^.Editor^.SetHighlightRow(P^.Breakpoint^.Line);
+      W^.Editor^.SetLineFlagExclusive(lfHighlightRow,P^.Breakpoint^.Line);
     end;
     end;
   if Assigned(Owner) then
   if Assigned(Owner) then
     Owner^.Select;
     Owner^.Select;
@@ -1940,8 +1940,6 @@ procedure TWatch.rename(s : string);
 procedure TWatch.Get_new_value;
 procedure TWatch.Get_new_value;
   var p, q : pchar;
   var p, q : pchar;
       i, j, curframe, startframe : longint;
       i, j, curframe, startframe : longint;
-      error : integer;
-      c : char;
       s,s2 : string;
       s,s2 : string;
       loop_higher, found, last_removed : boolean;
       loop_higher, found, last_removed : boolean;
 
 
@@ -2732,10 +2730,12 @@ end;
     var
     var
        p,po : pchar;
        p,po : pchar;
        p1 : pchar;
        p1 : pchar;
+    {$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}
 
 
     begin
     begin
        GetFPURegs:=false;
        GetFPURegs:=false;
@@ -3001,7 +3001,7 @@ end;
               W:=SearchOnDesktop(GetPChar(file_name),false);
               W:=SearchOnDesktop(GetPChar(file_name),false);
               { First reset all Debugger rows }
               { First reset all Debugger rows }
               If assigned(W) then
               If assigned(W) then
-                W^.Editor^.SetDebuggerRow(-1);
+                W^.Editor^.SetLineFlagExclusive(lfDebuggerRow,-1);
             end;
             end;
         end;
         end;
       { Now set all Debugger rows }
       { Now set all Debugger rows }
@@ -3013,7 +3013,7 @@ end;
               If assigned(W) then
               If assigned(W) then
                 begin
                 begin
                   If W^.Editor^.DebuggerRow=-1 then
                   If W^.Editor^.DebuggerRow=-1 then
-                    W^.Editor^.SetDebuggerRow(line_number-1);
+                    W^.Editor^.SetLineFlagExclusive(lfDebuggerRow,line_number-1);
                 end;
                 end;
             end;
             end;
         end;
         end;
@@ -3331,7 +3331,10 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.57  2000-03-14 14:22:30  pierre
+  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
    + generate cmDebuggerStopped broadcast
    + generate cmDebuggerStopped broadcast
 
 
   Revision 1.56  2000/03/08 16:57:01  pierre
   Revision 1.56  2000/03/08 16:57:01  pierre

+ 146 - 11
ide/text/fpdesk.pas

@@ -18,7 +18,7 @@ unit FPDesk;
 interface
 interface
 
 
 const
 const
-     DesktopVersion     = $0006; { <- if you change any Load&Store methods,
+     DesktopVersion     = $0007; { <- if you change any Load&Store methods,
                                       default object properties (Options,State)
                                       default object properties (Options,State)
                                       then you should also change this }
                                       then you should also change this }
 
 
@@ -53,6 +53,17 @@ uses Dos,
      FPConst,FPVars,FPUtils,FPViews,FPCompile,FPTools,FPHelp,
      FPConst,FPVars,FPUtils,FPViews,FPCompile,FPTools,FPHelp,
      FPCodCmp,FPCodTmp;
      FPCodCmp,FPCodTmp;
 
 
+type
+     PWindowInfo = ^TWindowInfo;
+     TWindowInfo = packed record
+       HelpCtx   : word;
+       Bounds    : TRect;
+       Visible   : boolean;
+       ExtraDataSize : word;
+       TitleLen  : word;
+       Title     : packed record end;
+     end;
+
 procedure InitDesktopFile;
 procedure InitDesktopFile;
 begin
 begin
   if DesktopLocation=dlCurrentDir then
   if DesktopLocation=dlCurrentDir then
@@ -247,10 +258,60 @@ end;
 
 
 function ReadOpenWindows(F: PResourceFile): boolean;
 function ReadOpenWindows(F: PResourceFile): boolean;
 var S: PMemoryStream;
 var S: PMemoryStream;
-    TempDesk: PFPDesktop;
     OK: boolean;
     OK: boolean;
     R : TRect;
     R : TRect;
     W: word;
     W: word;
+    WI: TWindowInfo;
+    Title: string;
+    XDataOfs: word;
+    XData: array[0..1024] of byte;
+procedure GetData(var B; Size: word);
+begin
+  Move(XData[XDataOfs],B,Size);
+  Inc(XDataOfs,Size);
+end;
+procedure ProcessWindowInfo;
+var W: PWindow;
+    SW: PSourceWindow absolute W;
+    St: string;
+    TP,TP2: TPoint;
+    R: TRect;
+begin
+  XDataOfs:=0;
+  W:=SearchWindow(Title);
+  case WI.HelpCtx of
+    hcSourceWindow :
+      begin
+        GetData(St[0],1);
+        GetData(St[1],ord(St[0]));
+        W:=ITryToOpenFile(@WI.Bounds,St,0,0,false,false,true);
+        if Assigned(W)=false then
+          ErrorBox('Can''t open '+St,nil)
+        else
+        begin
+          GetData(TP,sizeof(TP)); GetData(TP2,sizeof(TP2));
+          SW^.Editor^.SetSelection(TP,TP2);
+          GetData(TP,sizeof(TP)); SW^.Editor^.SetCurPtr(TP.X,TP.Y);
+          GetData(TP,sizeof(TP)); SW^.Editor^.ScrollTo(TP.X,TP.Y);
+        end;
+      end;
+  end;
+  if W=nil then Exit;
+  W^.GetBounds(R);
+  if (R.A.X<>WI.Bounds.A.X) or (R.A.Y<>WI.Bounds.A.Y) then
+    R.Move(WI.Bounds.A.X-R.A.X,WI.Bounds.A.Y-R.A.Y);
+  if (W^.Flags and wfGrow)<>0 then
+    begin
+      R.B.X:=R.A.X+(WI.Bounds.B.X-WI.Bounds.A.X);
+      R.B.Y:=R.A.Y+(WI.Bounds.B.Y-WI.Bounds.A.Y);
+    end;
+  W^.Locate(R);
+  if W^.GetState(sfVisible)<>WI.Visible then
+    if WI.Visible then
+      W^.Show
+    else
+      W^.Hide;
+end;
 begin
 begin
   PushStatus('Reading desktop contents...');
   PushStatus('Reading desktop contents...');
   New(S, Init(32*1024,4096));
   New(S, Init(32*1024,4096));
@@ -265,7 +326,19 @@ begin
   end;
   end;
   if OK then
   if OK then
     begin
     begin
-      TempDesk:=PFPDesktop(S^.Get);
+      XDataOfs:=0;
+      repeat
+        S^.Read(WI,sizeof(WI));
+        if S^.Status=stOK then
+        begin
+          Title[0]:=chr(WI.TitleLen);
+          S^.Read(Title[1],WI.TitleLen);
+          if WI.ExtraDataSize>0 then
+          S^.Read(XData,WI.ExtraDataSize);
+          ProcessWindowInfo;
+        end;
+      until S^.Status<>stOK;
+(*      TempDesk:=PFPDesktop(S^.Get);
       OK:=Assigned(TempDesk);
       OK:=Assigned(TempDesk);
       if OK then
       if OK then
         begin
         begin
@@ -293,7 +366,7 @@ begin
           Application^.Insert(Desktop);
           Application^.Insert(Desktop);
           Desktop^.ReDraw;
           Desktop^.ReDraw;
           Message(Application,evBroadcast,cmUpdate,nil);
           Message(Application,evBroadcast,cmUpdate,nil);
-        end;
+        end;*)
       if OK=false then
       if OK=false then
         ErrorBox('Error loading desktop',nil);
         ErrorBox('Error loading desktop',nil);
     end;
     end;
@@ -304,8 +377,63 @@ end;
 
 
 function WriteOpenWindows(F: PResourceFile): boolean;
 function WriteOpenWindows(F: PResourceFile): boolean;
 var S: PMemoryStream;
 var S: PMemoryStream;
-    W: word;
+procedure CollectInfo(P: PView); {$ifndef FPC}far;{$endif}
+var W: PWindow;
+    SW: PSourceWindow absolute W;
+    WI: TWindowInfo;
+    Title: string;
+    XDataOfs: word;
+    XData: array[0..1024] of byte;
+    St: string;
+    TP: TPoint;
+procedure AddData(const B; Size: word);
+begin
+  Move(B,XData[XDataOfs],Size);
+  Inc(XDataOfs,Size);
+end;
+begin
+  XDataOfs:=0;
+  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);
+  if W=nil then Exit;
+  FillChar(WI,sizeof(WI),0);
+  Title:=W^.GetTitle(255);
+  WI.HelpCtx:=W^.HelpCtx;
+  W^.GetBounds(WI.Bounds);
+  WI.Visible:=W^.GetState(sfVisible);
+
+  case WI.HelpCtx of
+    hcSourceWindow :
+      begin
+        St:=SW^.Editor^.FileName; AddData(St,length(St)+1);
+        TP:=SW^.Editor^.SelStart; AddData(TP,sizeof(TP));
+        TP:=SW^.Editor^.SelEnd; AddData(TP,sizeof(TP));
+        TP:=SW^.Editor^.CurPos; AddData(TP,sizeof(TP));
+        TP:=SW^.Editor^.Delta; AddData(TP,sizeof(TP));
+      end;
+  end;
+
+  WI.TitleLen:=length(Title);
+  WI.ExtraDataSize:=XDataOfs;
+  S^.Write(WI,sizeof(WI));
+  S^.Write(Title[1],WI.TitleLen);
+  if WI.ExtraDataSize>0 then
+    S^.Write(XData,WI.ExtraDataSize);
+end;
+var W: word;
     OK: boolean;
     OK: boolean;
+    PV: PView;
 begin
 begin
   PushStatus('Storing desktop contents...');
   PushStatus('Storing desktop contents...');
 
 
@@ -315,7 +443,7 @@ begin
   begin
   begin
     W:=DesktopVersion;
     W:=DesktopVersion;
     S^.Write(W,SizeOf(W));
     S^.Write(W,SizeOf(W));
-    S^.Put(Desktop);
+{    S^.Put(Desktop);
     with Desktop^ do
     with Desktop^ do
     begin
     begin
       PutSubViewPtr(S^,CompilerMessageWindow);
       PutSubViewPtr(S^,CompilerMessageWindow);
@@ -329,6 +457,12 @@ begin
       PutSubViewPtr(S^,UserScreenWindow);
       PutSubViewPtr(S^,UserScreenWindow);
       PutSubViewPtr(S^,ASCIIChart);
       PutSubViewPtr(S^,ASCIIChart);
       PutSubViewPtr(S^,MessagesWindow);
       PutSubViewPtr(S^,MessagesWindow);
+    end;}
+    PV:=Desktop^.Last;
+    while PV<>nil do
+    begin
+      CollectInfo(PV);
+      PV:=PV^.PrevView;
     end;
     end;
     OK:=(S^.Status=stOK);
     OK:=(S^.Status=stOK);
     if OK then
     if OK then
@@ -360,7 +494,6 @@ end;
 function ReadCodeComplete(F: PResourceFile): boolean;
 function ReadCodeComplete(F: PResourceFile): boolean;
 var S: PMemoryStream;
 var S: PMemoryStream;
     OK: boolean;
     OK: boolean;
-    R: PResource;
 begin
 begin
   PushStatus('Reading CodeComplete wordlist...');
   PushStatus('Reading CodeComplete wordlist...');
   New(S, Init(1024,1024));
   New(S, Init(1024,1024));
@@ -398,7 +531,6 @@ end;
 function ReadCodeTemplates(F: PResourceFile): boolean;
 function ReadCodeTemplates(F: PResourceFile): boolean;
 var S: PMemoryStream;
 var S: PMemoryStream;
     OK: boolean;
     OK: boolean;
-    R: PResource;
 begin
 begin
   PushStatus('Reading CodeTemplates...');
   PushStatus('Reading CodeTemplates...');
   New(S, Init(1024,4096));
   New(S, Init(1024,4096));
@@ -573,9 +705,9 @@ begin
 
 
   if Assigned(Clipboard) then
   if Assigned(Clipboard) then
     if (DesktopFileFlags and dfClipboardContent)<>0 then
     if (DesktopFileFlags and dfClipboardContent)<>0 then
-      Clipboard^.Flags:=Clipboard^.Flags or efStoreContent
+      Clipboard^.SetFlags(Clipboard^.GetFlags or efStoreContent)
     else
     else
-      Clipboard^.Flags:=Clipboard^.Flags and not efStoreContent;
+      Clipboard^.SetFlags(Clipboard^.GetFlags and not efStoreContent);
   OK:=false;
   OK:=false;
 
 
   if Assigned(F) then
   if Assigned(F) then
@@ -647,7 +779,10 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.24  2000-03-20 19:19:46  pierre
+  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
    * LFN support in streams
    * LFN support in streams
 
 
   Revision 1.23  2000/03/13 20:36:52  pierre
   Revision 1.23  2000/03/13 20:36:52  pierre

+ 5 - 2
ide/text/fphelp.pas

@@ -23,7 +23,7 @@ uses
 {$ifdef EDITORS}
 {$ifdef EDITORS}
   Editors,
   Editors,
 {$else}
 {$else}
-  WEditor,
+  WEditor,WCEdit,
 {$endif}
 {$endif}
   WViews,FPViews;
   WViews,FPViews;
 
 
@@ -413,7 +413,10 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.27  2000-02-07 11:58:01  pierre
+  Revision 1.28  2000-03-21 23:31:14  pierre
+   adapted to wcedit addition by Gabor
+
+  Revision 1.27  2000/02/07 11:58:01  pierre
    Gabor's code inserted
    Gabor's code inserted
 
 
   Revision 1.26  2000/01/08 18:26:20  florian
   Revision 1.26  2000/01/08 18:26:20  florian

+ 6 - 3
ide/text/fpide.pas

@@ -20,7 +20,7 @@ interface
 
 
 uses
 uses
   Objects,Drivers,Views,App,Gadgets,MsgBox,
   Objects,Drivers,Views,App,Gadgets,MsgBox,
-  {$ifdef EDITORS}Editors,{$else}WEditor,{$endif}
+  {$ifdef EDITORS}Editors,{$else}WEditor,WCEdit,{$endif}
   Comphook,Browcol,
   Comphook,Browcol,
   FPViews,FPSymbol,fpstring;
   FPViews,FPSymbol,fpstring;
 
 
@@ -44,7 +44,7 @@ type
       procedure   HandleEvent(var Event: TEvent); virtual;
       procedure   HandleEvent(var Event: TEvent); virtual;
       procedure   GetTileRect(var R: TRect); virtual;
       procedure   GetTileRect(var R: TRect); virtual;
       function    GetPalette: PPalette; virtual;
       function    GetPalette: PPalette; virtual;
-      procedure   DosShell; virtual;
+      procedure   DosShell; {virtual;}
       destructor  Done; virtual;
       destructor  Done; virtual;
       procedure   ShowUserScreen;
       procedure   ShowUserScreen;
       procedure   ShowIDEScreen;
       procedure   ShowIDEScreen;
@@ -927,7 +927,10 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.55  2000-03-13 20:41:35  pierre
+  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
     + option -S to disable the mouse
     + option -S to disable the mouse
     * adapted to changes in fpusrscr for DOS
     * adapted to changes in fpusrscr for DOS
 
 

+ 5 - 6
ide/text/fpini.pas

@@ -28,7 +28,7 @@ implementation
 
 
 uses
 uses
   Dos,Objects,Drivers,App,
   Dos,Objects,Drivers,App,
-  WINI,{$ifndef EDITORS}WEditor{$else}Editors{$endif},
+  WINI,{$ifndef EDITORS}WEditor,WCEdit{$else}Editors{$endif},
   {$ifndef NODEBUG}FPDebug,{$endif}FPConst,FPVars,FPViews,
   {$ifndef NODEBUG}FPDebug,{$endif}FPConst,FPVars,FPViews,
   FPIntf,FPTools,FPSwitch;
   FPIntf,FPTools,FPSwitch;
 
 
@@ -237,12 +237,10 @@ function ReadINIFile: boolean;
 var INIFile: PINIFile;
 var INIFile: PINIFile;
     S,PS,S1,S2,S3: string;
     S,PS,S1,S2,S3: string;
     I,P: integer;
     I,P: integer;
-    X,Y : sw_integer;
     BreakPointCount,WatchesCount:longint;
     BreakPointCount,WatchesCount:longint;
     OK: boolean;
     OK: boolean;
     ts : TSwitchMode;
     ts : TSwitchMode;
     W: word;
     W: word;
-    R : TRect;
 begin
 begin
   OK:=ExistsFile(IniFileName);
   OK:=ExistsFile(IniFileName);
   if OK then
   if OK then
@@ -390,13 +388,11 @@ end;
 function WriteINIFile: boolean;
 function WriteINIFile: boolean;
 var INIFile: PINIFile;
 var INIFile: PINIFile;
     S: string;
     S: string;
-    R : TRect;
     S1,S2,S3: string;
     S1,S2,S3: string;
     W: word;
     W: word;
     BreakPointCount,WatchesCount:longint;
     BreakPointCount,WatchesCount:longint;
     I(*,OpenFileCount*): integer;
     I(*,OpenFileCount*): integer;
     OK: boolean;
     OK: boolean;
-    PW,PPW : PSourceWindow;
 
 
 procedure ConcatName(P: PString); {$ifndef FPC}far;{$endif}
 procedure ConcatName(P: PString); {$ifndef FPC}far;{$endif}
 begin
 begin
@@ -526,7 +522,10 @@ end;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.27  2000-03-13 20:38:02  pierre
+  Revision 1.28  2000-03-21 23:30:22  pierre
+   adapted to wcedit addition by Gabor
+
+  Revision 1.27  2000/03/13 20:38:02  pierre
     IniPath removed and IniFileName moved to fpvars unit
     IniPath removed and IniFileName moved to fpvars unit
 
 
   Revision 1.26  2000/02/04 00:08:35  pierre
   Revision 1.26  2000/02/04 00:08:35  pierre

+ 6 - 3
ide/text/fpmopts.inc

@@ -793,7 +793,7 @@ begin
     end
     end
   else
   else
     begin
     begin
-      TabSize:=Editor^.TabSize; EFlags:=Editor^.Flags;
+      TabSize:=Editor^.GetTabSize; EFlags:=Editor^.GetFlags;
       Title:='Editor Options';
       Title:='Editor Options';
     end;
     end;
 
 
@@ -892,7 +892,7 @@ begin
        end
        end
     else
     else
        begin
        begin
-         Editor^.TabSize:=TabSize;
+         Editor^.SetTabSize(TabSize);
          Editor^.SetFlags(EFlags);
          Editor^.SetFlags(EFlags);
        end;
        end;
     ExtIL^.GetData(HighlightExts);
     ExtIL^.GetData(HighlightExts);
@@ -1212,7 +1212,10 @@ end;
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.30  2000-03-13 20:34:07  pierre
+  Revision 1.31  2000-03-21 23:28:13  pierre
+   adapted to wcedit addition by Gabor
+
+  Revision 1.30  2000/03/13 20:34:07  pierre
    * IniPath removed
    * IniPath removed
 
 
   Revision 1.29  2000/03/07 22:52:50  pierre
   Revision 1.29  2000/03/07 22:52:50  pierre