Browse Source

+ new bunch of Gabor's changes

pierre 25 years ago
parent
commit
bda6de53fa

+ 21 - 1
ide/text/fixes.txt

@@ -1,3 +1,23 @@
+Gabors's log to 16/6/2000 commits
+========================= Already fixed ================================
+
+ [*] temporary files are now delete on exit
+ [*] Size/Move (Ctrl+F5) didn't work correctly with some windows, which
+     defined a different meaning for Enter (for ex. message windows)
+ [*] 'Open file at cursor' brings up an open dialog with a correct name
+     in it now, when it can't find the file itself
+ [*] TFileDialog treated filename-list (multiple names separated with
+     semicolons) as single filenames, whereas they're more like wildchar
+     masks
+ [*] TFileDialog treated paths ending with a dirsep (\) as filespecs,
+     however, they're actually dirspecs
+
+========================== Other improvements ============================
+
+ [+] editor windows can now be hidden temporarily
+ [+] unit info tab added to symbol browser
+ [+] strings constants from generic units moved to WCONSTS.PAS
+ [+] small info screen at first start
 Gabors's log to 29/5/2000 commits
 Gabors's log to 29/5/2000 commits
 ========================= Already fixed ================================
 ========================= Already fixed ================================
 
 
@@ -120,4 +140,4 @@ Gabor's log for 18/4/2000 commits
      Ctrl+Q+U - Jump to bottom of wnd,Ctrl+Q+X - Jump to bottom of wnd ,
      Ctrl+Q+U - Jump to bottom of wnd,Ctrl+Q+X - Jump to bottom of wnd ,
      Ctrl+Q+[ - find delimiter-match, Ctrl+Q+] - find delimited match (backw)
      Ctrl+Q+[ - find delimiter-match, Ctrl+Q+] - find delimited match (backw)
 
 
-=========================== Todo ========================================
+=========================== Todo ========================================

+ 28 - 3
ide/text/fp.pas

@@ -44,7 +44,6 @@ uses
   FPTools,{$ifndef NODEBUG}FPDebug,{$endif}FPTemplt,FPCatch,FPRedir,FPDesk,
   FPTools,{$ifndef NODEBUG}FPDebug,{$endif}FPTemplt,FPCatch,FPRedir,FPDesk,
   FPCodTmp,FPCodCmp;
   FPCodTmp,FPCodCmp;
 
 
-
 procedure ProcessParams(BeforeINI: boolean);
 procedure ProcessParams(BeforeINI: boolean);
 
 
   function IsSwitch(const Param: string): boolean;
   function IsSwitch(const Param: string): boolean;
@@ -76,8 +75,12 @@ begin
         if UpcaseStr(Param)='NOLFN' then
         if UpcaseStr(Param)='NOLFN' then
           begin
           begin
             LFNSupport:=false;
             LFNSupport:=false;
-           end else
+          end else
 {$endif go32v2}
 {$endif go32v2}
+        if UpcaseStr(Param)='README' then
+          begin
+            ShowReadme:=true;
+          end else
         case Upcase(Param[1]) of
         case Upcase(Param[1]) of
           'C' : { custom config file (BP compatiblity) }
           'C' : { custom config file (BP compatiblity) }
            if BeforeINI then
            if BeforeINI then
@@ -128,6 +131,16 @@ begin
   end;
   end;
 end;
 end;
 
 
+procedure DelTempFiles;
+begin
+  DeleteFile(FPOutFileName);
+  DeleteFile(FPErrFileName);
+  DeleteFile(GDBOutFileName);
+  DeleteFile(GDBOutPutFileName);
+  DeleteFile(GREPOutName);
+  DeleteFile(GREPErrName);
+end;
+
 procedure RegisterIDEObjects;
 procedure RegisterIDEObjects;
 begin
 begin
   RegisterApp;
   RegisterApp;
@@ -176,6 +189,8 @@ BEGIN
   RegisterIDEObjects;
   RegisterIDEObjects;
   StreamError:=@MyStreamError;
   StreamError:=@MyStreamError;
 
 
+  ShowReadme:=ShowReadme or (LocateFile(INIFileName)='');
+
 {$ifdef win32}
 {$ifdef win32}
   DosExecute(GetEnv('COMSPEC'),'/C echo This dummy call gets the mouse to become visible');
   DosExecute(GetEnv('COMSPEC'),'/C echo This dummy call gets the mouse to become visible');
 {$endif win32}
 {$endif win32}
@@ -213,6 +228,12 @@ BEGIN
 
 
   ProcessParams(false);
   ProcessParams(false);
 
 
+  if ShowReadme then
+  begin
+    PutCommand(Application,evCommand,cmShowReadme,nil);
+    ShowReadme:=false; { do not show next time }
+  end;
+
   repeat
   repeat
     IDEApp.Run;
     IDEApp.Run;
     if (AutoSaveOptions and asEditorFiles)=0 then
     if (AutoSaveOptions and asEditorFiles)=0 then
@@ -225,6 +246,7 @@ BEGIN
 
 
   DoneDesktopFile;
   DoneDesktopFile;
 
 
+  DelTempFiles;
   IDEApp.Done;
   IDEApp.Done;
   WriteSwitches(SwitchesPath);
   WriteSwitches(SwitchesPath);
 
 
@@ -248,7 +270,10 @@ BEGIN
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.46  2000-05-29 10:44:56  pierre
+  Revision 1.47  2000-06-16 08:50:40  pierre
+   + new bunch of Gabor's changes
+
+  Revision 1.46  2000/05/29 10:44:56  pierre
    + New bunch of Gabor's changes: see fixes.txt
    + New bunch of Gabor's changes: see fixes.txt
 
 
   Revision 1.45  2000/05/02 08:42:26  pierre
   Revision 1.45  2000/05/02 08:42:26  pierre

+ 14 - 2
ide/text/fpcompil.pas

@@ -428,7 +428,7 @@ begin
   Insert(ST);
   Insert(ST);
   GetExtent(R); R.B.Y:=11;
   GetExtent(R); R.B.Y:=11;
   R.Grow(-1,-1); R.A.Y:=R.B.Y-1;
   R.Grow(-1,-1); R.A.Y:=R.B.Y-1;
-  New(KeyST, Init(R, '', Blue*16+White+longint($80+Blue*16+White)*256));
+  New(KeyST, Init(R, '', Blue*16+White+longint($80+Blue*16+White)*256,true));
   Insert(KeyST);
   Insert(KeyST);
 end;
 end;
 
 
@@ -658,6 +658,7 @@ begin
       ErrorBox(msg_cantcompileunsavedfile,nil);
       ErrorBox(msg_cantcompileunsavedfile,nil);
       Exit;
       Exit;
     end;
     end;
+  PushStatus('Beginning compilation...');
 { Show Compiler Messages Window }
 { Show Compiler Messages Window }
 {  if not CompilerMessageWindow^.GetState(sfVisible) then
 {  if not CompilerMessageWindow^.GetState(sfVisible) then
    CompilerMessageWindow^.Show;
    CompilerMessageWindow^.Show;
@@ -667,12 +668,15 @@ begin
   NeedRecompile(true);
   NeedRecompile(true);
 
 
   MainFile:=FileName;
   MainFile:=FileName;
+  SetStatus('Writing switches to file...');
   WriteSwitches(SwitchesPath);
   WriteSwitches(SwitchesPath);
   { leaving open browsers leads to crashes !! (PM) }
   { leaving open browsers leads to crashes !! (PM) }
+  SetStatus('Preparing symbol info...');
   CloseAllBrowsers;
   CloseAllBrowsers;
   if ((DesktopFileFlags and dfSymbolInformation)<>0) then
   if ((DesktopFileFlags and dfSymbolInformation)<>0) then
     WriteSymbolsFile(BrowserName);
     WriteSymbolsFile(BrowserName);
 {  MainFile:=FixFileName(FExpand(FileName));}
 {  MainFile:=FixFileName(FExpand(FileName));}
+  SetStatus('Preparing to compile...');
   If GetEXEPath<>'' then
   If GetEXEPath<>'' then
     EXEFile:=FixFileName(GetEXEPath+NameOf(MainFile)+ExeExt)
     EXEFile:=FixFileName(GetEXEPath+NameOf(MainFile)+ExeExt)
   else
   else
@@ -715,7 +719,9 @@ begin
     FileName:='-B '+FileName;
     FileName:='-B '+FileName;
   { tokens are created and distroed by compiler.compile !! PM }
   { tokens are created and distroed by compiler.compile !! PM }
   DoneTokens;
   DoneTokens;
+  SetStatus('Compiling...');
   FpIntF.Compile(FileName,SwitchesPath);
   FpIntF.Compile(FileName,SwitchesPath);
+  SetStatus('Finished compiling...');
   { tokens are created and distroed by compiler.compile !! PM }
   { tokens are created and distroed by compiler.compile !! PM }
   InitTokens;
   InitTokens;
   if LinkAfter and IsExe and
   if LinkAfter and IsExe and
@@ -724,6 +730,7 @@ begin
     begin
     begin
        CompilationPhase:=cpLinking;
        CompilationPhase:=cpLinking;
        CompilerStatusDialog^.Update;
        CompilerStatusDialog^.Update;
+       SetStatus('Linking...');
 {$ifndef redircompiler}
 {$ifndef redircompiler}
        { At least here we want to catch output
        { At least here we want to catch output
         of batch file PM }
         of batch file PM }
@@ -737,6 +744,7 @@ begin
        DosExecute(GetEnv('COMSPEC'),'/C '+GetExePath+PpasFile+source_os.scriptext);
        DosExecute(GetEnv('COMSPEC'),'/C '+GetExePath+PpasFile+source_os.scriptext);
        Error:=DosError;
        Error:=DosError;
 {$endif}
 {$endif}
+       SetStatus('Finished linking...');
 {$ifndef redircompiler}
 {$ifndef redircompiler}
        RestoreRedirOut;
        RestoreRedirOut;
        RestoreRedirError;
        RestoreRedirError;
@@ -774,6 +782,7 @@ begin
   RestoreRedirOut;
   RestoreRedirOut;
   RestoreRedirError;
   RestoreRedirError;
 {$endif}
 {$endif}
+  PopStatus;
 { Set end status }
 { Set end status }
   if CompilationPhase<>cpAborted then
   if CompilationPhase<>cpAborted then
     if (status.errorCount=0) then
     if (status.errorCount=0) then
@@ -903,7 +912,10 @@ end;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.58  2000-05-29 10:44:56  pierre
+  Revision 1.59  2000-06-16 08:50:40  pierre
+   + new bunch of Gabor's changes
+
+  Revision 1.58  2000/05/29 10:44:56  pierre
    + New bunch of Gabor's changes: see fixes.txt
    + New bunch of Gabor's changes: see fixes.txt
 
 
   Revision 1.57  2000/05/02 08:42:27  pierre
   Revision 1.57  2000/05/02 08:42:27  pierre

+ 14 - 3
ide/text/fpconst.pas

@@ -35,6 +35,7 @@ const
      DesktopName          = 'fp.dsk';
      DesktopName          = 'fp.dsk';
      BrowserName          = 'fp.brw';
      BrowserName          = 'fp.brw';
      BackgroundName       = 'fp.ans';
      BackgroundName       = 'fp.ans';
+     ReadmeName           = 'readme.ide';
 
 
      ToolCaptureName      = '__tool__.out'; { all '$' signs replaces with '_'s }
      ToolCaptureName      = '__tool__.out'; { all '$' signs replaces with '_'s }
      FilterCaptureName    = '_filter_.out';
      FilterCaptureName    = '_filter_.out';
@@ -43,6 +44,8 @@ const
      GDBOutFileName       = 'gdb___.out';
      GDBOutFileName       = 'gdb___.out';
      GDBOutPutFileName    = 'gdb___.txt';
      GDBOutPutFileName    = 'gdb___.txt';
      DesktopTempName      = 'fp___.dsk';
      DesktopTempName      = 'fp___.dsk';
+     GrepOutName          = 'grep$$.out';
+     GrepErrName          = 'grep$$.err';
 
 
      HTMLIndexExt         = '.htx';
      HTMLIndexExt         = '.htx';
      HTMLExt              = '.htm';
      HTMLExt              = '.htm';
@@ -109,7 +112,7 @@ const
      cmPrimaryFile       = 216;
      cmPrimaryFile       = 216;
      cmClearPrimary      = 217;
      cmClearPrimary      = 217;
      cmInformation       = 218;
      cmInformation       = 218;
-     cmWindowList        = 219;
+{     cmWindowList        = 219; defined in command.pas, too! - Gabor }
      cmHelpTopicSearch   = 220;
      cmHelpTopicSearch   = 220;
      cmMsgGotoSource     = 221;
      cmMsgGotoSource     = 221;
      cmMsgTrackSource    = 222;
      cmMsgTrackSource    = 222;
@@ -138,6 +141,7 @@ const
 
 
      cmNotImplemented    = 1000;
      cmNotImplemented    = 1000;
      cmNewFromTemplate   = 1001;
      cmNewFromTemplate   = 1001;
+     cmShowReadme        = 1002;
 
 
      cmSearchWindow      = 1500;
      cmSearchWindow      = 1500;
      cmSourceWndClosing  = 1601;
      cmSourceWndClosing  = 1601;
@@ -149,6 +153,8 @@ const
      cmAddItem           = 1620;
      cmAddItem           = 1620;
      cmEditItem          = 1621;
      cmEditItem          = 1621;
      cmDeleteItem        = 1622;
      cmDeleteItem        = 1622;
+     cmShowItem          = 1623;
+     cmHideItem          = 1624;
 
 
      cmUserScreen        = 1650;
      cmUserScreen        = 1650;
      cmUserScreenWindow  = 1651;
      cmUserScreenWindow  = 1651;
@@ -369,7 +375,9 @@ const
 
 
      CFPToolTip     = #228;
      CFPToolTip     = #228;
 
 
-     CFPCodeMemo    = #26#26#26#28#26#29#26#26#26#27#26#26#26#26#26#26#26;
+     CFPMemo        = #26#26#26#28#26#29#26#26#26#27#26#26#26#26#26#26#26;
+
+     CFPSymbolMemo  = #9#9#9#9#9#9#9#9#9#9#9#9#9#9#9#9#9;
 
 
      CHTMLSectionAttrs = #229#230#231#232#233#234;
      CHTMLSectionAttrs = #229#230#231#232#233#234;
 
 
@@ -397,7 +405,10 @@ implementation
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.39  2000-05-30 07:18:33  pierre
+  Revision 1.40  2000-06-16 08:50:40  pierre
+   + new bunch of Gabor's changes
+
+  Revision 1.39  2000/05/30 07:18:33  pierre
    + colors for HTML help by Gabor
    + colors for HTML help by Gabor
 
 
   Revision 1.38  2000/05/02 08:42:27  pierre
   Revision 1.38  2000/05/02 08:42:27  pierre

+ 6 - 1
ide/text/fphelp.pas

@@ -94,6 +94,8 @@ begin
   case AHelpCtx of
   case AHelpCtx of
     hcNoContext     : S:='';
     hcNoContext     : S:='';
 
 
+    hcDragging      : S:='';
+
     hcSourceWindow  : S:='';
     hcSourceWindow  : S:='';
     hcHelpWindow    : S:='';
     hcHelpWindow    : S:='';
     hcCalcWindow    : S:='';
     hcCalcWindow    : S:='';
@@ -478,7 +480,10 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.32  2000-05-30 07:18:33  pierre
+  Revision 1.33  2000-06-16 08:50:40  pierre
+   + new bunch of Gabor's changes
+
+  Revision 1.32  2000/05/30 07:18:33  pierre
    + colors for HTML help by Gabor
    + colors for HTML help by Gabor
 
 
   Revision 1.31  2000/05/29 10:44:56  pierre
   Revision 1.31  2000/05/29 10:44:56  pierre

+ 71 - 8
ide/text/fpide.pas

@@ -47,6 +47,7 @@ type
       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;}
+      procedure   ShowReadme;
       destructor  Done; virtual;
       destructor  Done; virtual;
       procedure   ShowUserScreen;
       procedure   ShowUserScreen;
       procedure   ShowIDEScreen;
       procedure   ShowIDEScreen;
@@ -413,11 +414,12 @@ begin
       NewItem(menu_window_zoom,menu_key_window_zoom, kbF5, cmZoom, hcZoom,
       NewItem(menu_window_zoom,menu_key_window_zoom, kbF5, cmZoom, hcZoom,
       NewItem(menu_window_next,menu_key_window_next, kbF6, cmNext, hcNext,
       NewItem(menu_window_next,menu_key_window_next, kbF6, cmNext, hcNext,
       NewItem(menu_window_previous,menu_key_window_previous, kbShiftF6, cmPrev, hcPrev,
       NewItem(menu_window_previous,menu_key_window_previous, kbShiftF6, cmPrev, hcPrev,
+      NewItem(menu_window_hide,menu_key_window_hide, kbCtrlF6, cmHide, hcHide,
       NewItem(menu_window_close,menu_key_window_close, kbAltF3, cmClose, hcClose,
       NewItem(menu_window_close,menu_key_window_close, kbAltF3, cmClose, hcClose,
       NewLine(
       NewLine(
       NewItem(menu_window_list,menu_key_window_list, kbAlt0, cmWindowList, hcWindowList,
       NewItem(menu_window_list,menu_key_window_list, kbAlt0, cmWindowList, hcWindowList,
       NewItem(menu_window_update,'', kbNoKey, cmUpdate, hcUpdate,
       NewItem(menu_window_update,'', kbNoKey, cmUpdate, hcUpdate,
-      nil))))))))))))),
+      nil)))))))))))))),
     NewSubMenu(menu_help, hcHelpMenu, NewMenu(
     NewSubMenu(menu_help, hcHelpMenu, NewMenu(
       NewItem(menu_help_contents,'', kbNoKey, cmHelpContents, hcHelpContents,
       NewItem(menu_help_contents,'', kbNoKey, cmHelpContents, hcHelpContents,
       NewItem(menu_help_index,menu_key_help_helpindex, kbShiftF1, cmHelpIndex, hcHelpIndex,
       NewItem(menu_help_index,menu_key_help_helpindex, kbShiftF1, cmHelpIndex, hcHelpIndex,
@@ -440,6 +442,14 @@ begin
   GetExtent(R);
   GetExtent(R);
   R.A.Y := R.B.Y - 1;
   R.A.Y := R.B.Y - 1;
   StatusLine:=New(PIDEStatusLine, Init(R,
   StatusLine:=New(PIDEStatusLine, Init(R,
+    NewStatusDef(hcDragging, hcDragging,
+      NewStatusKey(status_help, kbF1, cmHelp,
+      StdStatusKeys(
+      NewStatusKey('~'#24#25#26#27+'~ Move', kbNoKey, 65535,
+      NewStatusKey('~Shift+'#24#25#26#27+'~ Size', kbNoKey, 65535,
+      NewStatusKey('~'#17+'ÄÙ~ Done', kbNoKey, 65535,
+      NewStatusKey('~Esc~ Cancel', kbNoKey, 65535,
+      nil)))))),
     NewStatusDef(hcFirstCommand, hcLastCommand,
     NewStatusDef(hcFirstCommand, hcLastCommand,
       NewStatusKey(status_help, kbF1, cmHelp,
       NewStatusKey(status_help, kbF1, cmHelp,
       StdStatusKeys(
       StdStatusKeys(
@@ -487,7 +497,7 @@ begin
       NewStatusKey(status_localmenu, kbAltF10, cmLocalMenu,
       NewStatusKey(status_localmenu, kbAltF10, cmLocalMenu,
       StdStatusKeys(
       StdStatusKeys(
       nil)))))),
       nil)))))),
-    nil)))))))));
+    nil))))))))));
 end;
 end;
 
 
 procedure TIDEApp.Idle;
 procedure TIDEApp.Idle;
@@ -507,12 +517,16 @@ begin
   if Event.What<>evNothing then
   if Event.What<>evNothing then
     LastEvent:=GetDosTicks
     LastEvent:=GetDosTicks
   else
   else
-    if abs(GetDosTicks-LastEvent)>SleepTimeOut then
-      GiveUpTimeSlice;
+    begin
+      if abs(GetDosTicks-LastEvent)>SleepTimeOut then
+        GiveUpTimeSlice;
+    end;
 end;
 end;
 
 
 procedure TIDEApp.HandleEvent(var Event: TEvent);
 procedure TIDEApp.HandleEvent(var Event: TEvent);
 var DontClear: boolean;
 var DontClear: boolean;
+    TempS: string;
+    ForceDlg: boolean;
 {$ifdef HasSignal}
 {$ifdef HasSignal}
     CtrlCCatched : boolean;
     CtrlCCatched : boolean;
 {$endif HasSignal}
 {$endif HasSignal}
@@ -530,6 +544,11 @@ begin
     CtrlCCatched:=false;
     CtrlCCatched:=false;
 {$endif HasSignal}
 {$endif HasSignal}
   case Event.What of
   case Event.What of
+       evKeyDown :
+         begin
+           DontClear:=true;
+           { just for debugging purposes }
+         end;
        evCommand :
        evCommand :
          begin
          begin
            DontClear:=false;
            DontClear:=false;
@@ -539,9 +558,19 @@ begin
              cmNew           : NewEditor;
              cmNew           : NewEditor;
              cmNewFromTemplate: NewFromTemplate;
              cmNewFromTemplate: NewFromTemplate;
              cmOpen          : begin
              cmOpen          : begin
+                                 ForceDlg:=false;
                                  if (DirOf(OpenFileName)='') or (Pos(ListSeparator,OpenFileName)<>0) then
                                  if (DirOf(OpenFileName)='') or (Pos(ListSeparator,OpenFileName)<>0) then
-                                   OpenFileName:=LocateFile(OpenFileName);
-                                 Open(OpenFileName);
+                                   begin
+                                     TempS:=LocateFile(OpenFileName);
+                                     if TempS='' then
+                                       ForceDlg:=true
+                                     else
+                                       OpenFileName:=TempS;
+                                   end;
+                                 if ForceDlg then
+                                   OpenSearch(OpenFileName)
+                                 else
+                                   Open(OpenFileName);
                                  OpenFileName:='';
                                  OpenFileName:='';
                                end;
                                end;
              cmSaveAll       : SaveAll;
              cmSaveAll       : SaveAll;
@@ -626,6 +655,7 @@ begin
              cmHelpUsingHelp : HelpUsingHelp;
              cmHelpUsingHelp : HelpUsingHelp;
              cmHelpFiles     : HelpFiles;
              cmHelpFiles     : HelpFiles;
              cmAbout         : About;
              cmAbout         : About;
+             cmShowReadme    : ShowReadme;
            else DontClear:=true;
            else DontClear:=true;
            end;
            end;
            if DontClear=false then ClearEvent(Event);
            if DontClear=false then ClearEvent(Event);
@@ -807,7 +837,8 @@ end;
 procedure TIDEApp.Update;
 procedure TIDEApp.Update;
 begin
 begin
   SetCmdState([cmSaveAll],IsThereAnyEditor);
   SetCmdState([cmSaveAll],IsThereAnyEditor);
-  SetCmdState([cmCloseAll,cmTile,cmCascade,cmWindowList],IsThereAnyWindow);
+  SetCmdState([cmCloseAll,cmWindowList],IsThereAnyWindow);
+  SetCmdState([cmTile,cmCascade],IsThereAnyVisibleWindow);
   SetCmdState([cmFindProcedure,cmObjects,cmModules,cmGlobals,cmSymbol{,cmInformation}],IsSymbolInfoAvailable);
   SetCmdState([cmFindProcedure,cmObjects,cmModules,cmGlobals,cmSymbol{,cmInformation}],IsSymbolInfoAvailable);
 {$ifndef NODEBUG}
 {$ifndef NODEBUG}
   SetCmdState([cmResetDebugger,cmUntilReturn],assigned(debugger) and debugger^.debuggee_started);
   SetCmdState([cmResetDebugger,cmUntilReturn],assigned(debugger) and debugger^.debuggee_started);
@@ -926,6 +957,35 @@ begin
   DoExecute(GetEnv('COMSPEC'), '', '', '', exDosShell);
   DoExecute(GetEnv('COMSPEC'), '', '', '', exDosShell);
 end;
 end;
 
 
+procedure TIDEApp.ShowReadme;
+var R,R2: TRect;
+    D: PCenterDialog;
+    M: PFPMemo;
+    VSB: PScrollBar;
+    S: PBufStream;
+begin
+  New(S, Init(ReadmeName, stOpenRead, 4096));
+  if S^.Status=stOK then
+  begin
+    R.Assign(0,0,63,18);
+    New(D, Init(R, 'Free Pascal IDE'));
+    with D^ do
+    begin
+      GetExtent(R);
+      R.Grow(-2,-2); Inc(R.B.Y);
+      R2.Copy(R); R2.Move(1,0); R2.A.X:=R2.B.X-1;
+      New(VSB, Init(R2)); VSB^.GrowMode:=0; Insert(VSB);
+      New(M, Init(R,nil,VSB,nil));
+      M^.LoadFromStream(S);
+      M^.ReadOnly:=true;
+      Insert(M);
+    end;
+    InsertOK(D);
+    ExecuteDialog(D,nil);
+  end;
+  Dispose(S, Done);
+end;
+
 {$I FPMFILE.INC}
 {$I FPMFILE.INC}
 
 
 {$I FPMEDIT.INC}
 {$I FPMEDIT.INC}
@@ -1000,7 +1060,10 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.62  2000-06-11 07:01:33  peter
+  Revision 1.63  2000-06-16 08:50:40  pierre
+   + new bunch of Gabor's changes
+
+  Revision 1.62  2000/06/11 07:01:33  peter
     * give watches window also a number
     * give watches window also a number
     * leave watches window in the bottom when cascading windows
     * leave watches window in the bottom when cascading windows
 
 

+ 10 - 1
ide/text/fpini.pas

@@ -48,6 +48,7 @@ const
   secTools       = 'Tools';
   secTools       = 'Tools';
   secSourcePath  = 'SourcePath';
   secSourcePath  = 'SourcePath';
   secPreferences = 'Preferences';
   secPreferences = 'Preferences';
+  secMisc        = 'Misc';
 
 
   { INI file tags }
   { INI file tags }
   ieRecentFile       = 'RecentFile';
   ieRecentFile       = 'RecentFile';
@@ -89,6 +90,7 @@ const
   ieDesktopLocation  = 'DesktopLocation';
   ieDesktopLocation  = 'DesktopLocation';
   ieDesktopFlags     = 'DesktopFileFlags';
   ieDesktopFlags     = 'DesktopFileFlags';
   ieCenterDebuggerRow= 'CenterCurrentLineWhileDebugging';
   ieCenterDebuggerRow= 'CenterCurrentLineWhileDebugging';
+  ieShowReadme       = 'ShowReadme';
 
 
 procedure InitINIFile;
 procedure InitINIFile;
 var S: string;
 var S: string;
@@ -380,6 +382,8 @@ begin
   AutoSaveOptions:=INIFile^.GetIntEntry(secPreferences,ieAutoSave,AutoSaveOptions);
   AutoSaveOptions:=INIFile^.GetIntEntry(secPreferences,ieAutoSave,AutoSaveOptions);
   MiscOptions:=INIFile^.GetIntEntry(secPreferences,ieMiscOptions,MiscOptions);
   MiscOptions:=INIFile^.GetIntEntry(secPreferences,ieMiscOptions,MiscOptions);
   DesktopLocation:=INIFile^.GetIntEntry(secPreferences,ieDesktopLocation,DesktopLocation);
   DesktopLocation:=INIFile^.GetIntEntry(secPreferences,ieDesktopLocation,DesktopLocation);
+  { Misc }
+  ShowReadme:=INIFile^.GetIntEntry(secMisc,ieShowReadme,{integer(ShowReadme)}1)<>0;
   Dispose(INIFile, Done);
   Dispose(INIFile, Done);
  end;
  end;
   ReadINIFile:=OK;
   ReadINIFile:=OK;
@@ -514,6 +518,8 @@ begin
   INIFile^.SetIntEntry(secPreferences,ieAutoSave,AutoSaveOptions);
   INIFile^.SetIntEntry(secPreferences,ieAutoSave,AutoSaveOptions);
   INIFile^.SetIntEntry(secPreferences,ieMiscOptions,MiscOptions);
   INIFile^.SetIntEntry(secPreferences,ieMiscOptions,MiscOptions);
   INIFile^.SetIntEntry(secPreferences,ieDesktopLocation,DesktopLocation);
   INIFile^.SetIntEntry(secPreferences,ieDesktopLocation,DesktopLocation);
+  { Misc }
+  INIFile^.SetIntEntry(secMisc,ieShowReadme,integer(ShowReadme));
   OK:=INIFile^.Update;
   OK:=INIFile^.Update;
   Dispose(INIFile, Done);
   Dispose(INIFile, Done);
   WriteINIFile:=OK;
   WriteINIFile:=OK;
@@ -522,7 +528,10 @@ end;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.28  2000-03-21 23:30:22  pierre
+  Revision 1.29  2000-06-16 08:50:41  pierre
+   + new bunch of Gabor's changes
+
+  Revision 1.28  2000/03/21 23:30:22  pierre
    adapted to wcedit addition by Gabor
    adapted to wcedit addition by Gabor
 
 
   Revision 1.27  2000/03/13 20:38:02  pierre
   Revision 1.27  2000/03/13 20:38:02  pierre

+ 5 - 2
ide/text/fpmfile.inc

@@ -138,7 +138,7 @@ begin
    begin
    begin
      ClearFormatParams; AddFormatParamStr(FileName);
      ClearFormatParams; AddFormatParamStr(FileName);
      FormatStr(S,label_lookingfor,FormatParams);
      FormatStr(S,label_lookingfor,FormatParams);
-     New(D, Init(FileName+'*',dialog_openafile,S,fdOpenButton,0));
+     New(D, Init(FileName,dialog_openafile,S,fdOpenButton,0));
      OpenIt:=Desktop^.ExecView(D)<>cmCancel;
      OpenIt:=Desktop^.ExecView(D)<>cmCancel;
      if OpenIt then
      if OpenIt then
        Begin
        Begin
@@ -199,7 +199,10 @@ end;
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.20  2000-05-02 08:42:28  pierre
+  Revision 1.21  2000-06-16 08:50:41  pierre
+   + new bunch of Gabor's changes
+
+  Revision 1.20  2000/05/02 08:42:28  pierre
    * new set of Gabor changes: see fixes.txt
    * new set of Gabor changes: see fixes.txt
 
 
   Revision 1.19  2000/04/25 08:42:33  pierre
   Revision 1.19  2000/04/25 08:42:33  pierre

+ 5 - 2
ide/text/fpmopts.inc

@@ -465,7 +465,7 @@ begin
     Insert(New(PLabel, Init(R2, label_debugger_profileswitches, CB)));
     Insert(New(PLabel, Init(R2, label_debugger_profileswitches, CB)));
 
 
     {custom }
     {custom }
-    Inc(R2.A.Y,1+DebugInfoSwitches^.ItemCount+2); R2.B.Y:=R2.A.Y+1;
+    Inc(R2.A.Y,1+DebugInfoSwitches^.ItemCount+1); R2.B.Y:=R2.A.Y+1;
     New(IL2, Init(R2, 255));
     New(IL2, Init(R2, 255));
     IL2^.Data^:=CustomArg[SwitchesMode];
     IL2^.Data^:=CustomArg[SwitchesMode];
     Insert(IL2);
     Insert(IL2);
@@ -1214,7 +1214,10 @@ end;
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.34  2000-05-30 07:18:33  pierre
+  Revision 1.35  2000-06-16 08:50:41  pierre
+   + new bunch of Gabor's changes
+
+  Revision 1.34  2000/05/30 07:18:33  pierre
    + colors for HTML help by Gabor
    + colors for HTML help by Gabor
 
 
   Revision 1.33  2000/05/02 08:42:28  pierre
   Revision 1.33  2000/05/02 08:42:28  pierre

+ 4 - 3
ide/text/fpmtools.inc

@@ -138,8 +138,6 @@ end;
 
 
 procedure TIDEApp.DoGrep;
 procedure TIDEApp.DoGrep;
 Const
 Const
-  GrepOutName = 'grep$$.out';
-  GrepErrName = 'grep$$.err';
   GrepExeName = 'grep'+ExeExt;
   GrepExeName = 'grep'+ExeExt;
 var
 var
   PGrepDialog : PCenterDialog;
   PGrepDialog : PCenterDialog;
@@ -296,7 +294,10 @@ end;
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.20  2000-05-02 08:42:28  pierre
+  Revision 1.21  2000-06-16 08:50:41  pierre
+   + new bunch of Gabor's changes
+
+  Revision 1.20  2000/05/02 08:42:28  pierre
    * new set of Gabor changes: see fixes.txt
    * new set of Gabor changes: see fixes.txt
 
 
   Revision 1.19  2000/03/13 20:32:56  pierre
   Revision 1.19  2000/03/13 20:32:56  pierre

+ 68 - 6
ide/text/fpmwnd.inc

@@ -41,7 +41,9 @@ type
     private
     private
       LB: PWindowListBox;
       LB: PWindowListBox;
       C : PCollection;
       C : PCollection;
+      BtnShow,BtnHide: PNoUpdateButton;
       procedure  UpdateList;
       procedure  UpdateList;
+      procedure  UpdateButtons;
     end;
     end;
 
 
 constructor TWindowListBox.Init(var Bounds: TRect; AScrollBar: PScrollBar);
 constructor TWindowListBox.Init(var Bounds: TRect; AScrollBar: PScrollBar);
@@ -74,6 +76,10 @@ begin
   end;
   end;
   if PWindow(P)^.Number<>0 then
   if PWindow(P)^.Number<>0 then
     S:=S+'('+IntToStr(PWindow(P)^.Number)+')';
     S:=S+'('+IntToStr(PWindow(P)^.Number)+')';
+  if P^.GetState(sfVisible) then S:=' '+S else
+    begin
+      S:='*'+S+' - '+msg_windowlist_hidden;
+    end;
   GetText:=copy(S,1,MaxLen);
   GetText:=copy(S,1,MaxLen);
 end;
 end;
 
 
@@ -100,12 +106,19 @@ begin
 
 
   GetExtent(R); R.Grow(-2,-2); Inc(R.A.Y); R.A.X:=R.B.X-13+1; R.B.Y:=R.A.Y+2;
   GetExtent(R); R.Grow(-2,-2); Inc(R.A.Y); R.A.X:=R.B.X-13+1; R.B.Y:=R.A.Y+2;
   Insert(New(PButton, Init(R, button_OK, cmOK, bfDefault)));
   Insert(New(PButton, Init(R, button_OK, cmOK, bfDefault)));
-  R.Move(0,3);
+  R.Move(0,2);
   Insert(New(PButton, Init(R, button_Delete, cmDeleteItem, bfNormal)));
   Insert(New(PButton, Init(R, button_Delete, cmDeleteItem, bfNormal)));
-  R.Move(0,3);
+  R.Move(0,2);
+  New(BtnShow, Init(R, button_Show, cmShowItem, bfNormal));
+  Insert(BtnShow);
+  R.Move(0,2);
+  New(BtnHide, Init(R, button_Hide, cmHideItem, bfNormal));
+  Insert(BtnHide);
+  R.Move(0,2);
   Insert(New(PButton, Init(R, button_Cancel, cmCancel, bfNormal)));
   Insert(New(PButton, Init(R, button_Cancel, cmCancel, bfNormal)));
 
 
   LB^.Select;
   LB^.Select;
+  PutCommand(@Self,evBroadcast,cmListFocusChanged,LB);
 end;
 end;
 
 
 procedure TWindowListDialog.UpdateList;
 procedure TWindowListDialog.UpdateList;
@@ -113,18 +126,39 @@ procedure AddIt(P: PView); {$ifndef FPC}far;{$endif}
 begin
 begin
   if (P<>pointer(Desktop^.Background)) and
   if (P<>pointer(Desktop^.Background)) and
      (P^.GetState(sfDisabled)=false) and
      (P^.GetState(sfDisabled)=false) and
-     ((P^.Options and ofSelectable)<>0) and
-     (P^.GetState(sfVisible)) then
+     ((P^.Options and ofSelectable)<>0) {and
+     (P^.GetState(sfVisible)) }then
      C^.Insert(P);
      C^.Insert(P);
 end;
 end;
 begin
 begin
   C^.DeleteAll;
   C^.DeleteAll;
   Desktop^.ForEach(@AddIt);
   Desktop^.ForEach(@AddIt);
   LB^.SetRange(C^.Count);
   LB^.SetRange(C^.Count);
+  UpdateButtons;
+  ReDraw;
+end;
+
+procedure TWindowListDialog.UpdateButtons;
+var W: PView;
+begin
+  if LB^.Range>0 then
+    begin
+      W:=LB^.List^.At(LB^.Focused);
+      if Assigned(BtnShow) then
+        BtnShow^.SetState(sfDisabled,W^.GetState(sfVisible));
+      if Assigned(BtnHide) then
+        BtnHide^.SetState(sfDisabled,not W^.GetState(sfVisible));
+    end
+  else
+    begin
+      BtnShow^.SetState(sfDisabled,true);
+      BtnHide^.SetState(sfDisabled,true);
+    end;
   ReDraw;
   ReDraw;
 end;
 end;
 
 
 procedure TWindowListDialog.HandleEvent(var Event: TEvent);
 procedure TWindowListDialog.HandleEvent(var Event: TEvent);
+var W: PWindow;
 begin
 begin
   case Event.What of
   case Event.What of
     evKeyDown :
     evKeyDown :
@@ -135,6 +169,12 @@ begin
             ClearEvent(Event);
             ClearEvent(Event);
           end;
           end;
       end;
       end;
+    evBroadcast :
+      case Event.Command of
+        cmListFocusChanged :
+          if Event.InfoPtr=LB then
+            UpdateButtons;
+      end;
     evCommand :
     evCommand :
       case Event.Command of
       case Event.Command of
         cmDeleteItem :
         cmDeleteItem :
@@ -144,9 +184,28 @@ begin
             UpdateList;
             UpdateList;
             ClearEvent(Event);
             ClearEvent(Event);
           end;
           end;
+        cmShowItem :
+          if C^.Count>0 then
+          begin
+            PWindow(C^.At(LB^.Focused))^.Show;
+            UpdateList;
+            ClearEvent(Event);
+          end;
+        cmHideItem :
+          if C^.Count>0 then
+          begin
+            PWindow(C^.At(LB^.Focused))^.Hide;
+            UpdateList;
+            ClearEvent(Event);
+          end;
         cmOK :
         cmOK :
           if C^.Count>0 then
           if C^.Count>0 then
-            PView(C^.At(LB^.Focused))^.MakeFirst;
+          begin
+            W:=PWindow(C^.At(LB^.Focused));
+            if W^.GetState(sfVisible)=false then
+              W^.Show;
+            W^.MakeFirst;
+          end;
       end;
       end;
   end;
   end;
   inherited HandleEvent(Event);
   inherited HandleEvent(Event);
@@ -168,7 +227,10 @@ end;
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.17  2000-05-02 08:42:28  pierre
+  Revision 1.18  2000-06-16 08:50:41  pierre
+   + new bunch of Gabor's changes
+
+  Revision 1.17  2000/05/02 08:42:28  pierre
    * new set of Gabor changes: see fixes.txt
    * new set of Gabor changes: see fixes.txt
 
 
   Revision 1.16  2000/04/18 11:42:37  pierre
   Revision 1.16  2000/04/18 11:42:37  pierre

+ 15 - 1
ide/text/fpstre.inc

@@ -36,6 +36,7 @@ const
       label_browsertab_reference = 'R';
       label_browsertab_reference = 'R';
       label_browsertab_inheritance = 'I';
       label_browsertab_inheritance = 'I';
       label_browsertab_memory = 'M';
       label_browsertab_memory = 'M';
+      label_browsertab_unit = 'U';
 
 
 {$ifdef USERESSTRINGS}
 {$ifdef USERESSTRINGS}
     resourcestring
     resourcestring
@@ -144,6 +145,7 @@ const
       menu_window_zoom       = '~Z~oom';
       menu_window_zoom       = '~Z~oom';
       menu_window_next       = '~N~ext';
       menu_window_next       = '~N~ext';
       menu_window_previous   = '~P~revious';
       menu_window_previous   = '~P~revious';
+      menu_window_hide       = '~H~ide';
       menu_window_close      = '~C~lose';
       menu_window_close      = '~C~lose';
       menu_window_list       = '~L~ist...';
       menu_window_list       = '~L~ist...';
       menu_window_update     = '~R~efresh display';
       menu_window_update     = '~R~efresh display';
@@ -230,6 +232,7 @@ const
       menu_key_window_previous = 'Shift+F6';
       menu_key_window_previous = 'Shift+F6';
       menu_key_window_close  = 'Alt+F3';
       menu_key_window_close  = 'Alt+F3';
       menu_key_window_list   = 'Alt+0';
       menu_key_window_list   = 'Alt+0';
+      menu_key_window_hide   = 'Ctrl+F6';
 
 
       menu_key_help_helpindex= menu_key_common_helpindex;
       menu_key_help_helpindex= menu_key_common_helpindex;
       menu_key_help_topicsearch = menu_key_common_topicsearch;
       menu_key_help_topicsearch = menu_key_common_topicsearch;
@@ -569,6 +572,8 @@ const
       dialog_windowlist = 'Window List';
       dialog_windowlist = 'Window List';
       label_wndlist_windows = '~W~indows';
       label_wndlist_windows = '~W~indows';
 
 
+      msg_windowlist_hidden = 'hidden';
+
       msg_userscreennotavailable = 'Sorry, user screen not available.';
       msg_userscreennotavailable = 'Sorry, user screen not available.';
 
 
       { Tools $PROMPT() dialog }
       { Tools $PROMPT() dialog }
@@ -647,6 +652,10 @@ const
       msg_sizeinmemory = 'Size in memory';
       msg_sizeinmemory = 'Size in memory';
       msg_sizeonstack = 'Size on stack';
       msg_sizeonstack = 'Size on stack';
 
 
+      msg_usedfirstin = 'Used first in';
+      msg_mainsource = 'Main source';
+      msg_sourcefiles = 'Source files';
+
       { Help messages }
       { Help messages }
       msg_indexingfile = 'Indexing file %s';
       msg_indexingfile = 'Indexing file %s';
       msg_loadinghelpfiles = 'Loading help files...';
       msg_loadinghelpfiles = 'Loading help files...';
@@ -795,6 +804,8 @@ const
       button_Edit        = '~E~dit';
       button_Edit        = '~E~dit';
       button_Delete      = '~D~elete';
       button_Delete      = '~D~elete';
       button_Close       = '~C~lose';
       button_Close       = '~C~lose';
+      button_Show        = '~S~how';
+      button_Hide        = '~H~ide';
 
 
       { Compiler message classes }
       { Compiler message classes }
       msg_class_normal   = '';
       msg_class_normal   = '';
@@ -950,7 +961,10 @@ const
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.3  2000-05-30 07:18:33  pierre
+  Revision 1.4  2000-06-16 08:50:41  pierre
+   + new bunch of Gabor's changes
+
+  Revision 1.3  2000/05/30 07:18:33  pierre
    + colors for HTML help by Gabor
    + colors for HTML help by Gabor
 
 
   Revision 1.2  2000/05/29 10:44:57  pierre
   Revision 1.2  2000/05/29 10:44:57  pierre

+ 15 - 1
ide/text/fpstrh.inc

@@ -36,6 +36,7 @@ const
       label_browsertab_reference = 'R';
       label_browsertab_reference = 'R';
       label_browsertab_inheritance = 'I';
       label_browsertab_inheritance = 'I';
       label_browsertab_memory = 'M';
       label_browsertab_memory = 'M';
+      label_browsertab_unit = 'U';
 
 
 {$ifdef USERESSTRINGS}
 {$ifdef USERESSTRINGS}
     resourcestring
     resourcestring
@@ -144,6 +145,7 @@ const
       menu_window_zoom       = '~N~agy¡t s';
       menu_window_zoom       = '~N~agy¡t s';
       menu_window_next       = '~K~”vetkez‹';
       menu_window_next       = '~K~”vetkez‹';
       menu_window_previous   = '~E~l‹z‹';
       menu_window_previous   = '~E~l‹z‹';
+      menu_window_hide       = '~R~ejt‚s';
       menu_window_close      = 'Be~z~ r s';
       menu_window_close      = 'Be~z~ r s';
       menu_window_list       = '~L~ista...';
       menu_window_list       = '~L~ista...';
       menu_window_update     = 'Megjelen¡t‹ ~f~riss¡t‚se';
       menu_window_update     = 'Megjelen¡t‹ ~f~riss¡t‚se';
@@ -230,6 +232,7 @@ const
       menu_key_window_previous = 'Shift+F6';
       menu_key_window_previous = 'Shift+F6';
       menu_key_window_close  = 'Alt+F3';
       menu_key_window_close  = 'Alt+F3';
       menu_key_window_list   = 'Alt+0';
       menu_key_window_list   = 'Alt+0';
+      menu_key_window_hide   = 'Ctrl+F6';
 
 
       menu_key_help_helpindex= menu_key_common_helpindex;
       menu_key_help_helpindex= menu_key_common_helpindex;
       menu_key_help_topicsearch = menu_key_common_topicsearch;
       menu_key_help_topicsearch = menu_key_common_topicsearch;
@@ -569,6 +572,8 @@ const
       dialog_windowlist = 'Ablakok list ja';
       dialog_windowlist = 'Ablakok list ja';
       label_wndlist_windows = '~A~blakok';
       label_wndlist_windows = '~A~blakok';
 
 
+      msg_windowlist_hidden = 'rejtett';
+
       msg_userscreennotavailable = 'A felhaszn l¢i k‚perny‹ nem el‚rhet‹.';
       msg_userscreennotavailable = 'A felhaszn l¢i k‚perny‹ nem el‚rhet‹.';
 
 
       { Tools $PROMPT() dialog }
       { Tools $PROMPT() dialog }
@@ -647,6 +652,10 @@ const
       msg_sizeinmemory = 'M‚ret a mem¢ri ban';
       msg_sizeinmemory = 'M‚ret a mem¢ri ban';
       msg_sizeonstack = 'M‚ret a vermen';
       msg_sizeonstack = 'M‚ret a vermen';
 
 
+      msg_usedfirstin = 'El‹sz”r haszn lva';
+      msg_mainsource = 'F‹ forr s';
+      msg_sourcefiles = 'Forr s-f jlok';
+
       { Help messages }
       { Help messages }
       msg_indexingfile = '%s f jl indexel‚se';
       msg_indexingfile = '%s f jl indexel‚se';
       msg_loadinghelpfiles = 'S£g¢ f jlok bet”lt‚se...';
       msg_loadinghelpfiles = 'S£g¢ f jlok bet”lt‚se...';
@@ -795,6 +804,8 @@ const
       button_Edit        = 'S~z~erk.';
       button_Edit        = 'S~z~erk.';
       button_Delete      = '~T~”rl‚s';
       button_Delete      = '~T~”rl‚s';
       button_Close       = 'Be~z~ r';
       button_Close       = 'Be~z~ r';
+      button_Show        = '~M~utat';
+      button_Hide        = '~R~ejt';
 
 
       { Compiler message classes }
       { Compiler message classes }
       msg_class_normal   = '';
       msg_class_normal   = '';
@@ -950,7 +961,10 @@ const
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.3  2000-05-30 07:18:33  pierre
+  Revision 1.4  2000-06-16 08:50:42  pierre
+   + new bunch of Gabor's changes
+
+  Revision 1.3  2000/05/30 07:18:33  pierre
    + colors for HTML help by Gabor
    + colors for HTML help by Gabor
 
 
   Revision 1.2  2000/05/29 10:44:57  pierre
   Revision 1.2  2000/05/29 10:44:57  pierre

+ 163 - 26
ide/text/fpsymbol.pas

@@ -29,7 +29,8 @@ const
       btReferences  = 1;
       btReferences  = 1;
       btInheritance = 2;
       btInheritance = 2;
       btMemInfo     = 3;
       btMemInfo     = 3;
-      btBreakWatch  = 4;
+      btUnitInfo    = 4;
+      btBreakWatch  = 7;
 
 
 type
 type
     PBrowserWindow = ^TBrowserWindow;
     PBrowserWindow = ^TBrowserWindow;
@@ -117,6 +118,11 @@ type
       MyBW   : PBrowserWindow;
       MyBW   : PBrowserWindow;
     end;
     end;
 
 
+    PSymbolMemoView = ^TSymbolMemoView;
+    TSymbolMemoView = object(TFPMemo)
+      function    GetPalette: PPalette; virtual;
+    end;
+
     PSymbolInheritanceView = ^TSymbolInheritanceView;
     PSymbolInheritanceView = ^TSymbolInheritanceView;
     TSymbolInheritanceView = object(TOutlineViewer)
     TSymbolInheritanceView = object(TOutlineViewer)
       constructor  Init(var Bounds: TRect; AHScrollBar, AVScrollBar: PScrollBar; ARoot: PObjectSymbol);
       constructor  Init(var Bounds: TRect; AHScrollBar, AVScrollBar: PScrollBar; ARoot: PObjectSymbol);
@@ -160,6 +166,12 @@ type
       Current : Sw_integer;
       Current : Sw_integer;
     end;
     end;
 
 
+    PUnitInfoPanel = ^TUnitInfoPanel;
+    TUnitInfoPanel = object(TPanel)
+      InOwnerCall: boolean;
+      procedure HandleEvent(var Event: TEvent); virtual;
+    end;
+
     TBrowserWindow = object(TFPWindow)
     TBrowserWindow = object(TFPWindow)
       constructor Init(var Bounds: TRect; ATitle: TTitleStr; ANumber: Sw_Integer;ASym : PSymbol;
       constructor Init(var Bounds: TRect; ATitle: TTitleStr; ANumber: Sw_Integer;ASym : PSymbol;
                     const AName,APrefix: string; ASymbols: PSymbolCollection; AReferences: PReferenceCollection;
                     const AName,APrefix: string; ASymbols: PSymbolCollection; AReferences: PReferenceCollection;
@@ -178,6 +190,10 @@ type
       ReferenceView : PSymbolReferenceView;
       ReferenceView : PSymbolReferenceView;
       InheritanceView: PSymbolInheritanceView;
       InheritanceView: PSymbolInheritanceView;
       MemInfoView   : PSymbolMemInfoView;
       MemInfoView   : PSymbolMemInfoView;
+      UnitInfoText  : PSymbolMemoView;
+      UnitInfoUsed  : PSymbolScopeView;
+      UnitInfoDependent : PSymbolScopeView;
+      UnitInfo      : PUnitInfoPanel;
       Prefix        : PString;
       Prefix        : PString;
       IsValid       : boolean;
       IsValid       : boolean;
       DebuggerValue : PGDBValue;
       DebuggerValue : PGDBValue;
@@ -218,6 +234,7 @@ procedure CloseAllBrowsers;
        (TypeOf(P^)=TypeOf(TSymbolScopeView)) or
        (TypeOf(P^)=TypeOf(TSymbolScopeView)) or
        (TypeOf(P^)=TypeOf(TSymbolReferenceView)) or
        (TypeOf(P^)=TypeOf(TSymbolReferenceView)) or
        (TypeOf(P^)=TypeOf(TSymbolMemInfoView)) or
        (TypeOf(P^)=TypeOf(TSymbolMemInfoView)) or
+       (TypeOf(P^)=TypeOf(TSymbolMemoView)) or
        (TypeOf(P^)=TypeOf(TSymbolInheritanceView))) then
        (TypeOf(P^)=TypeOf(TSymbolInheritanceView))) then
       Message(P,evCommand,cmClose,nil);
       Message(P,evCommand,cmClose,nil);
   end;
   end;
@@ -819,7 +836,10 @@ var S1: string;
     SG : PGDBValue;
     SG : PGDBValue;
 begin
 begin
   S:=Symbols^.At(Item);
   S:=Symbols^.At(Item);
-  SG:=SymbolsValue^.At(Item);
+  if Assigned(SymbolsValue) and (SymbolsValue^.Count>Item) then
+    SG:=SymbolsValue^.At(Item)
+  else
+    SG:=nil;
   if assigned(SG) then
   if assigned(SG) then
     S1:=SG^.getText
     S1:=SG^.getText
   else
   else
@@ -945,6 +965,7 @@ begin
   AddFormatParamStr(msg_sizeinmemory);
   AddFormatParamStr(msg_sizeinmemory);
   AddFormatParamStr(msg_sizeonstack);
   AddFormatParamStr(msg_sizeonstack);
   S:=
   S:=
+  FormatStrF(
    #13+
    #13+
 {  ' Memory location: '+AddrStr(MemInfo^.Addr)+#13+
 {  ' Memory location: '+AddrStr(MemInfo^.Addr)+#13+
   '   Local address: '+AddrStr(MemInfo^.LocalAddr)+#13+}
   '   Local address: '+AddrStr(MemInfo^.LocalAddr)+#13+}
@@ -953,8 +974,8 @@ begin
 
 
   '%18s: '+SizeStr(MemInfo^.Size)+#13+
   '%18s: '+SizeStr(MemInfo^.Size)+#13+
   '%18s: '+SizeStr(MemInfo^.PushSize)+#13+
   '%18s: '+SizeStr(MemInfo^.PushSize)+#13+
-  ''
-  ;
+  '',
+  FormatParams);
 end;
 end;
 
 
 function TSymbolMemInfoView.GetPalette: PPalette;
 function TSymbolMemInfoView.GetPalette: PPalette;
@@ -962,6 +983,12 @@ begin
   GetPalette:=inherited GetPalette;
   GetPalette:=inherited GetPalette;
 end;
 end;
 
 
+function TSymbolMemoView.GetPalette: PPalette;
+const P: string[length(CFPSymbolMemo)] = CFPSymbolMemo;
+begin
+  GetPalette:=@P;
+end;
+
 {****************************************************************************
 {****************************************************************************
                           TSymbolInheritanceView
                           TSymbolInheritanceView
 ****************************************************************************}
 ****************************************************************************}
@@ -1218,11 +1245,26 @@ begin
   inherited Done;
   inherited Done;
 end;
 end;
 
 
+procedure TUnitInfoPanel.HandleEvent(var Event: TEvent);
+begin
+  if (Event.What=evBroadcast) and (Event.Command=cmListItemSelected) and
+     (InOwnerCall=false) then
+    begin
+      InOwnerCall:=true;
+      if Assigned(Owner) then
+        Owner^.HandleEvent(Event);
+      InOwnerCall:=false;
+    end;
+  inherited HandleEvent(Event);
+end;
+
 constructor TBrowserWindow.Init(var Bounds: TRect; ATitle: TTitleStr; ANumber: Sw_Integer;ASym : PSymbol;
 constructor TBrowserWindow.Init(var Bounds: TRect; ATitle: TTitleStr; ANumber: Sw_Integer;ASym : PSymbol;
              const AName,APrefix: string; ASymbols: PSymbolCollection; AReferences: PReferenceCollection;
              const AName,APrefix: string; ASymbols: PSymbolCollection; AReferences: PReferenceCollection;
              AInheritance: PObjectSymbol; AMemInfo: PSymbolMemINfo);
              AInheritance: PObjectSymbol; AMemInfo: PSymbolMemINfo);
-var R: TRect;
+var R,R2,R3: TRect;
     HSB,VSB: PScrollBar;
     HSB,VSB: PScrollBar;
+    CST: PColorStaticText;
+    I: sw_integer;
 function CreateVSB(R: TRect): PScrollBar;
 function CreateVSB(R: TRect): PScrollBar;
 var R2: TRect;
 var R2: TRect;
     SB: PScrollBar;
     SB: PScrollBar;
@@ -1298,6 +1340,75 @@ begin
       Insert(MemInfoView);
       Insert(MemInfoView);
       MemInfoView^.MyBW:=@Self;
       MemInfoView^.MyBW:=@Self;
     end;
     end;
+  if TypeOf(ASym^)=TypeOf(TModuleSymbol) then
+  with PModuleSymbol(Sym)^ do
+    begin
+      New(UnitInfo, Init(R));
+      UnitInfo^.GetExtent(R3);
+
+      R2.Copy(R3);
+      R2.B.Y:=R2.A.Y+3;
+      if (Assigned(UsedUnits) or Assigned(DependentUnits))=false then
+        R2.B.Y:=R3.B.Y;
+      {HSB:=CreateHSB(R2); UnitInfo^.Insert(HSB); }HSB:=nil;
+      VSB:=CreateVSB(R2); UnitInfo^.Insert(VSB);
+      New(UnitInfoText, Init(R2,HSB,VSB, nil));
+      with UnitInfoText^ do
+      begin
+        GrowMode:=gfGrowHiX;
+        if Assigned(LoadedFrom) then
+        begin
+          AddLine(FormatStrStr2('%s : %s',msg_usedfirstin,GetStr(LoadedFrom)));
+          AddLine(FormatStrStr('%s : ',msg_mainsource));
+          AddLine(FormatStrStr('  %s',GetStr(MainSource)));
+          if Assigned(SourceFiles) and (SourceFiles^.Count>1) then
+          begin
+            AddLine(FormatStrStr('%s : ',msg_sourcefiles));
+            for I:=0 to SourceFiles^.Count-1 do
+              AddLine(FormatStrStr('  %s',GetStr(SourceFiles^.At(I))));
+          end;
+        end;
+      end;
+      UnitInfo^.Insert(UnitInfoText);
+
+      if Assigned(UsedUnits) then
+      begin
+        Inc(R2.A.Y,R2.B.Y-R2.A.Y); R2.B.Y:=R2.A.Y+1;
+        New(CST, Init(R2,'´ Used units Ã'+CharStr('Ä',255),ColorIndex(12),false));
+        CST^.GrowMode:=gfGrowHiX;
+        UnitInfo^.Insert(CST);
+
+        Inc(R2.A.Y,R2.B.Y-R2.A.Y); R2.B.Y:=R2.A.Y+4;
+        if Assigned(DependentUnits)=false then R2.B.Y:=R3.B.Y;
+        {HSB:=CreateHSB(R2); UnitInfo^.Insert(HSB); }HSB:=nil;
+        VSB:=CreateVSB(R2); UnitInfo^.Insert(VSB);
+        New(UnitInfoUsed, Init(R2,UsedUnits,HSB,VSB));
+        UnitInfoUsed^.GrowMode:=gfGrowHiY+gfGrowHiX;
+        UnitInfoUsed^.MyBW:=@Self;
+        UnitInfo^.Insert(UnitInfoUsed);
+      end;
+
+      if Assigned(DependentUnits) then
+      begin
+        Inc(R2.A.Y,R2.B.Y-R2.A.Y); R2.B.Y:=R2.A.Y+1;
+        New(CST, Init(R2,'´ Dependent units Ã'+CharStr('Ä',255),ColorIndex(12),false));
+        CST^.GrowMode:=gfGrowLoY+gfGrowHiX+gfGrowHiY;
+        UnitInfo^.Insert(CST);
+
+        Inc(R2.A.Y,R2.B.Y-R2.A.Y); R2.B.Y:=R3.B.Y;
+        {HSB:=CreateHSB(R2); UnitInfo^.Insert(HSB); }HSB:=nil;
+        VSB:=CreateVSB(R2); UnitInfo^.Insert(VSB);
+        New(UnitInfoDependent, Init(R2,DependentUnits,HSB,VSB));
+        UnitInfoDependent^.GrowMode:=gfGrowLoY+gfGrowHiX+gfGrowHiY;
+        UnitInfoDependent^.MyBW:=@Self;
+        UnitInfo^.Insert(UnitInfoDependent);
+      end;
+
+      if Assigned(UnitInfoText) then
+        UnitInfoText^.Select;
+
+      Insert(UnitInfo);
+    end;
 
 
   GetExtent(R); R.Grow(-1,-1); R.Move(0,1); R.B.Y:=R.A.Y+1;
   GetExtent(R); R.Grow(-1,-1); R.Move(0,1); R.B.Y:=R.A.Y+1;
   New(PageTab, Init(R,
   New(PageTab, Init(R,
@@ -1305,8 +1416,9 @@ begin
     NewBrowserTabItem(label_browsertab_reference,ReferenceView,
     NewBrowserTabItem(label_browsertab_reference,ReferenceView,
     NewBrowserTabItem(label_browsertab_inheritance,InheritanceView,
     NewBrowserTabItem(label_browsertab_inheritance,InheritanceView,
     NewBrowserTabItem(label_browsertab_memory,MemInfoView,
     NewBrowserTabItem(label_browsertab_memory,MemInfoView,
+    NewBrowserTabItem(label_browsertab_unit,UnitInfo,
     nil))
     nil))
-    ))));
+    )))));
   PageTab^.GrowMode:=gfGrowHiX;
   PageTab^.GrowMode:=gfGrowHiX;
   Insert(PageTab);
   Insert(PageTab);
 
 
@@ -1354,24 +1466,44 @@ begin
         cmSearchWindow :
         cmSearchWindow :
           ClearEvent(Event);
           ClearEvent(Event);
         cmListItemSelected :
         cmListItemSelected :
-          if Event.InfoPtr=ScopeView then
-            begin
-              S:=ScopeView^.Symbols^.At(ScopeView^.Focused);
-              MakeGlobal(ScopeView^.Origin,P);
-              Desktop^.MakeLocal(P,P); Inc(P.Y,ScopeView^.Focused-ScopeView^.TopItem);
-              Inc(P.Y);
-              if S^.Ancestor=nil then Anc:=nil else
-                Anc:=SearchObjectForSymbol(S^.Ancestor);
-              Symbols:=S^.Items;
-              if (not assigned(Symbols)  or (symbols^.count=0)) then
-                if assigned(S^.Ancestor) then
-                  Symbols:=S^.Ancestor^.Items;
-              if (S^.GetReferenceCount>0) or (assigned(Symbols) and (Symbols^.Count>0)) or (Anc<>nil) then
-               OpenSymbolBrowser(Origin.X-1,P.Y,
-                 S^.GetName,
-                 ScopeView^.GetText(ScopeView^.Focused,255),
-                 S,@self,
-                 Symbols,S^.References,Anc,S^.MemInfo);
+          begin
+            S:=nil;
+            if (Event.InfoPtr=ScopeView) then
+              begin
+                S:=ScopeView^.Symbols^.At(ScopeView^.Focused);
+                MakeGlobal(ScopeView^.Origin,P);
+                Desktop^.MakeLocal(P,P); Inc(P.Y,ScopeView^.Focused-ScopeView^.TopItem);
+                Inc(P.Y);
+              end;
+            if (Event.InfoPtr=UnitInfoUsed) then
+              begin
+                S:=UnitInfoUsed^.Symbols^.At(UnitInfoUsed^.Focused);
+                MakeGlobal(UnitInfoUsed^.Origin,P);
+                Desktop^.MakeLocal(P,P); Inc(P.Y,UnitInfoUsed^.Focused-UnitInfoUsed^.TopItem);
+                Inc(P.Y);
+              end;
+            if (Event.InfoPtr=UnitInfoDependent) then
+              begin
+                S:=UnitInfoDependent^.Symbols^.At(UnitInfoDependent^.Focused);
+                MakeGlobal(UnitInfoDependent^.Origin,P);
+                Desktop^.MakeLocal(P,P); Inc(P.Y,UnitInfoDependent^.Focused-UnitInfoDependent^.TopItem);
+                Inc(P.Y);
+              end;
+            if Assigned(S) then
+              begin
+                if S^.Ancestor=nil then Anc:=nil else
+                  Anc:=SearchObjectForSymbol(S^.Ancestor);
+                Symbols:=S^.Items;
+                if (not assigned(Symbols)  or (symbols^.count=0)) then
+                  if assigned(S^.Ancestor) then
+                    Symbols:=S^.Ancestor^.Items;
+                if (S^.GetReferenceCount>0) or (assigned(Symbols) and (Symbols^.Count>0)) or (Anc<>nil) then
+                 OpenSymbolBrowser(Origin.X-1,P.Y,
+                   S^.GetName,
+                   ScopeView^.GetText(ScopeView^.Focused,255),
+                   S,@self,
+                   Symbols,S^.References,Anc,S^.MemInfo);
+              end;
             end;
             end;
       end;
       end;
 {    evCommand :
 {    evCommand :
@@ -1506,6 +1638,8 @@ begin
   if Assigned(Sym) then
   if Assigned(Sym) then
     if (Pos('proc',Sym^.GetText)>0) or (Pos('var',Sym^.GetText)>0) then
     if (Pos('proc',Sym^.GetText)>0) or (Pos('var',Sym^.GetText)>0) then
       Tabs:=Tabs or (1 shl btBreakWatch);
       Tabs:=Tabs or (1 shl btBreakWatch);
+  if assigned(UnitInfo) then
+    Tabs:=Tabs or (1 shl btUnitInfo);
   if PageTab<>nil then PageTab^.SetParams(Tabs,BrowserTab);
   if PageTab<>nil then PageTab^.SetParams(Tabs,BrowserTab);
 end;
 end;
 
 
@@ -1529,7 +1663,7 @@ begin
   while (R.B.Y>Desktop^.Size.Y) do R.Move(0,-1);
   while (R.B.Y>Desktop^.Size.Y) do R.Move(0,-1);
   if assigned(ParentBrowser) then
   if assigned(ParentBrowser) then
     begin
     begin
-      st:=GetStr(ParentBrowser^.Prefix)+Name;
+      st:=GetStr(ParentBrowser^.Prefix)+' '+Name;
     end
     end
   else
   else
     st:=Name;
     st:=Name;
@@ -1558,7 +1692,10 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.27  2000-05-29 10:44:57  pierre
+  Revision 1.28  2000-06-16 08:50:42  pierre
+   + new bunch of Gabor's changes
+
+  Revision 1.27  2000/05/29 10:44:57  pierre
    + New bunch of Gabor's changes: see fixes.txt
    + New bunch of Gabor's changes: see fixes.txt
 
 
   Revision 1.26  2000/05/02 08:42:28  pierre
   Revision 1.26  2000/05/02 08:42:28  pierre

+ 18 - 13
ide/text/fpvars.pas

@@ -27,7 +27,7 @@ uses Objects,Views,App,
 
 
 type
 type
     TRecentFileEntry = record
     TRecentFileEntry = record
-      FileName  : string{$ifdef GABOR}[80]{$endif};
+      FileName  : string{$ifdef GABOR}[60]{$endif};
       LastPos   : TPoint;
       LastPos   : TPoint;
     end;
     end;
 
 
@@ -41,18 +41,18 @@ const ClipboardWindow  : PClipboardWindow = nil;
       HighlightExts    : string{$ifdef GABOR}[40]{$endif} = '*.pas;*.pp;*.inc';
       HighlightExts    : string{$ifdef GABOR}[40]{$endif} = '*.pas;*.pp;*.inc';
       TabsPattern      : string{$ifdef GABOR}[40]{$endif} = 'make*;make*.*';
       TabsPattern      : string{$ifdef GABOR}[40]{$endif} = 'make*;make*.*';
       SourceDirs       : string{$ifdef GABOR}[40]{$endif} = '';
       SourceDirs       : string{$ifdef GABOR}[40]{$endif} = '';
-      PrimaryFile      : string{$ifdef GABOR}[80]{$endif} = '';
-      PrimaryFileMain  : string{$ifdef GABOR}[80]{$endif} = '';
+      PrimaryFile      : string{$ifdef GABOR}[60]{$endif} = '';
+      PrimaryFileMain  : string{$ifdef GABOR}[60]{$endif} = '';
       PrimaryFileSwitches : string{$ifdef GABOR}[80]{$endif} = '';
       PrimaryFileSwitches : string{$ifdef GABOR}[80]{$endif} = '';
       PrimaryFilePara  : string{$ifdef GABOR}[80]{$endif} = '';
       PrimaryFilePara  : string{$ifdef GABOR}[80]{$endif} = '';
-      GDBOutputFile    : string{$ifdef GABOR}[80]{$endif} = GDBOutputFileName;
+      GDBOutputFile    : string{$ifdef GABOR}[50]{$endif} = GDBOutputFileName;
       IsEXECompiled    : boolean = false;
       IsEXECompiled    : boolean = false;
       LinkAfter        : boolean = true;
       LinkAfter        : boolean = true;
       MainHasDebugInfo : boolean = false;
       MainHasDebugInfo : boolean = false;
       UseMouse         : boolean = true;
       UseMouse         : boolean = true;
-      MainFile         : string{$ifdef GABOR}[80]{$endif} = '';
-      PrevMainFile     : string{$ifdef GABOR}[80]{$endif} = '';
-      EXEFile          : string{$ifdef GABOR}[80]{$endif} = '';
+      MainFile         : string{$ifdef GABOR}[60]{$endif} = '';
+      PrevMainFile     : string{$ifdef GABOR}[60]{$endif} = '';
+      EXEFile          : string{$ifdef GABOR}[60]{$endif} = '';
       CompilationPhase : TCompPhase = cpNothing;
       CompilationPhase : TCompPhase = cpNothing;
       ProgramInfoWindow: PProgramInfoWindow = nil;
       ProgramInfoWindow: PProgramInfoWindow = nil;
       GDBWindow        : PGDBWindow = nil;
       GDBWindow        : PGDBWindow = nil;
@@ -63,17 +63,17 @@ const ClipboardWindow  : PClipboardWindow = nil;
       ClockView        : PFPClockView = nil;
       ClockView        : PFPClockView = nil;
       HelpFiles        : WUtils.PUnsortedStringCollection = nil;
       HelpFiles        : WUtils.PUnsortedStringCollection = nil;
       ShowStatusOnError: boolean = true;
       ShowStatusOnError: boolean = true;
-      StartupDir       : string{$ifdef GABOR}[80]{$endif} = '.'+DirSep;
-      IDEDir           : string{$ifdef GABOR}[80]{$endif} = '.'+DirSep;
+      StartupDir       : string{$ifdef GABOR}[60]{$endif} = '.'+DirSep;
+      IDEDir           : string{$ifdef GABOR}[60]{$endif} = '.'+DirSep;
       INIFileName      : string{$ifdef GABOR}[50]{$endif} = ININame;
       INIFileName      : string{$ifdef GABOR}[50]{$endif} = ININame;
-      SwitchesPath     : string{$ifdef GABOR}[80]{$endif} = SwitchesName;
+      SwitchesPath     : string{$ifdef GABOR}[60]{$endif} = SwitchesName;
       CtrlMouseAction  : integer = acTopicSearch;
       CtrlMouseAction  : integer = acTopicSearch;
       AltMouseAction   : integer = acBrowseSymbol;
       AltMouseAction   : integer = acBrowseSymbol;
       StartupOptions   : longint = 0;
       StartupOptions   : longint = 0;
       LastExitCode     : integer = 0;
       LastExitCode     : integer = 0;
       ASCIIChart       : PFPASCIIChart = nil;
       ASCIIChart       : PFPASCIIChart = nil;
-      BackgroundPath   : string{$ifdef GABOR}[80]{$endif} = BackgroundName;
-      DesktopPath      : string{$ifdef GABOR}[80]{$endif} = DesktopName;
+      BackgroundPath   : string{$ifdef GABOR}[60]{$endif} = BackgroundName;
+      DesktopPath      : string{$ifdef GABOR}[60]{$endif} = DesktopName;
       DesktopFileFlags : longint = dfHistoryLists+dfOpenWindows+
       DesktopFileFlags : longint = dfHistoryLists+dfOpenWindows+
                                    dfCodeCompleteWords+dfCodeTemplates;
                                    dfCodeCompleteWords+dfCodeTemplates;
       DesktopLocation  : byte    = dlConfigFileDir;
       DesktopLocation  : byte    = dlConfigFileDir;
@@ -86,6 +86,8 @@ const ClipboardWindow  : PClipboardWindow = nil;
       UseExternalCompiler : boolean = true;
       UseExternalCompiler : boolean = true;
       ExternalCompilerExe : string = 'ppc386'+ExeExt;
       ExternalCompilerExe : string = 'ppc386'+ExeExt;
 {$endif USE_EXTERNAL_COMPILER}
 {$endif USE_EXTERNAL_COMPILER}
+      ShowReadme       : boolean = true;
+
 
 
       ActionCommands   : array[acFirstAction..acLastAction] of word =
       ActionCommands   : array[acFirstAction..acLastAction] of word =
         (cmHelpTopicSearch,cmGotoCursor,cmToggleBreakpoint,
         (cmHelpTopicSearch,cmGotoCursor,cmToggleBreakpoint,
@@ -100,7 +102,10 @@ implementation
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.32  2000-04-25 08:42:33  pierre
+  Revision 1.33  2000-06-16 08:50:42  pierre
+   + new bunch of Gabor's changes
+
+  Revision 1.32  2000/04/25 08:42:33  pierre
    * New Gabor changes : see fixes.txt
    * New Gabor changes : see fixes.txt
 
 
   Revision 1.31  2000/04/18 11:42:37  pierre
   Revision 1.31  2000/04/18 11:42:37  pierre

+ 90 - 24
ide/text/fpviews.pas

@@ -354,8 +354,8 @@ type
       procedure   Store(var S: TStream);
       procedure   Store(var S: TStream);
     end;
     end;
 
 
-    PFPCodeMemo = ^TFPCodeMemo;
-    TFPCodeMemo = object(TCodeEditor)
+    PFPMemo = ^TFPMemo;
+    TFPMemo = object(TCodeEditor)
       constructor Init(var Bounds: TRect; AHScrollBar, AVScrollBar:
       constructor Init(var Bounds: TRect; AHScrollBar, AVScrollBar:
                     PScrollBar; AIndicator: PIndicator);
                     PScrollBar; AIndicator: PIndicator);
       function    IsReservedWord(const S: string): boolean; virtual;
       function    IsReservedWord(const S: string): boolean; virtual;
@@ -364,10 +364,22 @@ type
       function    GetPalette: PPalette; virtual;
       function    GetPalette: PPalette; virtual;
     end;
     end;
 
 
+    PFPCodeMemo = ^TFPCodeMemo;
+    TFPCodeMemo = object(TFPMemo)
+      constructor Init(var Bounds: TRect; AHScrollBar, AVScrollBar:
+                    PScrollBar; AIndicator: PIndicator);
+      function    IsReservedWord(const S: string): boolean; virtual;
+      function    GetSpecSymbolCount(SpecClass: TSpecSymbolClass): integer; virtual;
+      function    GetSpecSymbol(SpecClass: TSpecSymbolClass; Index: integer): string; virtual;
+    end;
+
 function  SearchFreeWindowNo: integer;
 function  SearchFreeWindowNo: integer;
 
 
+function IsWindow(P: PView): boolean;
 function IsThereAnyEditor: boolean;
 function IsThereAnyEditor: boolean;
 function IsThereAnyWindow: boolean;
 function IsThereAnyWindow: boolean;
+function IsThereAnyVisibleWindow: boolean;
+function IsThereAnyNumberedWindow: boolean;
 function FirstEditorWindow: PSourceWindow;
 function FirstEditorWindow: PSourceWindow;
 function EditorWindowFile(const Name : String): PSourceWindow;
 function EditorWindowFile(const Name : String): PSourceWindow;
 
 
@@ -404,7 +416,7 @@ procedure NoDebugger;
 
 
 const
 const
       SourceCmds  : TCommandSet =
       SourceCmds  : TCommandSet =
-        ([cmSave,cmSaveAs,cmCompile]);
+        ([cmSave,cmSaveAs,cmCompile,cmHide]);
       EditorCmds  : TCommandSet =
       EditorCmds  : TCommandSet =
         ([cmFind,cmReplace,cmSearchAgain,cmJumpLine,cmHelpTopicSearch]);
         ([cmFind,cmReplace,cmSearchAgain,cmJumpLine,cmHelpTopicSearch]);
       CompileCmds : TCommandSet =
       CompileCmds : TCommandSet =
@@ -529,7 +541,6 @@ begin
 end;
 end;
 
 
 
 
-
 function IsThereAnyEditor: boolean;
 function IsThereAnyEditor: boolean;
 function EditorWindow(P: PView): boolean; {$ifndef FPC}far;{$endif}
 function EditorWindow(P: PView): boolean; {$ifndef FPC}far;{$endif}
 begin
 begin
@@ -544,12 +555,49 @@ begin
   IsThereAnyHelpWindow:=(HelpWindow<>nil) and (HelpWindow^.GetState(sfVisible));
   IsThereAnyHelpWindow:=(HelpWindow<>nil) and (HelpWindow^.GetState(sfVisible));
 end;
 end;
 
 
-function IsThereAnyWindow: boolean;
+function IsThereAnyNumberedWindow: boolean;
 var _Is: boolean;
 var _Is: boolean;
 begin
 begin
   _Is:=Message(Desktop,evBroadcast,cmSearchWindow,nil)<>nil;
   _Is:=Message(Desktop,evBroadcast,cmSearchWindow,nil)<>nil;
   _Is:=_Is or ( (ClipboardWindow<>nil) and ClipboardWindow^.GetState(sfVisible));
   _Is:=_Is or ( (ClipboardWindow<>nil) and ClipboardWindow^.GetState(sfVisible));
-  IsThereAnyWindow:=_Is;
+  IsThereAnyNumberedWindow:=_Is;
+end;
+
+function IsWindow(P: PView): boolean;
+var OK: boolean;
+begin
+  OK:=false;
+  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
+     OK:=true;
+   IsWindow:=OK;
+end;
+
+function IsThereAnyWindow: boolean;
+function CheckIt(P: PView): boolean; {$ifndef FPC}far;{$endif}
+begin
+  CheckIt:=IsWindow(P);
+end;
+begin
+  IsThereAnyWindow:=Desktop^.FirstThat(@CheckIt)<>nil;
+end;
+
+function IsThereAnyVisibleWindow: boolean;
+function CheckIt(P: PView): boolean; {$ifndef FPC}far;{$endif}
+begin
+  CheckIt:=IsWindow(P) and P^.GetState(sfVisible);
+end;
+begin
+  IsThereAnyVisibleWindow:=Desktop^.FirstThat(@CheckIt)<>nil;
 end;
 end;
 
 
 function FirstEditorWindow: PSourceWindow;
 function FirstEditorWindow: PSourceWindow;
@@ -755,17 +803,8 @@ begin
   { we have a crash here because of the TStatusLine
   { we have a crash here because of the TStatusLine
     that can also have one of these values
     that can also have one of these values
     but is not a Window object PM }
     but is not a Window object PM }
-  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 IsWindow(P) then
+    W:=PWindow(P);
   OK:=(W<>nil);
   OK:=(W<>nil);
   if OK then
   if OK then
   begin
   begin
@@ -1326,7 +1365,8 @@ var HSB,VSB: PScrollBar;
     PA : Array[1..2] of pointer;
     PA : Array[1..2] of pointer;
     LoadFile: boolean;
     LoadFile: boolean;
 begin
 begin
-  inherited Init(Bounds,AFileName,SearchFreeWindowNo);
+  inherited Init(Bounds,AFileName,{SearchFreeWindowNo}0);
+  AutoNumber:=true;
   Options:=Options or ofTileAble;
   Options:=Options or ofTileAble;
   GetExtent(R); R.A.Y:=R.B.Y-1; R.Grow(-1,0); R.A.X:=14;
   GetExtent(R); R.A.Y:=R.B.Y-1; R.Grow(-1,0); R.A.X:=14;
   New(HSB, Init(R)); HSB^.GrowMode:=gfGrowLoY+gfGrowHiX+gfGrowHiY; Insert(HSB);
   New(HSB, Init(R)); HSB^.GrowMode:=gfGrowLoY+gfGrowHiX+gfGrowHiY; Insert(HSB);
@@ -1405,6 +1445,8 @@ begin
       begin
       begin
         DontClear:=false;
         DontClear:=false;
         case Event.Command of
         case Event.Command of
+          cmHide :
+            Hide;
           cmSave :
           cmSave :
             if Editor^.IsClipboard=false then
             if Editor^.IsClipboard=false then
              if Editor^.FileName='' then
              if Editor^.FileName='' then
@@ -2106,8 +2148,7 @@ begin
 
 
   GetExtent(R); R.Grow(-1,-1); R.B.Y:=R.A.Y+3;
   GetExtent(R); R.Grow(-1,-1); R.B.Y:=R.A.Y+3;
   C:=((Desktop^.GetColor(32+6) and $f0) or White)*256+Desktop^.GetColor(32+6);
   C:=((Desktop^.GetColor(32+6) and $f0) or White)*256+Desktop^.GetColor(32+6);
-  New(InfoST, Init(R,'', C)); InfoST^.GrowMode:=gfGrowHiX;
-  InfoST^.DontWrap:=true;
+  New(InfoST, Init(R,'', C, false)); InfoST^.GrowMode:=gfGrowHiX;
   Insert(InfoST);
   Insert(InfoST);
   GetExtent(R); R.Grow(-1,-1); Inc(R.A.Y,3); R.B.Y:=R.A.Y+1;
   GetExtent(R); R.Grow(-1,-1); Inc(R.A.Y,3); R.B.Y:=R.A.Y+1;
   New(ST, Init(R, CharStr('Ä', MaxViewWidth))); ST^.GrowMode:=gfGrowHiX; Insert(ST);
   New(ST, Init(R, CharStr('Ä', MaxViewWidth))); ST^.GrowMode:=gfGrowHiX; Insert(ST);
@@ -3290,19 +3331,41 @@ begin
   GetPalette:=@S;
   GetPalette:=@S;
 end;
 end;
 
 
-constructor TFPCodeMemo.Init(var Bounds: TRect; AHScrollBar, AVScrollBar:
+constructor TFPMemo.Init(var Bounds: TRect; AHScrollBar, AVScrollBar:
           PScrollBar; AIndicator: PIndicator);
           PScrollBar; AIndicator: PIndicator);
 begin
 begin
   inherited Init(Bounds,AHScrollBar,AVScrollBar,AIndicator,nil);
   inherited Init(Bounds,AHScrollBar,AVScrollBar,AIndicator,nil);
   SetFlags(Flags and not (efPersistentBlocks) or efSyntaxHighlight);
   SetFlags(Flags and not (efPersistentBlocks) or efSyntaxHighlight);
 end;
 end;
 
 
-function TFPCodeMemo.GetPalette: PPalette;
-const P: string[length(CFPCodeMemo)] = CFPCodeMemo;
+function TFPMemo.GetPalette: PPalette;
+const P: string[length(CFPMemo)] = CFPMemo;
 begin
 begin
   GetPalette:=@P;
   GetPalette:=@P;
 end;
 end;
 
 
+function TFPMemo.GetSpecSymbolCount(SpecClass: TSpecSymbolClass): integer;
+begin
+  GetSpecSymbolCount:=0;
+end;
+
+function TFPMemo.GetSpecSymbol(SpecClass: TSpecSymbolClass; Index: integer): string;
+begin
+  Abstract;
+  GetSpecSymbol:='';
+end;
+
+function TFPMemo.IsReservedWord(const S: string): boolean;
+begin
+  IsReservedWord:=false;
+end;
+
+constructor TFPCodeMemo.Init(var Bounds: TRect; AHScrollBar, AVScrollBar:
+          PScrollBar; AIndicator: PIndicator);
+begin
+  inherited Init(Bounds,AHScrollBar,AVScrollBar,AIndicator);
+end;
+
 function TFPCodeMemo.GetSpecSymbolCount(SpecClass: TSpecSymbolClass): integer;
 function TFPCodeMemo.GetSpecSymbolCount(SpecClass: TSpecSymbolClass): integer;
 var Count: integer;
 var Count: integer;
 begin
 begin
@@ -3409,7 +3472,10 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.71  2000-05-29 10:44:57  pierre
+  Revision 1.72  2000-06-16 08:50:42  pierre
+   + new bunch of Gabor's changes
+
+  Revision 1.71  2000/05/29 10:44:57  pierre
    + New bunch of Gabor's changes: see fixes.txt
    + New bunch of Gabor's changes: see fixes.txt
 
 
   Revision 1.70  2000/05/16 21:50:53  pierre
   Revision 1.70  2000/05/16 21:50:53  pierre

+ 109 - 0
ide/text/readme.ide

@@ -0,0 +1,109 @@
+             Welcome to the Free Pascal IDE!
+            ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß
+
+ Please take the time to read this file to avoid most
+ common installation problems, and to get the most out of
+ this software!
+
+  General information Ü
+ ßßßßßßßßßßßßßßßßßßßßßß
+ First of all: note that the IDE is currently still in
+ beta state! That means that some functions may not work,
+ or may not work as expected. We do our best to fix all
+ bugs and make the IDE reliable and stable, however, you
+ may still encounter some problems using it.
+ Therefore you should be careful using untested functions,
+ and make regularly backup copies of your source files!
+ If you encounter any problems using the IDE, then please
+ report it to the authors by sending an e-mail to
+ "[email protected]" or by entering it in the bugs
+ database at "http://www.freepascal.org". (Note, that we
+ can't fix bugs we don't have any knowledge of, or can't
+ reproduce, so, it's in your own interest to report bugs
+ as fast and precisely as possible.)
+
+ You should be also careful with hotkeys and shortcuts!
+ The IDE is designed to be compatible with the BP IDE as
+ much as possible, however, the platform differences and
+ some improvements may break that compatibility at some
+ points, which may result in slightly or totally different
+ behaviour than expected. Therefore, you should first
+ experiment with the IDE some time before using for
+ serious purposes, and read all available docs before
+ reporting a "bug"!
+
+  Version conflicts Ü
+ ßßßßßßßßßßßßßßßßßßßß
+ IDE snapshots are created on a regular basis. That means,
+ that the IDE and it's embedded compiler are always the
+ most up-to-date versions.
+ Unless you've installed the IDE from a full distribution,
+ you'll have to install the latest compiler and RTL
+ binaries to avoid version conflicts and get the IDE
+ working. You can do this by downloading the latest binary
+ snapshots from "http://www.freepascal.org" and copying
+ it's contents directly over your existing installation.
+ (You can also install these files in separate directories
+ and set up the IDE to search for them at that place.
+ However, this may result in different behaviour and
+ incompatibilities between of the command-line based and
+ the embedded compiler.)
+ When installing a new snapshot you should make sure you
+ back up your existing installation! This is not a
+ neccessary step for the IDE to function, however, it may
+ proove very helpful, when the newly installed snapshot
+ contains a new bug or is incompatible in some aspects
+ with your previous one.
+
+  Configuration Ü
+ ßßßßßßßßßßßßßßßß
+ Once you have installed the IDE, it requires two
+ configuration changes before it can compile. This is due
+ to the fact that the IDE includes its own compiler; it
+ does not use ppc386.exe and thus it also does not use the
+ configuration in the file ppc386.cfg.
+
+ Select Target from the Compile menu and then check the
+ correct default target (this is Go32V2 for DOS).
+ Next, choose Directories in the Otions menu and in the
+ line "Unit directories" enter the path to your copy of
+ the RTL directory, usually c:\pp\rtl\go32v2. If you have
+ done everything correct and it still doesn't work, you
+ may have grabbed a snapshot that has a bug; in this case
+ try again one or two days later or ask for help on one of
+ the mailing lists (see later!).
+
+  Documentation Ü
+ ßßßßßßßßßßßßßßßß
+ Although the IDE itself has no kind of "native"
+ documentation or help, it is capable of reading both HTML
+ and TPH format help files. That means, that you can use
+ both the FPC documentation (included in your distribution,
+ or downloadable from the Free Pascal HP) and/or the help
+ files of your Turbo or Borland Pascal (from version 5.5
+ thru 7.0) installation.
+ You can install help files of both types in the on-line
+ help system by going to Help menu, selecting Files and
+ adding them to the list.
+
+  More information Ü
+ ßßßßßßßßßßßßßßßßßßß
+ If you need more informations you can:
+  þ read the FAQ and the documentation
+  þ join one or more of the 4 mailing lists
+
+ For the FAQ, for the on-line version of the docs,
+ and for information on joining the mailing lists go to
+ the Free Pascal homepage at http://www.freepascal.org.
+
+ Well, I think, this should be enough info for the start.
+ Thanks for taking time reading this file, and please
+ don't forget to report any bugs or problems you encounter
+ using the IDE as soon as possible. Also feel free to
+ write us, if you have any comments, suggestions, ideas,
+ etc. regarding the compiler and/or the IDE!
+
+ Have as much fun using the IDE, as we had creating it! ;)
+
+                  The Free Pascal IDE Development Team
+

+ 2 - 0
ide/text/wcedit.pas

@@ -1218,6 +1218,7 @@ begin
               end;
               end;
           else
           else
             { what the 'ell's an undefined action doing round 'ere mate! }
             { what the 'ell's an undefined action doing round 'ere mate! }
+            ;
           end; { once this lot is done paste into redo and modify to suit needs }
           end; { once this lot is done paste into redo and modify to suit needs }
           { move item to redo stack }
           { move item to redo stack }
           Core^.RedoList^.Insert(Core^.UndoList^.At(Idx));
           Core^.RedoList^.Insert(Core^.UndoList^.At(Idx));
@@ -1322,6 +1323,7 @@ begin
           end;
           end;
       else
       else
         { what the 'ell's an undefined action doing round 'ere mate! }
         { what the 'ell's an undefined action doing round 'ere mate! }
+        ;
       end; { once this lot is done paste back into undo and modify to suit needs }
       end; { once this lot is done paste back into undo and modify to suit needs }
     { move item to undo stack }
     { move item to undo stack }
       Core^.UndoList^.Insert(Core^.RedoList^.At(Idx));
       Core^.UndoList^.Insert(Core^.RedoList^.At(Idx));

+ 66 - 62
ide/text/weditor.pas

@@ -664,7 +664,7 @@ uses
 {$ifdef WinClipSupported}
 {$ifdef WinClipSupported}
   Strings,WinClip,
   Strings,WinClip,
 {$endif WinClipSupported}
 {$endif WinClipSupported}
-  WViews,WCEdit;
+  WConsts,WViews,WCEdit;
 
 
 type
 type
      TFindDialogRec = packed record
      TFindDialogRec = packed record
@@ -2867,6 +2867,7 @@ begin
   if (E.What and (evMouse or evKeyboard))<>0 then
   if (E.What and (evMouse or evKeyboard))<>0 then
     CurEvent:=@E;
     CurEvent:=@E;
   if (InASCIIMode=false) or (Event.What<>evKeyDown) then
   if (InASCIIMode=false) or (Event.What<>evKeyDown) then
+   if (Event.What<>evKeyDown) or (Event.KeyCode<>kbEnter) or (IsReadOnly=false) then
    if (Event.What<>evKeyDown) or
    if (Event.What<>evKeyDown) or
       ((Event.KeyCode<>kbEnter) and (Event.KeyCode<>kbEsc)) or
       ((Event.KeyCode<>kbEnter) and (Event.KeyCode<>kbEsc)) or
       (GetCompleteState<>csOffering) then
       (GetCompleteState<>csOffering) then
@@ -2919,6 +2920,8 @@ begin
              kbAltF10 :
              kbAltF10 :
                Message(@Self,evCommand,cmLocalMenu,@Self);
                Message(@Self,evCommand,cmLocalMenu,@Self);
              kbEnter  :
              kbEnter  :
+               if IsReadOnly then
+                 DontClear:=true else
                if GetCompleteState=csOffering then
                if GetCompleteState=csOffering then
                  CodeCompleteApply
                  CodeCompleteApply
                else
                else
@@ -3614,11 +3617,11 @@ end;
 procedure TCustomCodeEditor.JumpMark(MarkIdx: integer);
 procedure TCustomCodeEditor.JumpMark(MarkIdx: integer);
 begin
 begin
   if (MarkIdx<Low(Bookmarks)) or (MarkIdx>High(Bookmarks)) then
   if (MarkIdx<Low(Bookmarks)) or (MarkIdx>High(Bookmarks)) then
-    begin ErrorBox('Invalid mark index ('+IntToStr(MarkIdx)+')',nil); Exit; end;
+    begin ErrorBox(FormatStrInt(msg_invalidmarkindex,MarkIdx),nil); Exit; end;
 
 
   with Bookmarks[MarkIdx] do
   with Bookmarks[MarkIdx] do
   if Valid=false then
   if Valid=false then
-    InformationBox('Mark '+IntToStr(MarkIdx)+' not set.',nil)
+    InformationBox(FormatStrInt(msg_marknotset,MarkIdx),nil)
   else
   else
     SetCurPtr(Pos.X,Pos.Y);
     SetCurPtr(Pos.X,Pos.Y);
 end;
 end;
@@ -3627,7 +3630,7 @@ procedure TCustomCodeEditor.DefineMark(MarkIdx: integer);
 begin
 begin
   if (MarkIdx<Low(Bookmarks)) or (MarkIdx>High(Bookmarks)) then
   if (MarkIdx<Low(Bookmarks)) or (MarkIdx>High(Bookmarks)) then
     begin
     begin
-      ErrorBox('Invalid mark index ('+IntToStr(MarkIdx)+')',nil);
+      ErrorBox(FormatStrInt(msg_invalidmarkindex,MarkIdx),nil);
       Exit;
       Exit;
     end;
     end;
   with Bookmarks[MarkIdx] do
   with Bookmarks[MarkIdx] do
@@ -5514,7 +5517,7 @@ var R,R1,R2: TRect;
     RB1,RB2,RB3: PRadioButtons;
     RB1,RB2,RB3: PRadioButtons;
 begin
 begin
   R.Assign(0,0,56,15);
   R.Assign(0,0,56,15);
-  New(D, Init(R, 'Find'));
+  New(D, Init(R, dialog_find));
   with D^ do
   with D^ do
   begin
   begin
     Options:=Options or ofCentered;
     Options:=Options or ofCentered;
@@ -5524,7 +5527,7 @@ begin
     New(IL1, Init(R2, FindStrSize));
     New(IL1, Init(R2, FindStrSize));
     IL1^.Data^:=FindStr;
     IL1^.Data^:=FindStr;
     Insert(IL1);
     Insert(IL1);
-    Insert(New(PLabel, Init(R1, '~T~ext to find', IL1)));
+    Insert(New(PLabel, Init(R1, label_find_texttofind, IL1)));
     R1.Assign(R2.B.X, R2.A.Y, R2.B.X+3, R2.B.Y);
     R1.Assign(R2.B.X, R2.A.Y, R2.B.X+3, R2.B.Y);
     Control := New(PHistory, Init(R1, IL1, TextFindId));
     Control := New(PHistory, Init(R1, IL1, TextFindId));
     Insert(Control);
     Insert(Control);
@@ -5532,43 +5535,43 @@ begin
     R1.Copy(R); Inc(R1.A.Y,2); R1.B.Y:=R1.A.Y+1; R1.B.X:=R1.A.X+(R1.B.X-R1.A.X) div 2-1;
     R1.Copy(R); Inc(R1.A.Y,2); R1.B.Y:=R1.A.Y+1; R1.B.X:=R1.A.X+(R1.B.X-R1.A.X) div 2-1;
     R2.Copy(R1); R2.Move(0,1); R2.B.Y:=R2.A.Y+2;
     R2.Copy(R1); R2.Move(0,1); R2.B.Y:=R2.A.Y+2;
     New(CB1, Init(R2,
     New(CB1, Init(R2,
-      NewSItem('~C~ase sensitive',
-      NewSItem('~W~hole words only',
+      NewSItem(label_find_casesensitive,
+      NewSItem(label_find_wholewordsonly,
       nil))));
       nil))));
     Insert(CB1);
     Insert(CB1);
-    Insert(New(PLabel, Init(R1, 'Options', CB1)));
+    Insert(New(PLabel, Init(R1, label_find_options, CB1)));
 
 
     R1.Copy(R); Inc(R1.A.Y,2); R1.B.Y:=R1.A.Y+1; R1.A.X:=R1.B.X-(R1.B.X-R1.A.X) div 2+1;
     R1.Copy(R); Inc(R1.A.Y,2); R1.B.Y:=R1.A.Y+1; R1.A.X:=R1.B.X-(R1.B.X-R1.A.X) div 2+1;
     R2.Copy(R1); R2.Move(0,1); R2.B.Y:=R2.A.Y+2;
     R2.Copy(R1); R2.Move(0,1); R2.B.Y:=R2.A.Y+2;
     New(RB1, Init(R2,
     New(RB1, Init(R2,
-      NewSItem('Forwar~d~',
-      NewSItem('~B~ackward',
+      NewSItem(label_find_forward,
+      NewSItem(label_find_backward,
       nil))));
       nil))));
     Insert(RB1);
     Insert(RB1);
-    Insert(New(PLabel, Init(R1, 'Direction', RB1)));
+    Insert(New(PLabel, Init(R1, label_find_direction, RB1)));
 
 
     R1.Copy(R); Inc(R1.A.Y,6); R1.B.Y:=R1.A.Y+1; R1.B.X:=R1.A.X+(R1.B.X-R1.A.X) div 2-1;
     R1.Copy(R); Inc(R1.A.Y,6); R1.B.Y:=R1.A.Y+1; R1.B.X:=R1.A.X+(R1.B.X-R1.A.X) div 2-1;
     R2.Copy(R1); R2.Move(0,1); R2.B.Y:=R2.A.Y+2;
     R2.Copy(R1); R2.Move(0,1); R2.B.Y:=R2.A.Y+2;
     New(RB2, Init(R2,
     New(RB2, Init(R2,
-      NewSItem('~G~lobal',
-      NewSItem('~S~elected text',
+      NewSItem(label_find_global,
+      NewSItem(label_find_selectedtext,
       nil))));
       nil))));
     Insert(RB2);
     Insert(RB2);
-    Insert(New(PLabel, Init(R1, 'Scope', RB2)));
+    Insert(New(PLabel, Init(R1, label_find_scope, RB2)));
 
 
     R1.Copy(R); Inc(R1.A.Y,6); R1.B.Y:=R1.A.Y+1; R1.A.X:=R1.B.X-(R1.B.X-R1.A.X) div 2+1;
     R1.Copy(R); Inc(R1.A.Y,6); R1.B.Y:=R1.A.Y+1; R1.A.X:=R1.B.X-(R1.B.X-R1.A.X) div 2+1;
     R2.Copy(R1); R2.Move(0,1); R2.B.Y:=R2.A.Y+2;
     R2.Copy(R1); R2.Move(0,1); R2.B.Y:=R2.A.Y+2;
     New(RB3, Init(R2,
     New(RB3, Init(R2,
-      NewSItem('~F~rom cursor',
-      NewSItem('~E~ntire scope',
+      NewSItem(label_find_fromcursor,
+      NewSItem(label_find_entirescope,
       nil))));
       nil))));
     Insert(RB3);
     Insert(RB3);
-    Insert(New(PLabel, Init(R1, 'Origin', RB3)));
+    Insert(New(PLabel, Init(R1, label_find_origin, RB3)));
 
 
     GetExtent(R); R.Grow(-13,-1); R.A.Y:=R.B.Y-2; R.B.X:=R.A.X+10;
     GetExtent(R); R.Grow(-13,-1); R.A.Y:=R.B.Y-2; R.B.X:=R.A.X+10;
-    Insert(New(PButton, Init(R, 'O~K', cmOK, bfDefault)));
+    Insert(New(PButton, Init(R, btn_OK, cmOK, bfDefault)));
     R.Move(19,0);
     R.Move(19,0);
-    Insert(New(PButton, Init(R, 'Cancel', cmCancel, bfNormal)));
+    Insert(New(PButton, Init(R, btn_Cancel, cmCancel, bfNormal)));
   end;
   end;
   IL1^.Select;
   IL1^.Select;
   CreateFindDialog := D;
   CreateFindDialog := D;
@@ -5583,7 +5586,7 @@ var R,R1,R2: TRect;
     RB1,RB2,RB3: PRadioButtons;
     RB1,RB2,RB3: PRadioButtons;
 begin
 begin
   R.Assign(0,0,56,18);
   R.Assign(0,0,56,18);
-  New(D, Init(R, 'Replace'));
+  New(D, Init(R, dialog_replace));
   with D^ do
   with D^ do
   begin
   begin
     Options:=Options or ofCentered;
     Options:=Options or ofCentered;
@@ -5593,7 +5596,7 @@ begin
     New(IL1, Init(R2, FindStrSize));
     New(IL1, Init(R2, FindStrSize));
     IL1^.Data^:=FindStr;
     IL1^.Data^:=FindStr;
     Insert(IL1);
     Insert(IL1);
-    Insert(New(PLabel, Init(R1, '~T~ext to find', IL1)));
+    Insert(New(PLabel, Init(R1, label_replace_texttofind, IL1)));
     R1.Assign(R2.B.X, R2.A.Y, R2.B.X+3, R2.B.Y);
     R1.Assign(R2.B.X, R2.A.Y, R2.B.X+3, R2.B.Y);
     Control := New(PHistory, Init(R1, IL1, TextFindId));
     Control := New(PHistory, Init(R1, IL1, TextFindId));
     Insert(Control);
     Insert(Control);
@@ -5604,7 +5607,7 @@ begin
     New(IL2, Init(R2, FindStrSize));
     New(IL2, Init(R2, FindStrSize));
     IL2^.Data^:=ReplaceStr;
     IL2^.Data^:=ReplaceStr;
     Insert(IL2);
     Insert(IL2);
-    Insert(New(PLabel, Init(R1, '    ~N~ew text', IL2)));
+    Insert(New(PLabel, Init(R1, label_replace_newtext, IL2)));
     R1.Assign(R2.B.X, R2.A.Y, R2.B.X+3, R2.B.Y);
     R1.Assign(R2.B.X, R2.A.Y, R2.B.X+3, R2.B.Y);
     Control := New(PHistory, Init(R1, IL2, TextReplaceId));
     Control := New(PHistory, Init(R1, IL2, TextReplaceId));
     Insert(Control);
     Insert(Control);
@@ -5612,46 +5615,46 @@ begin
     R1.Copy(R); Inc(R1.A.Y,4); R1.B.Y:=R1.A.Y+1; R1.B.X:=R1.A.X+(R1.B.X-R1.A.X) div 2-1;
     R1.Copy(R); Inc(R1.A.Y,4); R1.B.Y:=R1.A.Y+1; R1.B.X:=R1.A.X+(R1.B.X-R1.A.X) div 2-1;
     R2.Copy(R1); R2.Move(0,1); R2.B.Y:=R2.A.Y+3;
     R2.Copy(R1); R2.Move(0,1); R2.B.Y:=R2.A.Y+3;
     New(CB1, Init(R2,
     New(CB1, Init(R2,
-      NewSItem('~C~ase sensitive',
-      NewSItem('~W~hole words only',
-      NewSItem('~P~rompt on replace',
+      NewSItem(label_replace_casesensitive,
+      NewSItem(label_replace_wholewordsonly,
+      NewSItem(label_replace_promptonreplace,
       nil)))));
       nil)))));
     Insert(CB1);
     Insert(CB1);
-    Insert(New(PLabel, Init(R1, 'Options', CB1)));
+    Insert(New(PLabel, Init(R1, label_replace_options, CB1)));
 
 
     R1.Copy(R); Inc(R1.A.Y,4); R1.B.Y:=R1.A.Y+1; R1.A.X:=R1.B.X-(R1.B.X-R1.A.X) div 2+1;
     R1.Copy(R); Inc(R1.A.Y,4); R1.B.Y:=R1.A.Y+1; R1.A.X:=R1.B.X-(R1.B.X-R1.A.X) div 2+1;
     R2.Copy(R1); R2.Move(0,1); R2.B.Y:=R2.A.Y+2;
     R2.Copy(R1); R2.Move(0,1); R2.B.Y:=R2.A.Y+2;
     New(RB1, Init(R2,
     New(RB1, Init(R2,
-      NewSItem('Forwar~d~',
-      NewSItem('~B~ackward',
+      NewSItem(label_replace_forward,
+      NewSItem(label_replace_backward,
       nil))));
       nil))));
     Insert(RB1);
     Insert(RB1);
-    Insert(New(PLabel, Init(R1, 'Direction', RB1)));
+    Insert(New(PLabel, Init(R1, label_replace_direction, RB1)));
 
 
     R1.Copy(R); Inc(R1.A.Y,9); R1.B.Y:=R1.A.Y+1; R1.B.X:=R1.A.X+(R1.B.X-R1.A.X) div 2-1;
     R1.Copy(R); Inc(R1.A.Y,9); R1.B.Y:=R1.A.Y+1; R1.B.X:=R1.A.X+(R1.B.X-R1.A.X) div 2-1;
     R2.Copy(R1); R2.Move(0,1); R2.B.Y:=R2.A.Y+2;
     R2.Copy(R1); R2.Move(0,1); R2.B.Y:=R2.A.Y+2;
     New(RB2, Init(R2,
     New(RB2, Init(R2,
-      NewSItem('~G~lobal',
-      NewSItem('~S~elected text',
+      NewSItem(label_replace_global,
+      NewSItem(label_replace_selectedtext,
       nil))));
       nil))));
     Insert(RB2);
     Insert(RB2);
-    Insert(New(PLabel, Init(R1, 'Scope', RB2)));
+    Insert(New(PLabel, Init(R1, label_replace_scope, RB2)));
 
 
     R1.Copy(R); Inc(R1.A.Y,9); R1.B.Y:=R1.A.Y+1; R1.A.X:=R1.B.X-(R1.B.X-R1.A.X) div 2+1;
     R1.Copy(R); Inc(R1.A.Y,9); R1.B.Y:=R1.A.Y+1; R1.A.X:=R1.B.X-(R1.B.X-R1.A.X) div 2+1;
     R2.Copy(R1); R2.Move(0,1); R2.B.Y:=R2.A.Y+2;
     R2.Copy(R1); R2.Move(0,1); R2.B.Y:=R2.A.Y+2;
     New(RB3, Init(R2,
     New(RB3, Init(R2,
-      NewSItem('~F~rom cursor',
-      NewSItem('~E~ntire scope',
+      NewSItem(label_replace_fromcursor,
+      NewSItem(label_replace_entirescope,
       nil))));
       nil))));
     Insert(RB3);
     Insert(RB3);
-    Insert(New(PLabel, Init(R1, 'Origin', RB3)));
+    Insert(New(PLabel, Init(R1, label_replace_origin, RB3)));
 
 
     GetExtent(R); R.Grow(-13,-1); R.A.Y:=R.B.Y-2; R.B.X:=R.A.X+10; R.Move(-10,0);
     GetExtent(R); R.Grow(-13,-1); R.A.Y:=R.B.Y-2; R.B.X:=R.A.X+10; R.Move(-10,0);
-    Insert(New(PButton, Init(R, 'O~K~', cmOK, bfDefault)));
+    Insert(New(PButton, Init(R, btn_OK, cmOK, bfDefault)));
     R.Move(11,0); R.B.X:=R.A.X+14;
     R.Move(11,0); R.B.X:=R.A.X+14;
-    Insert(New(PButton, Init(R, 'Change ~a~ll', cmYes, bfNormal)));
+    Insert(New(PButton, Init(R, btn_replace_changeall, cmYes, bfNormal)));
     R.Move(15,0); R.B.X:=R.A.X+10;
     R.Move(15,0); R.B.X:=R.A.X+10;
-    Insert(New(PButton, Init(R, 'Cancel', cmCancel, bfNormal)));
+    Insert(New(PButton, Init(R, btn_Cancel, cmCancel, bfNormal)));
   end;
   end;
   IL1^.Select;
   IL1^.Select;
   CreateReplaceDialog := D;
   CreateReplaceDialog := D;
@@ -5664,7 +5667,7 @@ var D: PDialog;
     IL: PInputLine;
     IL: PInputLine;
 begin
 begin
   R.Assign(0,0,40,7);
   R.Assign(0,0,40,7);
-  New(D, Init(R, 'Goto line'));
+  New(D, Init(R, dialog_gotoline));
   with D^ do
   with D^ do
   begin
   begin
     Options:=Options or ofCentered;
     Options:=Options or ofCentered;
@@ -5675,15 +5678,15 @@ begin
     with TGotoLineDialogRec(Info^) do
     with TGotoLineDialogRec(Info^) do
     IL^.SetValidator(New(PRangeValidator, Init(1, Lines)));
     IL^.SetValidator(New(PRangeValidator, Init(1, Lines)));
     Insert(IL);
     Insert(IL);
-    Insert(New(PLabel, Init(R1, 'Enter new line ~n~umber', IL)));
+    Insert(New(PLabel, Init(R1, label_gotoline_linenumber, IL)));
     R1.Assign(R2.B.X, R2.A.Y, R2.B.X+3, R2.B.Y);
     R1.Assign(R2.B.X, R2.A.Y, R2.B.X+3, R2.B.Y);
     Control := New(PHistory, Init(R1, IL, GotoId));
     Control := New(PHistory, Init(R1, IL, GotoId));
     Insert(Control);
     Insert(Control);
 
 
     GetExtent(R); R.Grow(-8,-1); R.A.Y:=R.B.Y-2; R.B.X:=R.A.X+10;
     GetExtent(R); R.Grow(-8,-1); R.A.Y:=R.B.Y-2; R.B.X:=R.A.X+10;
-    Insert(New(PButton, Init(R, 'O~K', cmOK, bfDefault)));
+    Insert(New(PButton, Init(R, btn_OK, cmOK, bfDefault)));
     R.Move(15,0);
     R.Move(15,0);
-    Insert(New(PButton, Init(R, 'Cancel', cmCancel, bfNormal)));
+    Insert(New(PButton, Init(R, btn_Cancel, cmCancel, bfNormal)));
   end;
   end;
   IL^.Select;
   IL^.Select;
   CreateGotoLineDialog:=D;
   CreateGotoLineDialog:=D;
@@ -5702,33 +5705,31 @@ var
 begin
 begin
   case Dialog of
   case Dialog of
     edOutOfMemory:
     edOutOfMemory:
-      StdEditorDialog := MessageBox('Not enough memory for this operation.',
+      StdEditorDialog := MessageBox(msg_notenoughmemoryforthisoperation,
    nil, mfInsertInApp+ mfError + mfOkButton);
    nil, mfInsertInApp+ mfError + mfOkButton);
     edReadError:
     edReadError:
-      StdEditorDialog := MessageBox('Error reading file %s.',
+      StdEditorDialog := MessageBox(msg_errorreadingfile,
    @Info, mfInsertInApp+ mfError + mfOkButton);
    @Info, mfInsertInApp+ mfError + mfOkButton);
     edWriteError:
     edWriteError:
-      StdEditorDialog := MessageBox('Error writing file %s.',
+      StdEditorDialog := MessageBox(msg_errorwritingfile,
    @Info, mfInsertInApp+ mfError + mfOkButton);
    @Info, mfInsertInApp+ mfError + mfOkButton);
     edSaveError:
     edSaveError:
-      StdEditorDialog := MessageBox('Error saving file %s.',
+      StdEditorDialog := MessageBox(msg_errorsavingfile,
    @Info, mfInsertInApp+ mfError + mfOkButton);
    @Info, mfInsertInApp+ mfError + mfOkButton);
     edCreateError:
     edCreateError:
-      StdEditorDialog := MessageBox('Error creating file %s.',
+      StdEditorDialog := MessageBox(msg_errorcreatingfile,
    @Info, mfInsertInApp+ mfError + mfOkButton);
    @Info, mfInsertInApp+ mfError + mfOkButton);
     edSaveModify:
     edSaveModify:
-      StdEditorDialog := MessageBox('%s has been modified. Save?',
+      StdEditorDialog := MessageBox(msg_filehasbeenmodifiedsave,
    @Info, mfInsertInApp+ mfInformation + mfYesNoCancel);
    @Info, mfInsertInApp+ mfInformation + mfYesNoCancel);
     edSaveUntitled:
     edSaveUntitled:
-      StdEditorDialog := MessageBox('Save untitled file?',
+      StdEditorDialog := MessageBox(msg_saveuntitledfile,
    nil, mfInsertInApp+ mfInformation + mfYesNoCancel);
    nil, mfInsertInApp+ mfInformation + mfYesNoCancel);
     edChangedOnloading:
     edChangedOnloading:
-      StdEditorDialog := MessageBox(#3'File %s had too long lines'#13#3+
-      'first such line is %d',
+      StdEditorDialog := MessageBox(msg_filehadtoolonglines,
    Info, mfInsertInApp+ mfOKButton + mfInformation);
    Info, mfInsertInApp+ mfOKButton + mfInformation);
     edFileOnDiskChanged:
     edFileOnDiskChanged:
-      StdEditorDialog := MessageBox(#3'File %s '#13#3+
-        'was modified by another program.'#13#3'Overwrite new version?',
+      StdEditorDialog := MessageBox(msg_filewasmodified,
    @info, mfInsertInApp+ mfInformation + mfYesNoCancel);
    @info, mfInsertInApp+ mfInformation + mfYesNoCancel);
     edSaveAs,edWriteBlock,edReadBlock:
     edSaveAs,edWriteBlock,edReadBlock:
       begin
       begin
@@ -5754,23 +5755,23 @@ begin
         case Dialog of
         case Dialog of
           edSaveAs     :
           edSaveAs     :
             begin
             begin
-              Title:='Save File As';
+              Title:=dialog_savefileas;
               DefExt:='*'+DefaultSaveExt;
               DefExt:='*'+DefaultSaveExt;
             end;
             end;
           edWriteBlock :
           edWriteBlock :
             begin
             begin
-              Title:='Write Block to File';
+              Title:=dialog_writeblocktofile;
               DefExt:='';
               DefExt:='';
             end;
             end;
           edReadBlock  :
           edReadBlock  :
             begin
             begin
-              Title:='Read Block from File';
+              Title:=dialog_readblockfromfile;
               DefExt:='';
               DefExt:='';
             end;
             end;
         else begin Title:='???'; DefExt:=''; end;
         else begin Title:='???'; DefExt:=''; end;
         end;
         end;
         Re:=Application^.ExecuteDialog(New(PFileDialog, Init(DefExt,
         Re:=Application^.ExecuteDialog(New(PFileDialog, Init(DefExt,
-          Title, '~N~ame', fdOkButton, FileId)), @Name);
+          Title, label_name, fdOkButton, FileId)), @Name);
         case Dialog of
         case Dialog of
           edSaveAs     :
           edSaveAs     :
             begin
             begin
@@ -5809,7 +5810,7 @@ begin
       StdEditorDialog :=
       StdEditorDialog :=
    Application^.ExecuteDialog(CreateFindDialog, Info);
    Application^.ExecuteDialog(CreateFindDialog, Info);
     edSearchFailed:
     edSearchFailed:
-      StdEditorDialog := MessageBox('Search string not found.',
+      StdEditorDialog := MessageBox(msg_searchstringnotfound,
    nil, mfInsertInApp+ mfError + mfOkButton);
    nil, mfInsertInApp+ mfError + mfOkButton);
     edReplace:
     edReplace:
       StdEditorDialog :=
       StdEditorDialog :=
@@ -5823,12 +5824,12 @@ begin
    Inc(T.Y);
    Inc(T.Y);
    if PPoint(Info)^.Y <= T.Y then
    if PPoint(Info)^.Y <= T.Y then
      R.Move(0, Desktop^.Size.Y - R.B.Y - 2);
      R.Move(0, Desktop^.Size.Y - R.B.Y - 2);
-   StdEditorDialog := MessageBoxRect(R, 'Replace this occurence?',
+   StdEditorDialog := MessageBoxRect(R, msg_replacethisoccourence,
      nil, mfInsertInApp+ mfYesNoCancel + mfInformation);
      nil, mfInsertInApp+ mfYesNoCancel + mfInformation);
       end;
       end;
     edReplaceFile :
     edReplaceFile :
       StdEditorDialog :=
       StdEditorDialog :=
-   MessageBox('File %s already exists. Overwrite?',@Info,mfInsertInApp+mfConfirmation+
+   MessageBox(msg_fileexistsoverwrite,@Info,mfInsertInApp+mfConfirmation+
      mfYesButton+mfNoButton);
      mfYesButton+mfNoButton);
   end;
   end;
 end;
 end;
@@ -5842,7 +5843,10 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.92  2000-06-15 20:29:45  pierre
+  Revision 1.93  2000-06-16 08:50:43  pierre
+   + new bunch of Gabor's changes
+
+  Revision 1.92  2000/06/15 20:29:45  pierre
    * avoid RTE 211 on Ctrl K W
    * avoid RTE 211 on Ctrl K W
 
 
   Revision 1.91  2000/05/29 10:44:58  pierre
   Revision 1.91  2000/05/29 10:44:58  pierre

+ 13 - 6
ide/text/whelp.pas

@@ -272,7 +272,7 @@ uses
 {$ifdef Linux}
 {$ifdef Linux}
   linux,
   linux,
 {$endif Linux}
 {$endif Linux}
-  WViews,WHTMLHlp;
+  WConsts,WViews,WHTMLHlp;
 
 
 
 
 Function GetDosTicks:longint; { returns ticks at 18.2 Hz, just like DOS }
 Function GetDosTicks:longint; { returns ticks at 18.2 Hz, just like DOS }
@@ -551,8 +551,12 @@ begin
     else
     else
      begin
      begin
      {$ifdef DEBUGMSG}
      {$ifdef DEBUGMSG}
-       ErrorBox('Uknown help record tag 0x'+IntToHex(R.SClass)+' encountered, offset 0x'+IntToHex(L)+
-         ', size '+IntToStr(R.Size),nil);
+       ClearFormatParams;
+       AddFormatParamInt(R.SClass);
+       AddFormatParamInt(L);
+       AddFormatParamInt(R.Size);
+       ErrorBox('Uknown help record tag %x encountered, '+
+                'offset %x, size %d',@FormatParams);
      {$else}
      {$else}
        {Skip};
        {Skip};
      {$endif}
      {$endif}
@@ -1081,10 +1085,10 @@ begin
   if HelpFiles^.Count=0 then
   if HelpFiles^.Count=0 then
     begin
     begin
       AddLine('');
       AddLine('');
-      AddLine(' No help files installed.')
+      AddLine(' '+msg_nohelpfilesinstalled)
     end else
     end else
   begin
   begin
-    AddLine(' Help index');
+    AddLine(' '+msg_helpindex);
     KWCount:=0; Line:='';
     KWCount:=0; Line:='';
     T^.LinkCount:=Keywords^.Count;
     T^.LinkCount:=Keywords^.Count;
     GetMem(T^.Links,T^.LinkSize);
     GetMem(T^.Links,T^.LinkSize);
@@ -1130,7 +1134,10 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.22  2000-05-31 20:42:02  pierre
+  Revision 1.23  2000-06-16 08:50:44  pierre
+   + new bunch of Gabor's changes
+
+  Revision 1.22  2000/05/31 20:42:02  pierre
    * fixthe TRect problem by 'using' windows before objects
    * fixthe TRect problem by 'using' windows before objects
 
 
   Revision 1.21  2000/05/30 07:18:33  pierre
   Revision 1.21  2000/05/30 07:18:33  pierre

+ 6 - 3
ide/text/whlpview.pas

@@ -213,7 +213,7 @@ implementation
 
 
 uses
 uses
   Video,
   Video,
-  WViews;
+  WConsts,WViews;
 
 
 const CommentColor = Blue;
 const CommentColor = Blue;
 
 
@@ -504,7 +504,7 @@ begin
 end;
 end;
 begin
 begin
   Lines^.FreeAll; Links^.FreeAll; NamedMarks^.FreeAll; ColorAreas^.FreeAll;
   Lines^.FreeAll; Links^.FreeAll; NamedMarks^.FreeAll; ColorAreas^.FreeAll;
-  if Topic=nil then Lines^.Insert(NewStr('No help available for this topic.')) else
+  if Topic=nil then Lines^.Insert(NewStr(msg_nohelpavailabelforthistopic)) else
   begin
   begin
     LineStart:=0; NextLineStart:=0;
     LineStart:=0; NextLineStart:=0;
     TextPos:=0; ClearLine; CurWord:=''; Line:='';
     TextPos:=0; ClearLine; CurWord:=''; Line:='';
@@ -1318,7 +1318,10 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.16  2000-05-30 07:18:33  pierre
+  Revision 1.17  2000-06-16 08:50:45  pierre
+   + new bunch of Gabor's changes
+
+  Revision 1.16  2000/05/30 07:18:33  pierre
    + colors for HTML help by Gabor
    + colors for HTML help by Gabor
 
 
   Revision 1.15  2000/05/29 10:45:00  pierre
   Revision 1.15  2000/05/29 10:45:00  pierre

+ 23 - 4
ide/text/whtmlhlp.pas

@@ -1,3 +1,16 @@
+{
+    $Id$
+    This file is part of the Free Pascal Integrated Development Environment
+    Copyright (c) 1999-2000 by Berczi Gabor
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
 unit WHTMLHlp;
 unit WHTMLHlp;
 
 
 interface
 interface
@@ -124,7 +137,7 @@ const HTMLGetSectionColor : THTMLGetSectionColorProc = DefHTMLGetSectionColor;
 
 
 implementation
 implementation
 
 
-uses WUtils,WHTMLScn,
+uses WConsts,WUtils,WViews,WHTMLScn,
      Dos;
      Dos;
 
 
 function DefHTMLGetSectionColor(Section: THTMLSection; var Color: byte): boolean;
 function DefHTMLGetSectionColor(Section: THTMLSection; var Color: byte): boolean;
@@ -642,10 +655,10 @@ begin
       if HTMLFile=nil then
       if HTMLFile=nil then
         begin
         begin
           New(HTMLFile, Init);
           New(HTMLFile, Init);
-          HTMLFile^.AddLine('<HEAD><TITLE>Page not available</TITLE></HEAD>');
+          HTMLFile^.AddLine('<HEAD><TITLE>'+msg_pagenotavailable+'</TITLE></HEAD>');
           HTMLFile^.AddLine(
           HTMLFile^.AddLine(
             '<BODY>'+
             '<BODY>'+
-            'Sorry, can''t access the URL: '+Name+'... <br><br>'+
+            FormatStrStr(msg_cantaccessurl,Name)+'<br><br>'+
             '</BODY>');
             '</BODY>');
         end;
         end;
       OK:=Renderer^.BuildTopic(T,Name,HTMLFile,TopicLinks);
       OK:=Renderer^.BuildTopic(T,Name,HTMLFile,TopicLinks);
@@ -728,4 +741,10 @@ begin
   LoadIndex:=OK;
   LoadIndex:=OK;
 end;
 end;
 
 
-END.
+END.
+{
+  $Log$
+  Revision 1.14  2000-06-16 08:50:45  pierre
+   + new bunch of Gabor's changes
+
+}

+ 5 - 2
ide/text/winclip.pas

@@ -39,7 +39,7 @@ implementation
     {go32   sorry Gabor, but its still not compiling without that ! }
     {go32   sorry Gabor, but its still not compiling without that ! }
     {now it works. btw. you don't have to sorry - just to tell me... ;)) Gabor }
     {now it works. btw. you don't have to sorry - just to tell me... ;)) Gabor }
 {$endif go32v2}
 {$endif go32v2}
-    strings,dos;
+    dos;
 {$endif DOS}
 {$endif DOS}
 
 
 {$ifdef win32}
 {$ifdef win32}
@@ -234,7 +234,10 @@ end.
 
 
 {
 {
  $Log$
  $Log$
- Revision 1.6  2000-04-25 08:42:35  pierre
+ Revision 1.7  2000-06-16 08:50:45  pierre
+  + new bunch of Gabor's changes
+
+ Revision 1.6  2000/04/25 08:42:35  pierre
   * New Gabor changes : see fixes.txt
   * New Gabor changes : see fixes.txt
 
 
  Revision 1.5  2000/04/18 11:42:39  pierre
  Revision 1.5  2000/04/18 11:42:39  pierre

+ 16 - 1
ide/text/wutils.pas

@@ -118,6 +118,8 @@ function FormatPath(Path: string): string;
 function CompletePath(const Base, InComplete: string): string;
 function CompletePath(const Base, InComplete: string): string;
 function CompleteURL(const Base, URLRef: string): string;
 function CompleteURL(const Base, URLRef: string): string;
 
 
+function DeleteFile(const FileName: string): integer;
+
 function EatIO: integer;
 function EatIO: integer;
 
 
 function Now: longint;
 function Now: longint;
@@ -878,6 +880,16 @@ begin
   FormatDateTime:=DateS;
   FormatDateTime:=DateS;
 end;
 end;
 
 
+function DeleteFile(const FileName: string): integer;
+var f: file;
+begin
+{$I-}
+  Assign(f,FileName);
+  Erase(f);
+  DeleteFile:=EatIO;
+{$I+}
+end;
+
 procedure GiveUpTimeSlice;
 procedure GiveUpTimeSlice;
 {$ifdef GO32V2}{$define DOS}{$endif}
 {$ifdef GO32V2}{$define DOS}{$endif}
 {$ifdef TP}{$define DOS}{$endif}
 {$ifdef TP}{$define DOS}{$endif}
@@ -909,7 +921,10 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.22  2000-05-29 11:09:14  pierre
+  Revision 1.23  2000-06-16 08:50:45  pierre
+   + new bunch of Gabor's changes
+
+  Revision 1.22  2000/05/29 11:09:14  pierre
    + New bunch of Gabor's changes: see fixes.txt
    + New bunch of Gabor's changes: see fixes.txt
 
 
   Revision 1.21  2000/05/02 08:42:29  pierre
   Revision 1.21  2000/05/02 08:42:29  pierre

+ 52 - 13
ide/text/wviews.pas

@@ -72,6 +72,11 @@ type
       procedure   Store(var S: TStream);
       procedure   Store(var S: TStream);
     end;
     end;
 
 
+    PNoUpdateButton = ^TNoUpdateButton;
+    TNoUpdateButton = object(TButton)
+      procedure HandleEvent(var Event: TEvent); virtual;
+    end;
+
     TLocalMenuListBox = object(TAdvancedListBox)
     TLocalMenuListBox = object(TAdvancedListBox)
       procedure   HandleEvent(var Event: TEvent); virtual;
       procedure   HandleEvent(var Event: TEvent); virtual;
       procedure   LocalMenu(P: TPoint); virtual;
       procedure   LocalMenu(P: TPoint); virtual;
@@ -86,7 +91,8 @@ type
       Color: word;
       Color: word;
       DontWrap: boolean;
       DontWrap: boolean;
       Delta: TPoint;
       Delta: TPoint;
-      constructor Init(var Bounds: TRect; AText: String; AColor: word);
+      constructor Init(var Bounds: TRect; AText: String; AColor: word; AWrap: boolean);
+      function    GetPalette: PPalette; virtual;
       procedure   Draw; virtual;
       procedure   Draw; virtual;
       constructor Load(var S: TStream);
       constructor Load(var S: TStream);
       procedure   Store(var S: TStream);
       procedure   Store(var S: TStream);
@@ -169,6 +175,11 @@ type
       function GetPalette: PPalette; virtual;
       function GetPalette: PPalette; virtual;
     end;
     end;
 
 
+    PPanel = ^TPanel;
+    TPanel = object(TGroup)
+      constructor Init(var Bounds: TRect);
+    end;
+
 procedure InsertOK(ADialog: PDialog);
 procedure InsertOK(ADialog: PDialog);
 procedure InsertButtons(ADialog: PDialog);
 procedure InsertButtons(ADialog: PDialog);
 
 
@@ -193,6 +204,8 @@ function  GetMenuItemBefore(Menu:PMenu; BeforeOf: PMenuItem): PMenuItem;
 
 
 procedure NotImplemented;
 procedure NotImplemented;
 
 
+function ColorIndex(Color: byte): word;
+
 var  FormatParams     : array[1..20] of longint;
 var  FormatParams     : array[1..20] of longint;
      FormatParamCount : integer;
      FormatParamCount : integer;
      FormatParamStrs  : array[1..10] of string;
      FormatParamStrs  : array[1..10] of string;
@@ -214,7 +227,7 @@ implementation
 
 
 uses Mouse,
 uses Mouse,
      Commands,App,MsgBox,
      Commands,App,MsgBox,
-     WUtils;
+     WConsts,WUtils;
 
 
 {$ifndef NOOBJREG}
 {$ifndef NOOBJREG}
 const
 const
@@ -247,6 +260,11 @@ const
 const
 const
   MessageDialog  : PCenterDialog = nil;
   MessageDialog  : PCenterDialog = nil;
 
 
+function ColorIndex(Color: byte): word;
+begin
+  ColorIndex:=(Color and $0f)+(Color and $0f) shl 4;
+end;
+
 {*****************************************************************************
 {*****************************************************************************
                               TCenterDialog
                               TCenterDialog
 *****************************************************************************}
 *****************************************************************************}
@@ -1124,12 +1142,18 @@ begin
   inherited HandleEvent(Event);
   inherited HandleEvent(Event);
 end;
 end;
 
 
-constructor TColorStaticText.Init(var Bounds: TRect; AText: String; AColor: word);
+constructor TColorStaticText.Init(var Bounds: TRect; AText: String; AColor: word; AWrap: boolean);
 begin
 begin
   inherited Init(Bounds,AText);
   inherited Init(Bounds,AText);
+  DontWrap:=not AWrap;
   Color:=AColor;
   Color:=AColor;
 end;
 end;
 
 
+function TColorStaticText.GetPalette: PPalette;
+begin
+  GetPalette:=nil;
+end;
+
 procedure TColorStaticText.Draw;
 procedure TColorStaticText.Draw;
 
 
   procedure MoveColorTxt(var b;const curs:string;c:word);
   procedure MoveColorTxt(var b;const curs:string;c:word);
@@ -1188,9 +1212,11 @@ var
   TempS: string;
   TempS: string;
 begin
 begin
   if Size.X=0 then Exit;
   if Size.X=0 then Exit;
+  C:=Color;
+  if (C and $0f)=((C and $f0) shr 4) then
+    C:=GetColor(C and $0f);
   if DontWrap=false then
   if DontWrap=false then
  begin
  begin
-  C:=Color;
   GetText(S);
   GetText(S);
   L := Length(S);
   L := Length(S);
   P := 1;
   P := 1;
@@ -1235,7 +1261,6 @@ begin
   end;
   end;
  end { Wrap=false } else
  end { Wrap=false } else
  begin
  begin
-  C := Color;
   GetText(S);
   GetText(S);
   I:=1;
   I:=1;
   for Y:=0 to Size.Y-1 do
   for Y:=0 to Size.Y-1 do
@@ -1395,7 +1420,7 @@ end;
 
 
 procedure Bug(const S: string; Params: pointer);
 procedure Bug(const S: string; Params: pointer);
 begin
 begin
-  ErrorBox('Bug check failed: '+S+#13+'Please report to author!',Params);
+  ErrorBox(FormatStrStr(msg_bugcheckfailed,S),Params);
 end;
 end;
 
 
 procedure ErrorBox(const S: string; Params: pointer);
 procedure ErrorBox(const S: string; Params: pointer);
@@ -1544,9 +1569,7 @@ end;
 
 
 procedure NotImplemented;
 procedure NotImplemented;
 begin
 begin
-  InformationBox( #3'This function is not'#13+
-  #3+'yet implemented...'#13+
-  #3+'Sorry',nil);
+  InformationBox(msg_functionnotimplemented,nil);
 end;
 end;
 
 
 procedure InsertButtons(ADialog: PDialog);
 procedure InsertButtons(ADialog: PDialog);
@@ -1562,9 +1585,9 @@ begin
     R.Assign(0,0,W,H+3); ChangeBounds(R);
     R.Assign(0,0,W,H+3); ChangeBounds(R);
     X:=W div 2; X1:=X div 2+1; X2:=X+X1-1;
     X:=W div 2; X1:=X div 2+1; X2:=X+X1-1;
     R.Assign(X1-3,H,X1+7,H+2);
     R.Assign(X1-3,H,X1+7,H+2);
-    Insert(New(PButton, Init(R, 'O~K~', cmOK, bfDefault)));
+    Insert(New(PButton, Init(R, btn_OK, cmOK, bfDefault)));
     R.Assign(X2-7,H,X2+3,H+2);
     R.Assign(X2-7,H,X2+3,H+2);
-    Insert(New(PButton, Init(R, 'Cancel', cmCancel, bfNormal)));
+    Insert(New(PButton, Init(R, btn_Cancel, cmCancel, bfNormal)));
     SelectNext(true);
     SelectNext(true);
   end;
   end;
 end;
 end;
@@ -1580,7 +1603,7 @@ begin
     BW:=10;
     BW:=10;
     R.A.Y:=R.B.Y-2; R.B.Y:=R.A.Y+2;
     R.A.Y:=R.B.Y-2; R.B.Y:=R.A.Y+2;
     R.A.X:=R.A.X+(R.B.X-R.A.X-BW) div 2; R.B.X:=R.A.X+BW;
     R.A.X:=R.A.X+(R.B.X-R.A.X-BW) div 2; R.B.X:=R.A.X+BW;
-    Insert(New(PButton, Init(R, 'O~K~', cmOK, bfDefault)));
+    Insert(New(PButton, Init(R, btn_OK, cmOK, bfDefault)));
     SelectNext(true);
     SelectNext(true);
   end;
   end;
 end;
 end;
@@ -2078,6 +2101,19 @@ begin
   S.Write(Default,SizeOf(Default));
   S.Write(Default,SizeOf(Default));
 end;
 end;
 
 
+procedure TNoUpdateButton.HandleEvent(var Event: TEvent);
+begin
+  if (Event.What<>evBroadcast) or (Event.Command<>cmCommandSetChanged) then
+  inherited HandleEvent(Event);
+end;
+
+constructor TPanel.Init(var Bounds: TRect);
+begin
+  inherited Init(Bounds);
+  Options:=Options or (ofSelectable+ofTopSelect);
+  GrowMode:=gfGrowHiX+gfGrowHiY;
+end;
+
 procedure ClearFormatParams;
 procedure ClearFormatParams;
 begin
 begin
   FormatParamCount:=0; FillChar(FormatParams,sizeof(FormatParams),0);
   FormatParamCount:=0; FillChar(FormatParams,sizeof(FormatParams),0);
@@ -2153,7 +2189,10 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.13  2000-05-02 08:42:29  pierre
+  Revision 1.14  2000-06-16 08:50:45  pierre
+   + new bunch of Gabor's changes
+
+  Revision 1.13  2000/05/02 08:42:29  pierre
    * new set of Gabor changes: see fixes.txt
    * new set of Gabor changes: see fixes.txt
 
 
   Revision 1.12  2000/04/18 11:42:39  pierre
   Revision 1.12  2000/04/18 11:42:39  pierre