Browse Source

* browser updates from gabor

peter 26 years ago
parent
commit
4133cbf1d3
9 changed files with 724 additions and 142 deletions
  1. 404 71
      compiler/browcol.pas
  2. 6 1
      ide/text/fpcompil.pas
  3. 10 1
      ide/text/fpconst.pas
  4. 5 1
      ide/text/fphelp.pas
  5. 11 4
      ide/text/fpide.pas
  6. 78 1
      ide/text/fpmopts.inc
  7. 104 56
      ide/text/fpsymbol.pas
  8. 15 5
      ide/text/fpviews.pas
  9. 91 2
      ide/text/test.pas

+ 404 - 71
compiler/browcol.pas

@@ -64,12 +64,15 @@ type
     TSymbol = object(TObject)
     TSymbol = object(TObject)
       Name       : PString;
       Name       : PString;
       Typ        : tsymtyp;
       Typ        : tsymtyp;
-      ParamCount : Sw_integer;
-      Params     : PPointerArray;
+      Params     : PString;
       References : PReferenceCollection;
       References : PReferenceCollection;
       Items      : PSymbolCollection;
       Items      : PSymbolCollection;
-      constructor Init(const AName: string; ATyp: tsymtyp; AParamCount: Sw_integer; AParams: PPointerArray);
-      procedure   SetParams(AParamCount: Sw_integer; AParams: PPointerArray);
+      DType      : PString;
+      VType      : PString;
+      Ancestor   : PString;
+      IsRecord   : boolean;
+      IsClass    : boolean;
+      constructor Init(const AName: string; ATyp: tsymtyp; AParams: string);
       function    GetReferenceCount: Sw_integer;
       function    GetReferenceCount: Sw_integer;
       function    GetReference(Index: Sw_integer): PReference;
       function    GetReference(Index: Sw_integer): PReference;
       function    GetItemCount: Sw_integer;
       function    GetItemCount: Sw_integer;
@@ -113,7 +116,7 @@ implementation
 
 
 uses
 uses
   Drivers,Views,App,
   Drivers,Views,App,
-  globtype,globals,files,comphook;
+  aasm,globtype,globals,files,comphook;
 
 
 {****************************************************************************
 {****************************************************************************
                                    Helpers
                                    Helpers
@@ -127,6 +130,35 @@ begin
     GetStr:=P^;
     GetStr:=P^;
 end;
 end;
 
 
+function IntToStr(L: longint): string;
+var S: string;
+begin
+  Str(L,S);
+  IntToStr:=S;
+end;
+
+function UpcaseStr(S: string): string;
+var I: integer;
+begin
+  for I:=1 to length(S) do
+      S[I]:=Upcase(S[I]);
+  UpcaseStr:=S;
+end;
+
+function FloatToStr(E: extended): string;
+var S: string;
+begin
+  Str(E:0:24,S);
+  if Pos('.',S)>0 then
+    begin
+      while (length(S)>0) and (S[length(S)]='0') do
+        Delete(S,length(S),1);
+      if (length(S)>0) and (S[length(S)]='.') then
+        Delete(S,length(S),1);
+    end;
+  if S='' then S:='0';
+  FloatToStr:=S;
+end;
 
 
 {****************************************************************************
 {****************************************************************************
                                 TStoreCollection
                                 TStoreCollection
@@ -136,6 +168,7 @@ function TStoreCollection.Add(const S: string): PString;
 var P: PString;
 var P: PString;
     Index: Sw_integer;
     Index: Sw_integer;
 begin
 begin
+  if S='' then P:=nil else
   if Search(@S,Index) then P:=At(Index) else
   if Search(@S,Index) then P:=At(Index) else
     begin
     begin
       P:=NewStr(S);
       P:=NewStr(S);
@@ -261,11 +294,10 @@ end;
                                    TSymbol
                                    TSymbol
 ****************************************************************************}
 ****************************************************************************}
 
 
-constructor TSymbol.Init(const AName: string; ATyp: tsymtyp; AParamCount: Sw_integer; AParams: PPointerArray);
+constructor TSymbol.Init(const AName: string; ATyp: tsymtyp; AParams: string);
 begin
 begin
   inherited Init;
   inherited Init;
   Name:=NewStr(AName); Typ:=ATyp;
   Name:=NewStr(AName); Typ:=ATyp;
-  SetParams(AParamCount,AParams);
   New(References, Init(20,50));
   New(References, Init(20,50));
   if ATyp in RecordTypes then
   if ATyp in RecordTypes then
     begin
     begin
@@ -273,18 +305,6 @@ begin
     end;
     end;
 end;
 end;
 
 
-procedure TSymbol.SetParams(AParamCount: Sw_integer; AParams: PPointerArray);
-begin
-  if AParams=nil then AParamCount:=0 else
-  if AParamCount=0 then AParams:=nil;
-  ParamCount:=AParamCount;
-  if (ParamCount>0) and (AParams<>nil) then
-  begin
-    GetMem(Params, ParamCount*4);
-    Move(AParams^,Params^,ParamCount*4);
-  end;
-end;
-
 function TSymbol.GetReferenceCount: Sw_integer;
 function TSymbol.GetReferenceCount: Sw_integer;
 var Count: Sw_integer;
 var Count: Sw_integer;
 begin
 begin
@@ -329,15 +349,27 @@ begin
       S:=S+' ';
       S:=S+' ';
    end;
    end;
   S:=S+' '+GetName;
   S:=S+' '+GetName;
-  if ParamCount>0 then
+  if IsRecord then
+    S:=S+' = record'
+  else
+  if Ancestor<>nil then
     begin
     begin
-      S:=S+'(';
-      for I:=1 to ParamCount do
-        begin
-          S:=S+GetStr(Params^[I-1]);
-          if I<>ParamCount then S:=S+', ';
-        end;
-      S:=S+')';
+      S:=S+' = ';
+      if IsClass then
+        S:=S+'class'
+      else
+        S:=S+'object';
+      if Ancestor^<>'.' then
+        S:=S+'('+Ancestor^+')';
+    end
+  else
+    begin
+      if Assigned(DType) then
+        S:=S+' = '+DType^;
+      if Assigned(Params) then
+        S:=S+'('+Params^+')';
+      if Assigned(VType) then
+        S:=S+': '+VType^;
     end;
     end;
   GetText:=S;
   GetText:=S;
 end;
 end;
@@ -349,7 +381,10 @@ begin
     abstractsym  : S:='abst';
     abstractsym  : S:='abst';
     varsym       : S:='var';
     varsym       : S:='var';
     typesym      : S:='type';
     typesym      : S:='type';
-    procsym      : S:='proc';
+    procsym      : if VType=nil then
+                     S:='proc'
+                   else
+                     S:='func';
     unitsym      : S:='unit';
     unitsym      : S:='unit';
     programsym   : S:='prog';
     programsym   : S:='prog';
     constsym     : S:='const';
     constsym     : S:='const';
@@ -376,8 +411,14 @@ begin
     Dispose(Items, Done);
     Dispose(Items, Done);
   if assigned(Name) then
   if assigned(Name) then
     DisposeStr(Name);
     DisposeStr(Name);
-  if assigned(Params) then
-    FreeMem(Params,ParamCount*4);
+{  if assigned(Params) then
+    DisposeStr(Params);
+  if assigned(VType) then
+    DisposeStr(VType);
+  if assigned(DType) then
+    DisposeStr(DType);
+  if assigned(Ancestor) then
+    DisposeStr(Ancestor);}
 end;
 end;
 
 
 
 
@@ -415,8 +456,8 @@ end;
 
 
 procedure CreateBrowserCol;
 procedure CreateBrowserCol;
 
 
-  procedure ProcessSymTable(var Owner: PSymbolCollection; Table: PSymTable);
-  var I,J,defcount, symcount: longint;
+  procedure ProcessSymTable(OwnerSym: PSymbol; var Owner: PSymbolCollection; Table: PSymTable);
+  var I,J,defcount,symcount: longint;
       Ref: PRef;
       Ref: PRef;
       Sym,ParSym: PSym;
       Sym,ParSym: PSym;
       Symbol: PSymbol;
       Symbol: PSymbol;
@@ -424,6 +465,255 @@ procedure CreateBrowserCol;
       ParamCount: Sw_integer;
       ParamCount: Sw_integer;
       Params: array[0..20] of PString;
       Params: array[0..20] of PString;
       inputfile : pinputfile;
       inputfile : pinputfile;
+      Idx: sw_integer;
+      S: string;
+  procedure SetVType(Symbol: PSymbol; VType: string);
+  begin
+    Symbol^.VType:=TypeNames^.Add(VType);
+  end;
+  procedure SetDType(Symbol: PSymbol; DType: string);
+  begin
+    Symbol^.DType:=TypeNames^.Add(DType);
+  end;
+  function GetDefinitionStr(def: pdef): string; forward;
+  function GetEnumDefStr(def: penumdef): string;
+  var Name: string;
+      esym: penumsym;
+      Count: integer;
+  begin
+    Name:='(';
+    esym:=def^.First; Count:=0;
+    while (esym<>nil) do
+      begin
+        if Count>0 then Name:=Name+', ';
+        Name:=Name+esym^.name;
+        esym:=esym^.next; Inc(Count);
+      end;
+    Name:=Name+')';
+    GetEnumDefStr:=Name;
+  end;
+  function GetArrayDefStr(def: parraydef): string;
+  var Name: string;
+  begin
+    Name:='array ['+IntToStr(def^.lowrange)+'..'+IntToStr(def^.highrange)+'] of ';
+    if assigned(def^.definition) then
+      Name:=Name+GetDefinitionStr(def^.definition);
+    GetArrayDefStr:=Name;
+  end;
+  function GetFileDefStr(def: pfiledef): string;
+  var Name: string;
+  begin
+    Name:='';
+    case def^.filetype of
+      ft_text    : Name:='text';
+      ft_untyped : Name:='file';
+      ft_typed   : Name:='file of '+GetDefinitionStr(def^.typed_as);
+    end;
+    GetFileDefStr:=Name;
+  end;
+  function GetStringDefStr(def: pstringdef): string;
+  var Name: string;
+  begin
+    Name:='';
+    case def^.string_typ of
+      st_shortstring :
+        if def^.len=255 then
+          Name:='shortstring'
+        else
+          Name:='string['+IntToStr(def^.len)+']';
+      st_longstring :
+        Name:='longstring';
+      st_ansistring :
+        Name:='ansistring';
+      st_widestring :
+        Name:='widestring';
+    else ;
+    end;
+    GetStringDefStr:=Name;
+  end;
+  function retdefassigned(def: pabstractprocdef): boolean;
+  var OK: boolean;
+  begin
+    OK:=false;
+    if assigned(def^.retdef) then
+      if UpcaseStr(GetDefinitionStr(def^.retdef))<>'VOID' then
+        OK:=true;
+    retdefassigned:=OK;
+  end;
+  function GetAbsProcParmDefStr(def: pabstractprocdef): string;
+  var Name: string;
+      dc: pdefcoll;
+      Count: integer;
+      CurName: string;
+  begin
+    Name:='';
+    dc:=def^.para1; Count:=0;
+    while dc<>nil do
+     begin
+       CurName:='';
+       case dc^.paratyp of
+         vs_Value : ;
+         vs_Const : CurName:=CurName+'const ';
+         vs_Var   : CurName:=CurName+'var ';
+       end;
+       if assigned(dc^.data) then
+         CurName:=CurName+GetDefinitionStr(dc^.data);
+       if dc^.next<>nil then
+         CurName:=', '+CurName;
+       Name:=CurName+Name;
+       dc:=dc^.next; Inc(Count);
+     end;
+    GetAbsProcParmDefStr:=Name;
+  end;
+  function GetAbsProcDefStr(def: pabstractprocdef): string;
+  var Name: string;
+  begin
+    Name:=GetAbsProcParmDefStr(def);
+    if Name<>'' then Name:='('+Name+')';
+    if retdefassigned(def) then
+      Name:='function'+Name+': '+GetDefinitionStr(def^.retdef)
+    else
+      Name:='procedure'+Name;
+    GetAbsProcDefStr:=Name;
+  end;
+  function GetProcDefStr(def: pprocdef): string;
+  var DName: string;
+      J: integer;
+  begin
+{    DName:='';
+    if assigned(def) then
+    begin
+      if assigned(def^.parast) then
+        begin
+          with def^.parast^ do
+          for J:=1 to number_symbols do
+            begin
+              if J<>1 then DName:=DName+', ';
+              ParSym:=GetsymNr(J);
+              if ParSym=nil then Break;
+              DName:=DName+ParSym^.Name;
+            end;
+        end
+    end;}
+    DName:=GetAbsProcDefStr(def);
+    GetProcDefStr:=DName;
+  end;
+  function GetProcVarDefStr(def: pprocvardef): string;
+  begin
+    GetProcVarDefStr:=GetAbsProcDefStr(def);
+  end;
+  function GetSetDefStr(def: psetdef): string;
+  var Name: string;
+  begin
+    Name:='';
+    case def^.settype of
+      normset  : Name:='set';
+      smallset : Name:='set';
+      varset   : Name:='varset';
+    end;
+    Name:=Name+' of ';
+    Name:=Name+GetDefinitionStr(def^.setof);
+    GetSetDefStr:=Name;
+  end;
+  function GetDefinitionStr(def: pdef): string;
+  var Name: string;
+      sym: psym;
+  begin
+    Name:='';
+    if def<>nil then
+    begin
+      if assigned(def^.sym) then
+        Name:=def^.sym^.name;
+      if Name='' then
+      case def^.deftype of
+        arraydef :
+          Name:=GetArrayDefStr(parraydef(def));
+        stringdef :
+          Name:=GetStringDefStr(pstringdef(def));
+        enumdef :
+          Name:=GetEnumDefStr(penumdef(def));
+        procdef :
+          Name:=GetProcDefStr(pprocdef(def));
+        procvardef :
+          Name:=GetProcVarDefStr(pprocvardef(def));
+        filedef :
+          Name:=GetFileDefStr(pfiledef(def));
+        setdef :
+          Name:=GetSetDefStr(psetdef(def));
+      end;
+    end;
+    GetDefinitionStr:=Name;
+  end;
+  function GetEnumItemName(Sym: penumsym): string;
+  var Name: string;
+      ES: penumsym;
+  begin
+    Name:='';
+    if assigned(sym) and assigned(sym^.definition) then
+      if assigned(sym^.definition^.sym) then
+      begin
+{        ES:=sym^.definition^.First;
+        while (ES<>nil) and (ES^.Value<>sym^.Value) do
+          ES:=ES^.next;
+        if assigned(es) and (es^.value=sym^.value) then
+          Name:=}
+        Name:=sym^.definition^.sym^.name;
+        if Name<>'' then
+          Name:=Name+'('+IntToStr(sym^.value)+')';
+      end;
+    GetEnumItemName:=Name;
+  end;
+  function GetConstValueName(sym: pconstsym): string;
+  var Name: string;
+  begin
+    Name:='';
+{    if assigned(sym^.definition) then
+     if assigned(sym^.definition^.sym) then
+       Name:=sym^.definition^.sym^.name;}
+    if Name='' then
+    case sym^.consttype of
+      constord :
+        Name:=sym^.definition^.sym^.name+'('+IntToStr(sym^.value)+')';
+      conststring :
+        Name:=''''+GetStr(PString(sym^.Value))+'''';
+      constreal:
+        Name:=FloatToStr(PBestReal(sym^.Value)^);
+      constbool:
+{        if boolean(sym^.Value)=true then
+          Name:='TRUE'
+        else
+          Name:='FALSE';}
+        Name:='Longbool('+IntToStr(sym^.Value)+')';
+      constint:
+        Name:=IntToStr(sym^.value);
+      constchar:
+        Name:=''''+chr(sym^.Value)+'''';
+      constset:
+{        Name:=SetToStr(pnormalset(sym^.Value))};
+      constnil: ;
+    end;
+    GetConstValueName:=Name;
+  end;
+  procedure ProcessDefIfStruct(definition: pdef);
+  begin
+    if assigned(definition) then
+    begin
+      case definition^.deftype of
+        recorddef :
+          if precdef(definition)^.symtable<>Table then
+            ProcessSymTable(Symbol,Symbol^.Items,precdef(definition)^.symtable);
+        objectdef :
+          if precdef(definition)^.symtable<>Table then
+            ProcessSymTable(Symbol,Symbol^.Items,pobjectdef(definition)^.publicsyms);
+        pointerdef :
+          with ppointerdef(definition)^ do
+            if assigned(definition) then
+              if assigned(definition^.sym) then
+                ProcessDefIfStruct(definition^.sym^.definition);
+      end;
+    end;
+  end;
+
   begin
   begin
     if not Assigned(Table) then
     if not Assigned(Table) then
      Exit;
      Exit;
@@ -440,47 +730,98 @@ procedure CreateBrowserCol;
         Sym:=Table^.GetsymNr(I);
         Sym:=Table^.GetsymNr(I);
         if Sym=nil then Continue;
         if Sym=nil then Continue;
         ParamCount:=0;
         ParamCount:=0;
-        New(Symbol, Init(Sym^.Name,Sym^.Typ,0,nil));
+        New(Symbol, Init(Sym^.Name,Sym^.Typ,''));
         case Sym^.Typ of
         case Sym^.Typ of
+          varsym :
+             with pvarsym(sym)^ do
+             begin
+               if assigned(definition) then
+                 if assigned(definition^.sym) then
+                   SetVType(Symbol,definition^.sym^.name)
+                 else
+                   SetVType(Symbol,GetDefinitionStr(definition));
+               ProcessDefIfStruct(definition);
+             end;
+          constsym :
+             SetDType(Symbol,GetConstValueName(pconstsym(sym)));
+          enumsym :
+            if assigned(penumsym(sym)^.definition) then
+             SetDType(Symbol,GetEnumItemName(penumsym(sym)));
           unitsym :
           unitsym :
             begin
             begin
   {            ProcessSymTable(Symbol^.Items,punitsym(sym)^.unitsymtable);}
   {            ProcessSymTable(Symbol^.Items,punitsym(sym)^.unitsymtable);}
             end;
             end;
+          syssym :
+{            if assigned(Table^.Name) then
+            if Table^.Name^='SYSTEM' then}
+              begin
+                Symbol^.Params:=TypeNames^.Add('...');
+              end;
+          funcretsym :
+            if Assigned(OwnerSym) then
+            with pfuncretsym(sym)^ do
+              if assigned(funcretdef) then
+                if assigned(funcretdef^.sym) then
+                   SetVType(OwnerSym,funcretdef^.sym^.name);
           procsym :
           procsym :
-            with pprocsym(sym)^ do
-            if assigned(definition) then
             begin
             begin
-              if assigned(definition^.parast) then
-                begin
-                  with definition^.parast^ do
-                  for J:=1 to number_symbols do
-                    begin
-                      ParSym:=GetsymNr(J);
-                      if ParSym=nil then Break;
-                      Inc(ParamCount);
-                      Params[ParamCount-1]:=TypeNames^.Add(ParSym^.Name);
-                    end;
-                  Symbol^.SetParams(ParamCount,PPointerArray(@Params));
-                  ProcessSymTable(Symbol^.Items,definition^.parast);
-                end;
-              if assigned(definition^.localst) and
-                 (definition^.localst^.symtabletype<>staticsymtable) then
-                ProcessSymTable(Symbol^.Items,definition^.localst);
+              with pprocsym(sym)^ do
+              if assigned(definition) then
+              begin
+                ProcessSymTable(Symbol,Symbol^.Items,definition^.parast);
+                if assigned(definition^.parast) then
+                  begin
+                    Symbol^.Params:=TypeNames^.Add(GetAbsProcParmDefStr(definition));
+                  end
+                else { param-definition is NOT assigned }
+                  if assigned(Table^.Name) then
+                  if Table^.Name^='SYSTEM' then
+                  begin
+                    Symbol^.Params:=TypeNames^.Add('...');
+                  end;
+                if assigned(definition^.localst) and
+                   (definition^.localst^.symtabletype<>staticsymtable) then
+                  ProcessSymTable(Symbol,Symbol^.Items,definition^.localst);
+              end;
             end;
             end;
           typesym :
           typesym :
             begin
             begin
             with ptypesym(sym)^ do
             with ptypesym(sym)^ do
               if assigned(definition) then
               if assigned(definition) then
                 case definition^.deftype of
                 case definition^.deftype of
+                  arraydef :
+                    SetDType(Symbol,GetArrayDefStr(parraydef(definition)));
+                  enumdef :
+                    SetDType(Symbol,GetEnumDefStr(penumdef(definition)));
+                  procdef :
+                    SetDType(Symbol,GetProcDefStr(pprocdef(definition)));
+                  procvardef :
+                    SetDType(Symbol,GetProcVarDefStr(pprocvardef(definition)));
                   objectdef :
                   objectdef :
-                    ProcessSymTable(Symbol^.Items,pobjectdef(definition)^.publicsyms);
+                    with pobjectdef(definition)^ do
+                    begin
+                      if childof=nil then
+                        S:='.'
+                      else
+                        S:=childof^.name^;
+                      Symbol^.Ancestor:=TypeNames^.Add(S);
+                      Symbol^.IsClass:=(options and oo_is_class)<>0;
+                      ProcessSymTable(Symbol,Symbol^.Items,pobjectdef(definition)^.publicsyms);
+                    end;
                   recorddef :
                   recorddef :
-                    ProcessSymTable(Symbol^.Items,precdef(definition)^.symtable);
+                    begin
+                      Symbol^.IsRecord:=true;
+                      ProcessSymTable(Symbol,Symbol^.Items,precdef(definition)^.symtable);
+                    end;
+                  filedef :
+                    SetDType(Symbol,GetFileDefStr(pfiledef(definition)));
+                  setdef :
+                    SetDType(Symbol,GetSetDefStr(psetdef(definition)));
                 end;
                 end;
             end;
             end;
         end;
         end;
         Ref:=Sym^.defref;
         Ref:=Sym^.defref;
-        while assigned(Ref) do
+        while Assigned(Symbol) and assigned(Ref) do
           begin
           begin
             inputfile:=get_source_file(ref^.moduleindex,ref^.posinfo.fileindex);
             inputfile:=get_source_file(ref^.moduleindex,ref^.posinfo.fileindex);
             if Assigned(inputfile) and Assigned(inputfile^.name) then
             if Assigned(inputfile) and Assigned(inputfile^.name) then
@@ -491,6 +832,7 @@ procedure CreateBrowserCol;
               end;
               end;
             Ref:=Ref^.nextref;
             Ref:=Ref^.nextref;
           end;
           end;
+        if Assigned(Symbol) then
         Owner^.Insert(Symbol);
         Owner^.Insert(Symbol);
       end;
       end;
   end;
   end;
@@ -502,37 +844,25 @@ var
 begin
 begin
   DisposeBrowserCol;
   DisposeBrowserCol;
   NewBrowserCol;
   NewBrowserCol;
-{  T:=SymTableStack;
-  while assigned(T) do
-   begin
-     New(UnitS, Init(T^.Name^,unitsym, 0, nil));
-     Modules^.Insert(UnitS);
-     ProcessSymTable(UnitS^.Items,T);
-     T:=T^.Next;
-   end;}
   hp:=pmodule(loaded_units.first);
   hp:=pmodule(loaded_units.first);
   while assigned(hp) do
   while assigned(hp) do
     begin
     begin
        t:=psymtable(hp^.globalsymtable);
        t:=psymtable(hp^.globalsymtable);
        if assigned(t) then
        if assigned(t) then
          begin
          begin
-           New(UnitS, Init(T^.Name^,unitsym, 0, nil));
+           New(UnitS, Init(T^.Name^,unitsym,''));
            Modules^.Insert(UnitS);
            Modules^.Insert(UnitS);
-           ProcessSymTable(UnitS^.Items,T);
+           ProcessSymTable(UnitS,UnitS^.Items,T);
            if cs_local_browser in aktmoduleswitches then
            if cs_local_browser in aktmoduleswitches then
              begin
              begin
                 t:=psymtable(hp^.localsymtable);
                 t:=psymtable(hp^.localsymtable);
                 if assigned(t) then
                 if assigned(t) then
-                  begin
-                    {New(UnitS, Init(T^.Name^,unitsym, 0, nil));
-                    Modules^.Insert(UnitS);}
-                    ProcessSymTable(UnitS^.Items,T);
-                  end;
+                  ProcessSymTable(UnitS,UnitS^.Items,T);
              end;
              end;
          end;
          end;
        hp:=pmodule(hp^.next);
        hp:=pmodule(hp^.next);
     end;
     end;
-   
+
 end;
 end;
 
 
 
 
@@ -569,7 +899,10 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.6  1999-02-04 09:31:59  pierre
+  Revision 1.7  1999-02-22 11:51:32  peter
+    * browser updates from gabor
+
+  Revision 1.6  1999/02/04 09:31:59  pierre
    + added objects and records symbol tables
    + added objects and records symbol tables
 
 
   Revision 1.5  1999/02/03 09:44:32  pierre
   Revision 1.5  1999/02/03 09:44:32  pierre

+ 6 - 1
ide/text/fpcompil.pas

@@ -214,6 +214,8 @@ begin
   if WasVisible=false then
   if WasVisible=false then
     ProgramInfoWindow^.Show;
     ProgramInfoWindow^.Show;
   ProgramInfoWindow^.MakeFirst;}
   ProgramInfoWindow^.MakeFirst;}
+  if Assigned(ProgramInfoWindow) then
+    ProgramInfoWindow^.ClearMessages;
 
 
   CompilationPhase:=cpCompiling;
   CompilationPhase:=cpCompiling;
   New(SD, Init);
   New(SD, Init);
@@ -272,7 +274,10 @@ end;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.12  1999-02-22 11:29:36  pierre
+  Revision 1.13  1999-02-22 11:51:33  peter
+    * browser updates from gabor
+
+  Revision 1.12  1999/02/22 11:29:36  pierre
     + added col info in MessageItem
     + added col info in MessageItem
     + grep uses HighLightExts and should work for linux
     + grep uses HighLightExts and should work for linux
 
 

+ 10 - 1
ide/text/fpconst.pas

@@ -120,6 +120,7 @@ const
      cmSaveINI           = 2012;
      cmSaveINI           = 2012;
      cmSaveAsINI         = 2013;
      cmSaveAsINI         = 2013;
      cmSwitchesMode      = 2014;
      cmSwitchesMode      = 2014;
+     cmBrowser           = 2015;
 
 
      cmHelpContents      = 2100;
      cmHelpContents      = 2100;
      cmHelpIndex         = 2101;
      cmHelpIndex         = 2101;
@@ -131,6 +132,10 @@ const
      cmOpenAtCursor      = 2200;
      cmOpenAtCursor      = 2200;
      cmBrowseAtCursor    = 2201;
      cmBrowseAtCursor    = 2201;
      cmEditorOptions     = 2202;
      cmEditorOptions     = 2202;
+     cmBrowserOptions    = 2203;
+
+     cmTrackReference    = 2300;
+     cmGotoReference     = 2301;
 
 
      { Help constants }
      { Help constants }
      hcSourceWindow      = 8000;
      hcSourceWindow      = 8000;
@@ -175,6 +180,7 @@ const
      hcCalculator        = hcShift+cmCalculator;
      hcCalculator        = hcShift+cmCalculator;
      hcAsciiTable        = hcShift+cmAsciiTable;
      hcAsciiTable        = hcShift+cmAsciiTable;
      hcGrep              = hcShift+cmGrep;
      hcGrep              = hcShift+cmGrep;
+     hcBrowser           = hcShift+cmBrowser;
      hcSwitchesMode      = hcShift+cmSwitchesMode;
      hcSwitchesMode      = hcShift+cmSwitchesMode;
      hcAbout             = hcShift+cmAbout;
      hcAbout             = hcShift+cmAbout;
 
 
@@ -275,7 +281,10 @@ implementation
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.11  1999-02-20 15:18:28  peter
+  Revision 1.12  1999-02-22 11:51:34  peter
+    * browser updates from gabor
+
+  Revision 1.11  1999/02/20 15:18:28  peter
     + ctrl-c capture with confirm dialog
     + ctrl-c capture with confirm dialog
     + ascii table in the tools menu
     + ascii table in the tools menu
     + heapviewer
     + heapviewer

+ 5 - 1
ide/text/fphelp.pas

@@ -159,6 +159,7 @@ begin
     hcLinker        : S:='Set linker options';
     hcLinker        : S:='Set linker options';
     hcDebugger      : S:='Set debug information options';
     hcDebugger      : S:='Set debug information options';
     hcDirectories   : S:='Set paths for units, include, object and generated files';
     hcDirectories   : S:='Set paths for units, include, object and generated files';
+    hcBrowser       : S:='Specify global browser settings';
     hcTools         : S:='Create or change tools';
     hcTools         : S:='Create or change tools';
 
 
     hcEnvironmentMenu:S:='Specify environment settins';
     hcEnvironmentMenu:S:='Specify environment settins';
@@ -370,7 +371,10 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.9  1999-02-19 18:43:45  peter
+  Revision 1.10  1999-02-22 11:51:35  peter
+    * browser updates from gabor
+
+  Revision 1.9  1999/02/19 18:43:45  peter
     + open dialog supports mask list
     + open dialog supports mask list
 
 
   Revision 1.8  1999/02/11 19:07:21  pierre
   Revision 1.8  1999/02/11 19:07:21  pierre

+ 11 - 4
ide/text/fpide.pas

@@ -20,7 +20,7 @@ uses
   Drivers,Views,App,Gadgets,
   Drivers,Views,App,Gadgets,
   {$ifdef EDITORS}Editors,{$else}WEditor,{$endif}
   {$ifdef EDITORS}Editors,{$else}WEditor,{$endif}
   Comphook,
   Comphook,
-  FPViews;
+  FPViews,FPSymbol;
 
 
 type
 type
     TIDEApp = object(TApplication)
     TIDEApp = object(TApplication)
@@ -74,6 +74,7 @@ type
       procedure Tools;
       procedure Tools;
       procedure Grep;
       procedure Grep;
       procedure EditorOptions(Editor: PEditor);
       procedure EditorOptions(Editor: PEditor);
+      procedure BrowserOptions(Browser: PBrowserWindow);
       procedure Mouse;
       procedure Mouse;
       procedure Colors;
       procedure Colors;
       procedure OpenINI;
       procedure OpenINI;
@@ -119,7 +120,7 @@ uses
   Systems,BrowCol,Version,
   Systems,BrowCol,Version,
   WHelp,WHlpView,WINI,
   WHelp,WHlpView,WINI,
   FPConst,FPVars,FPUtils,FPSwitch,FPIni,FPIntf,FPCompile,FPHelp,
   FPConst,FPVars,FPUtils,FPSwitch,FPIni,FPIntf,FPCompile,FPHelp,
-  FPTemplt,FPCalc,FPUsrScr,FPSymbol,FPTools,FPDebug,FPRedir;
+  FPTemplt,FPCalc,FPUsrScr,FPTools,FPDebug,FPRedir;
 
 
 
 
 function IDEUseSyntaxHighlight(Editor: PFileEditor): boolean; {$ifndef FPC}far;{$endif}
 function IDEUseSyntaxHighlight(Editor: PFileEditor): boolean; {$ifndef FPC}far;{$endif}
@@ -243,6 +244,7 @@ begin
       NewItem('~L~inker...','', kbNoKey, cmLinker, hcLinker,
       NewItem('~L~inker...','', kbNoKey, cmLinker, hcLinker,
       NewItem('De~b~ugger...','', kbNoKey, cmDebugger, hcDebugger,
       NewItem('De~b~ugger...','', kbNoKey, cmDebugger, hcDebugger,
       NewItem('~D~irectories...','', kbNoKey, cmDirectories, hcDirectories,
       NewItem('~D~irectories...','', kbNoKey, cmDirectories, hcDirectories,
+      NewItem('Bro~w~ser...','',kbNoKey, cmBrowser, hcBrowser,
       NewItem('~T~ools...','', kbNoKey, cmTools, hcTools,
       NewItem('~T~ools...','', kbNoKey, cmTools, hcTools,
       NewLine(
       NewLine(
       NewSubMenu('~E~nvironment', hcEnvironmentMenu, NewMenu(
       NewSubMenu('~E~nvironment', hcEnvironmentMenu, NewMenu(
@@ -256,7 +258,7 @@ begin
       NewItem('~O~pen...','', kbNoKey, cmOpenINI, hcOpenINI,
       NewItem('~O~pen...','', kbNoKey, cmOpenINI, hcOpenINI,
       NewItem('~S~ave','', kbNoKey, cmSaveINI, hcSaveINI,
       NewItem('~S~ave','', kbNoKey, cmSaveINI, hcSaveINI,
       NewItem('Save ~a~s...','', kbNoKey, cmSaveAsINI, hcSaveAsINI,
       NewItem('Save ~a~s...','', kbNoKey, cmSaveAsINI, hcSaveAsINI,
-      nil)))))))))))))),
+      nil))))))))))))))),
     NewSubMenu('~W~indow', hcWindowMenu, NewMenu(
     NewSubMenu('~W~indow', hcWindowMenu, NewMenu(
       NewItem('~T~ile','', kbNoKey, cmTile, hcTile,
       NewItem('~T~ile','', kbNoKey, cmTile, hcTile,
       NewItem('C~a~scade','', kbNoKey, cmCascade, hcCascade,
       NewItem('C~a~scade','', kbNoKey, cmCascade, hcCascade,
@@ -388,6 +390,8 @@ begin
              cmTools         : Tools;
              cmTools         : Tools;
              cmEditor        : EditorOptions(nil);
              cmEditor        : EditorOptions(nil);
              cmEditorOptions : EditorOptions(Event.InfoPtr);
              cmEditorOptions : EditorOptions(Event.InfoPtr);
+             cmBrowser       : BrowserOptions(nil);
+             cmBrowserOptions : BrowserOptions(Event.InfoPtr);
              cmMouse         : Mouse;
              cmMouse         : Mouse;
              cmColors        : Colors;
              cmColors        : Colors;
              cmOpenINI       : OpenINI;
              cmOpenINI       : OpenINI;
@@ -682,7 +686,10 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.18  1999-02-22 02:15:13  peter
+  Revision 1.19  1999-02-22 11:51:36  peter
+    * browser updates from gabor
+
+  Revision 1.18  1999/02/22 02:15:13  peter
     + default extension for save in the editor
     + default extension for save in the editor
     + Separate Text to Find for the grep dialog
     + Separate Text to Find for the grep dialog
     * fixed redir crash with tp7
     * fixed redir crash with tp7

+ 78 - 1
ide/text/fpmopts.inc

@@ -537,6 +537,80 @@ begin
   Dispose(D, Done);
   Dispose(D, Done);
 end;
 end;
 
 
+procedure TIDEApp.BrowserOptions(Browser: PBrowserWindow);
+var D: PCenterDialog;
+    R,R2,R3 : TRect;
+    PreS: string[15];
+    CB1,CB2: PCheckBoxes;
+    RB1,RB2: PRadioButtons;
+begin
+  if Browser=nil then
+    begin
+      PreS:='';
+    end
+  else
+    begin
+      PreS:='Local ';
+    end;
+  R.Assign(0,0,56,15);
+  New(D, Init(R, PreS+'Browser Options'));
+  with D^ do
+  begin
+    GetExtent(R); R.Grow(-2,-2);
+    R.B.Y:=R.A.Y+1+3; R2.Copy(R); Inc(R2.A.Y);
+    New(CB1, Init(R2,
+      NewSItem(RExpand('~L~abels',21+2),
+      NewSItem('~C~onstants',
+      NewSItem('~T~ypes',
+      NewSItem('~V~ariables',
+      NewSItem('~P~rocedures',
+      NewSItem('~I~nherited',
+      nil)))))))
+    );
+    Insert(CB1);
+    R2.Move(0,-1); R2.B.Y:=R2.A.Y+1;
+    Insert(New(PLabel, Init(R2, 'Symbols', CB1)));
+
+    R.Move(0,R.B.Y-R.A.Y+1);
+    R.B.Y:=R.A.Y+1+2; R2.Copy(R);
+    R3.Copy(R2); R3.B.X:=R3.A.X+(R3.B.X-R3.A.X) div 2-1; Inc(R3.A.Y);
+    New(RB1, Init(R3,
+      NewSItem('~N~ew browser',
+      NewSItem('~R~eplace current',
+      nil)))
+    );
+    Insert(RB1);
+    R3.Move(0,-1); R3.B.Y:=R3.A.Y+1;
+    Insert(New(PLabel, Init(R3, 'Sub-browsing', RB1)));
+    R3.Copy(R2); R3.A.X:=R3.B.X-(R3.B.X-R3.A.X) div 2+1; Inc(R3.A.Y);
+    New(RB2, Init(R3,
+      NewSItem('~S~cope',
+      NewSItem('R~e~ference',
+      nil)))
+    );
+    Insert(RB2);
+    R3.Move(0,-1); R3.B.Y:=R3.A.Y+1;
+    Insert(New(PLabel, Init(R3, 'Preferred pane', RB2)));
+
+    R.Move(0,R.B.Y-R.A.Y+1);
+    R.B.Y:=R.A.Y+1+1; R2.Copy(R); Inc(R2.A.Y);
+    New(CB2, Init(R2,
+      NewSItem(RExpand('~Q~ualified symbols',21+2),
+      NewSItem('S~o~rt always',
+      nil)))
+    );
+    Insert(CB2);
+    R2.Move(0,-1); R2.B.Y:=R2.A.Y+1;
+    Insert(New(PLabel, Init(R2, 'Display', CB2)));
+  end;
+  InsertButtons(D);
+  CB1^.Select;
+  if Desktop^.ExecView(D)=cmOK then
+  begin
+  end;
+  Dispose(D, Done);
+end;
+
 procedure TIDEApp.Mouse;
 procedure TIDEApp.Mouse;
 var R,R2: TRect;
 var R,R2: TRect;
     D: PCenterDialog;
     D: PCenterDialog;
@@ -722,7 +796,10 @@ end;
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.16  1999-02-18 13:44:32  peter
+  Revision 1.17  1999-02-22 11:51:37  peter
+    * browser updates from gabor
+
+  Revision 1.16  1999/02/18 13:44:32  peter
     * search fixed
     * search fixed
     + backward search
     + backward search
     * help fixes
     * help fixes

+ 104 - 56
ide/text/fpsymbol.pas

@@ -34,7 +34,11 @@ type
       constructor  Init(var Bounds: TRect; AHScrollBar, AVScrollBar: PScrollBar);
       constructor  Init(var Bounds: TRect; AHScrollBar, AVScrollBar: PScrollBar);
       procedure    HandleEvent(var Event: TEvent); virtual;
       procedure    HandleEvent(var Event: TEvent); virtual;
       procedure    GotoItem(Item: sw_integer); virtual;
       procedure    GotoItem(Item: sw_integer); virtual;
+      procedure    TrackItem(Item: sw_integer); virtual;
       function     GetPalette: PPalette; virtual;
       function     GetPalette: PPalette; virtual;
+    private
+      function     TrackReference(R: PReference): boolean; virtual;
+      function     GotoReference(R: PReference): boolean; virtual;
     end;
     end;
 
 
     PSymbolScopeView = ^TSymbolScopeView;
     PSymbolScopeView = ^TSymbolScopeView;
@@ -44,6 +48,8 @@ type
       procedure   HandleEvent(var Event: TEvent); virtual;
       procedure   HandleEvent(var Event: TEvent); virtual;
       procedure   Draw; virtual;
       procedure   Draw; virtual;
       procedure   LookUp(S: string); virtual;
       procedure   LookUp(S: string); virtual;
+      procedure   GotoItem(Item: sw_integer); virtual;
+      procedure   TrackItem(Item: sw_integer); virtual;
     private
     private
       Symbols: PSymbolCollection;
       Symbols: PSymbolCollection;
       LookupStr: string;
       LookupStr: string;
@@ -56,8 +62,7 @@ type
       function    GetText(Item,MaxLen: Sw_Integer): String; virtual;
       function    GetText(Item,MaxLen: Sw_Integer): String; virtual;
       procedure   SelectItem(Item: Sw_Integer); virtual;
       procedure   SelectItem(Item: Sw_Integer); virtual;
       procedure   GotoItem(Item: sw_integer); virtual;
       procedure   GotoItem(Item: sw_integer); virtual;
-      procedure   GotoSource; virtual;
-      procedure   TrackSource; virtual;
+      procedure   TrackItem(Item: sw_integer); virtual;
     private
     private
       References: PReferenceCollection;
       References: PReferenceCollection;
     end;
     end;
@@ -307,6 +312,8 @@ begin
         case Event.KeyCode of
         case Event.KeyCode of
           kbEnter :
           kbEnter :
             GotoItem(Focused);
             GotoItem(Focused);
+          kbSpaceBar :
+            TrackItem(Focused);
           kbRight,kbLeft :
           kbRight,kbLeft :
             if HScrollBar<>nil then
             if HScrollBar<>nil then
               HScrollBar^.HandleEvent(Event);
               HScrollBar^.HandleEvent(Event);
@@ -328,12 +335,64 @@ begin
   GetPalette:=@P;
   GetPalette:=@P;
 end;
 end;
 
 
-
 procedure TSymbolView.GotoItem(Item: sw_integer);
 procedure TSymbolView.GotoItem(Item: sw_integer);
 begin
 begin
   SelectItem(Item);
   SelectItem(Item);
 end;
 end;
 
 
+procedure TSymbolView.TrackItem(Item: sw_integer);
+begin
+  SelectItem(Item);
+end;
+
+function LastBrowserWindow: PBrowserWindow;
+var BW: PBrowserWindow;
+procedure IsBW(P: PView); {$ifndef FPC}far;{$endif}
+begin
+  if (P^.HelpCtx=hcBrowserWindow) then
+    BW:=pointer(P);
+end;
+begin
+  BW:=nil;
+  Desktop^.ForEach(@IsBW);
+  LastBrowserWindow:=BW;
+end;
+
+function TSymbolView.TrackReference(R: PReference): boolean;
+var W: PSourceWindow;
+    BW: PBrowserWindow;
+    P: TPoint;
+begin
+  Message(Desktop,evBroadcast,cmClearLineHighlights,nil);
+  Desktop^.Lock;
+  P.X:=R^.Position.X-1; P.Y:=R^.Position.Y-1;
+  W:=TryToOpenFile(nil,R^.GetFileName,P.X,P.Y);
+  if W<>nil then
+  begin
+    BW:=LastBrowserWindow;
+    if BW=nil then
+      W^.Select
+    else
+      begin
+        Desktop^.Delete(W);
+        Desktop^.InsertBefore(W,BW^.NextView);
+      end;
+    W^.Editor^.SetHighlightRow(P.Y);
+  end;
+  Desktop^.UnLock;
+  TrackReference:=W<>nil;
+end;
+
+function TSymbolView.GotoReference(R: PReference): boolean;
+var W: PSourceWindow;
+begin
+  Desktop^.Lock;
+  W:=TryToOpenFile(nil,R^.GetFileName,R^.Position.X-1,R^.Position.Y-1);
+  if W<>nil then W^.Select;
+  Desktop^.UnLock;
+  GotoReference:=W<>nil;
+end;
+
 {****************************************************************************
 {****************************************************************************
                                TSymbolScopeView
                                TSymbolScopeView
 ****************************************************************************}
 ****************************************************************************}
@@ -358,7 +417,7 @@ begin
             ClearEvent(Event);
             ClearEvent(Event);
           end;
           end;
       else
       else
-        if Event.CharCode in[#32..#255] then
+        if Event.CharCode in[#33..#255] then
           begin
           begin
             LookUp(LookUpStr+Event.CharCode);
             LookUp(LookUpStr+Event.CharCode);
             ClearEvent(Event);
             ClearEvent(Event);
@@ -396,6 +455,20 @@ begin
   DrawView;
   DrawView;
 end;
 end;
 
 
+procedure TSymbolScopeView.GotoItem(Item: sw_integer);
+begin
+  SelectItem(Item);
+end;
+
+procedure TSymbolScopeView.TrackItem(Item: sw_integer);
+var S: PSymbol;
+begin
+  if Range=0 then Exit;
+  S:=List^.At(Focused);
+  if (S^.References<>nil) and (S^.References^.Count>0) then
+    TrackReference(S^.References^.At(0));
+end;
+
 function TSymbolScopeView.GetText(Item,MaxLen: Sw_Integer): String;
 function TSymbolScopeView.GetText(Item,MaxLen: Sw_Integer): String;
 var S: string;
 var S: string;
 begin
 begin
@@ -435,66 +508,21 @@ begin
   GetText:=copy(S,1,MaxLen);
   GetText:=copy(S,1,MaxLen);
 end;
 end;
 
 
-procedure TSymbolReferenceView.GotoSource;
-var R: PReference;
-    W: PSourceWindow;
+procedure TSymbolReferenceView.GotoItem(Item: sw_integer);
 begin
 begin
   if Range=0 then Exit;
   if Range=0 then Exit;
-  R:=References^.At(Focused);
-  Desktop^.Lock;
-  W:=TryToOpenFile(nil,R^.GetFileName,R^.Position.X-1,R^.Position.Y-1);
-  if W<>nil then W^.Select;
-  Desktop^.UnLock;
-end;
-
-function LastBrowserWindow: PBrowserWindow;
-var BW: PBrowserWindow;
-procedure IsBW(P: PView); {$ifndef FPC}far;{$endif}
-begin
-  if (P^.HelpCtx=hcBrowserWindow) then
-    BW:=pointer(P);
-end;
-begin
-  BW:=nil;
-  Desktop^.ForEach(@IsBW);
-  LastBrowserWindow:=BW;
+  GotoReference(List^.At(Item));
 end;
 end;
 
 
-procedure TSymbolReferenceView.TrackSource;
-var R: PReference;
-    W: PSourceWindow;
-    BW: PBrowserWindow;
-    P: TPoint;
+procedure TSymbolReferenceView.TrackItem(Item: sw_integer);
 begin
 begin
-  Message(Desktop,evBroadcast,cmClearLineHighlights,nil);
   if Range=0 then Exit;
   if Range=0 then Exit;
-  R:=References^.At(Focused);
-  Desktop^.Lock;
-  P.X:=R^.Position.X-1; P.Y:=R^.Position.Y-1;
-  W:=TryToOpenFile(nil,R^.GetFileName,P.X,P.Y);
-  if W<>nil then
-  begin
-    BW:=LastBrowserWindow;
-    if BW=nil then
-      W^.Select
-    else
-      begin
-        Desktop^.Delete(W);
-        Desktop^.InsertBefore(W,BW^.NextView);
-      end;
-    W^.Editor^.SetHighlightRow(P.Y);
-  end;
-  Desktop^.UnLock;
-end;
-
-procedure TSymbolReferenceView.GotoItem(Item: sw_integer);
-begin
-  GotoSource;
+  TrackReference(List^.At(Item));
 end;
 end;
 
 
 procedure TSymbolReferenceView.SelectItem(Item: Sw_Integer);
 procedure TSymbolReferenceView.SelectItem(Item: Sw_Integer);
 begin
 begin
-  TrackSource;
+  GotoItem(Item);
 end;
 end;
 
 
 
 
@@ -729,6 +757,26 @@ begin
                 S^.Items,S^.References);
                 S^.Items,S^.References);
             end;
             end;
       end;
       end;
+{    evCommand :
+      begin
+        DontClear:=false;
+        case Event.Command of
+        cmGotoSymbol :
+          if Event.InfoPtr=ScopeView then
+           if ReferenceView<>nil then
+            if ReferenceView^.Range>0 then
+              ReferenceView^.GotoItem(0);
+        cmTrackSymbol :
+          if Event.InfoPtr=ScopeView then
+            if (ScopeView<>nil) and (ScopeView^.Range>0) then
+              begin
+                S:=ScopeView^.At(ScopeView^.Focused);
+                if (S^.References<>nil) and (S^.References^.Count>0) then
+                  TrackItem(S^.References^.At(0));
+        else DontClear:=true;
+        end;
+        if DontClear=false then ClearEvent(Event);
+      end;}
     evKeyDown :
     evKeyDown :
       begin
       begin
         DontClear:=false;
         DontClear:=false;
@@ -863,8 +911,8 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.10  1999-02-19 15:43:20  peter
-    * compatibility fixes for FV
+  Revision 1.11  1999-02-22 11:51:38  peter
+    * browser updates from gabor
 
 
   Revision 1.9  1999/02/18 13:44:34  peter
   Revision 1.9  1999/02/18 13:44:34  peter
     * search fixed
     * search fixed

+ 15 - 5
ide/text/fpviews.pas

@@ -235,6 +235,7 @@ type
       LogLB : PMessageListBox;
       LogLB : PMessageListBox;
       constructor Init;
       constructor Init;
       procedure   AddMessage(AClass: longint; Msg, Module: string; Line,Column: longint);
       procedure   AddMessage(AClass: longint; Msg, Module: string; Line,Column: longint);
+      procedure   ClearMessages;
       procedure   SizeLimits(var Min, Max: TPoint); virtual;
       procedure   SizeLimits(var Min, Max: TPoint); virtual;
       procedure   Close; virtual;
       procedure   Close; virtual;
       procedure   HandleEvent(var Event: TEvent); virtual;
       procedure   HandleEvent(var Event: TEvent); virtual;
@@ -2539,12 +2540,12 @@ begin
   if ClassS<>'' then
   if ClassS<>'' then
    ClassS:=RExpand(ClassS,0)+': ';
    ClassS:=RExpand(ClassS,0)+': ';
   S:=ClassS;
   S:=ClassS;
-  if (Module<>nil) and (ID<>0) then
-     S:=NameAndExtOf(Module^)+'('+IntToStr(ID)+') '+S;
-  if Text<>nil then S:=S+Text^;
+  if (Module<>nil) {and (ID<>0)} then
+     S:=S+Module^+' ('+IntToStr(ID)+'): ';
+  if Text<>nil then S:=ClassS+Text^;
   if length(S)>MaxLen then S:=copy(S,1,MaxLen-2)+'..';
   if length(S)>MaxLen then S:=copy(S,1,MaxLen-2)+'..';
   GetText:=S;
   GetText:=S;
-end;
+ end;
 
 
 constructor TProgramInfoWindow.Init;
 constructor TProgramInfoWindow.Init;
 var R,R2: TRect;
 var R,R2: TRect;
@@ -2583,6 +2584,12 @@ begin
   LogLB^.AddItem(New(PCompilerMessage, Init(AClass, Msg, Module, Line,Column)));
   LogLB^.AddItem(New(PCompilerMessage, Init(AClass, Msg, Module, Line,Column)));
 end;
 end;
 
 
+procedure TProgramInfoWindow.ClearMessages;
+begin
+  LogLB^.Clear;
+  ReDraw;
+end;
+
 procedure TProgramInfoWindow.SizeLimits(var Min, Max: TPoint);
 procedure TProgramInfoWindow.SizeLimits(var Min, Max: TPoint);
 begin
 begin
   inherited SizeLimits(Min,Max);
   inherited SizeLimits(Min,Max);
@@ -3284,7 +3291,10 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.18  1999-02-22 11:29:38  pierre
+  Revision 1.19  1999-02-22 11:51:39  peter
+    * browser updates from gabor
+
+  Revision 1.18  1999/02/22 11:29:38  pierre
     + added col info in MessageItem
     + added col info in MessageItem
     + grep uses HighLightExts and should work for linux
     + grep uses HighLightExts and should work for linux
 
 

+ 91 - 2
ide/text/test.pas

@@ -4,12 +4,101 @@ uses Test2;
 
 
 const A =  1234;
 const A =  1234;
       B =  $1234;
       B =  $1234;
+      ConstBool1 = true;
+      ConstBool2 = boolean(5);
+      ConstChar = 'A';
+      ConstSet = ['A'..'Z'];
+      ConstSet2 = [15..254];
+      ConstFloat = 3.1415;
+
+type
+      PObj = ^TObj;
+      TObj = object
+        constructor Init;
+        function    Func: boolean;
+        procedure   Proc; virtual;
+        destructor  Done; virtual;
+      private
+        Z: integer;
+      end;
+
+      TObj2 = object(TObj)
+        procedure   Proc; virtual;
+      end;
+
+      TClass = class
+        constructor Create;
+      end;
+
+      TClass2 = class(TClass)
+      end;
+
+      EnumTyp = (enum1,enum2,enum3);
+      ArrayTyp = array[1..10] of EnumTyp;
+      ProcTyp = function(A: word; var B: longint; const C: EnumTyp): real;
+      SetTyp = set of EnumTyp;
+
+const
+      ConstOrd = enum1;
 
 
 var Hello : word;
 var Hello : word;
     X: PRecord;
     X: PRecord;
+    Bool: boolean;
     T : TRecord;
     T : TRecord;
+    Str20 : string[20];
+    Str255: string;
+    ArrayW: array[2..45] of word;
+    ArrayVar: ArrayTyp;
+    EnumVar: (enumElem1,enumElem2,enumElem3);
+    EnumVar2: EnumTyp;
+    FileVar: file;
+    FileVarR: file of TRecord;
+    FileVarW: file of word;
+    ProcVar: procedure;
+    ProcVarD: function(X: real): boolean;
+    ProcVarI: ProcTyp;
+    SetVarD: set of char;
+    SetVarI: SetTyp;
+    Float1: real;
+    Float2: double;
+    Float3: comp;
+    Float4: extended;
+    Pointer1: pointer;
+    Pointer2: PObj;
+    ClassVar1: TClass;
+    ClassVar2: TClass2;
+    Obj1: TObj;
+    Obj2: TObj2;
+
+constructor TObj.Init;
+begin
+  Z:=1;
+end;
+
+function TObj.Func: boolean;
+begin
+  Func:=true;
+end;
+
+procedure TObj.Proc;
+begin
+  if Func=false then Halt;
+end;
+
+destructor TObj.Done;
+begin
+end;
+
+procedure TObj2.Proc;
+begin
+  Z:=4;
+end;
+
+constructor TClass.Create;
+begin
+end;
 
 
-function Func1(x,z : word;y : boolean): shortint;
+function Func1(x,z : word; var y : boolean; const r: TRecord): shortint;
 
 
   procedure test_local(c,f : longint);
   procedure test_local(c,f : longint);
    var
    var
@@ -33,6 +122,6 @@ BEGIN
   For i:=0 to paramcount do
   For i:=0 to paramcount do
    writeln('Paramstr(',i,') = ',Paramstr(i));
    writeln('Paramstr(',i,') = ',Paramstr(i));
   writeln(IsOdd(3));
   writeln(IsOdd(3));
-  writeln(Func1(5,5,true));
+  writeln(Func1(5,5,Bool,T));
   Halt;
   Halt;
 END.
 END.