Ignore:
Timestamp:
Aug 9, 2010, 3:50:42 PM (14 years ago)
Author:
george
Message:

Renamed some files.
Added support for custom record types.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DelphiToC/Visual/USourceTree.pas

    r50 r51  
    66
    77uses
    8   Classes, SysUtils, UPascalSource, ComCtrls;
     8  Classes, SysUtils, USourceCode, ComCtrls;
    99
    1010type
     
    2020    procedure AddNodeMethodList(Node: TTreeNode; Methods: TFunctionList);
    2121    procedure AddNodeParameterList(Node: TTreeNode; Parameters: TParameterList);
     22    procedure AddNodeTypeRecord(Node: TTreeNode; TypeRecord: TTypeRecord);
    2223    procedure AddNodeTypeList(Node: TTreeNode; Types: TTypeList);
    2324    procedure AddNodeVariableList(Node: TTreeNode; Variables: TVariableList);
     
    195196  NewNode: TTreeNode;
    196197  NewNode2: TTreeNode;
     198  NewNode3: TTreeNode;
    197199  I: Integer;
    198200begin
     
    202204    with TType(Types[I]) do
    203205    if not System then begin
    204       NewNode2 := TreeView.Items.AddChild(NewNode, Name + ' = ');
     206      if TType(Types[I]) is TTypeRecord then begin
     207        NewNode2 := TreeView.Items.AddChild(NewNode, Name + ' = record');
     208        AddNodeTypeRecord(NewNode2, TTypeRecord(Types[I]));
     209      end else if Assigned(UsedType) then
     210        NewNode2 := TreeView.Items.AddChild(NewNode, Name + ' = ' + UsedType.Name)
     211      else NewNode2 := TreeView.Items.AddChild(NewNode, Name);
    205212    end;
    206213  end;
     
    244251end;
    245252
     253procedure TSourceTree.AddNodeTypeRecord(Node: TTreeNode; TypeRecord: TTypeRecord
     254  );
     255var
     256  NewNode: TTreeNode;
     257  NewNode2: TTreeNode;
     258  NewNode3: TTreeNode;
     259  I: Integer;
     260begin
     261  if TypeRecord.Items.Count > 0 then begin
     262    for I := 0 to TypeRecord.Items.Count - 1 do
     263    with TType(TypeRecord.Items[I]) do
     264    if not System then begin
     265      if TType(TypeRecord.Items[I]) is TTypeRecord then begin
     266        NewNode2 := TreeView.Items.AddChild(NewNode, Name + ' = record');
     267        AddNodeTypeRecord(NewNode2, TTypeRecord(TypeRecord.Items[I]))
     268      end else if Assigned(UsedType) then
     269        NewNode2 := TreeView.Items.AddChild(NewNode, Name + ' = ' + UsedType.Name)
     270      else NewNode2 := TreeView.Items.AddChild(NewNode, Name);
     271    end;
     272  end;
     273end;
     274
    246275procedure TSourceTree.AddNodeModule(Node: TTreeNode; Module: TModule);
    247276var
Note: See TracChangeset for help on using the changeset viewer.