Changeset 53 for branches/DelphiToC/Produce/UProducerTreeView.pas
- Timestamp:
- Aug 10, 2010, 10:14:57 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DelphiToC/Produce/UProducerTreeView.pas
r52 r53 22 22 procedure AddNodeTypeRecord(Node: TTreeNode; TypeRecord: TTypeRecord); 23 23 procedure AddNodeTypeList(Node: TTreeNode; Types: TTypeList); 24 procedure AddNodeType(Node: TTreeNode; AType: TType); 24 25 procedure AddNodeVariableList(Node: TTreeNode; Variables: TVariableList); 25 26 procedure AddNodeConstantList(Node: TTreeNode; Constants: TConstantList); … … 56 57 NewNode: TTreeNode; 57 58 NewNode2: TTreeNode; 58 NewNode3: TTreeNode;59 I: Integer;60 59 begin 61 60 NewNode := TreeView.Items.AddChild(Node, 'while'); … … 194 193 var 195 194 NewNode: TTreeNode; 196 NewNode2: TTreeNode;197 NewNode3: TTreeNode;198 195 I: Integer; 199 196 begin … … 202 199 for I := 0 to Types.Count - 1 do 203 200 with TType(Types[I]) do 204 if not System then begin 205 if TType(Types[I]) is TTypeRecord then begin 206 NewNode2 := TreeView.Items.AddChild(NewNode, Name + ' = record'); 207 AddNodeTypeRecord(NewNode2, TTypeRecord(Types[I])); 208 end else if Assigned(UsedType) then 209 NewNode2 := TreeView.Items.AddChild(NewNode, Name + ' = ' + UsedType.Name) 210 else NewNode2 := TreeView.Items.AddChild(NewNode, Name); 211 end; 201 if not System then AddNodeType(NewNode, TType(Types[I])); 202 end; 203 end; 204 205 procedure TProducerTreeView.AddNodeType(Node: TTreeNode; AType: TType); 206 var 207 NewNode: TTreeNode; 208 NewNode2: TTreeNode; 209 begin 210 with AType do begin 211 if AType is TTypeRecord then begin 212 NewNode := TreeView.Items.AddChild(Node, Name + ' = record'); 213 AddNodeTypeRecord(NewNode, TTypeRecord(AType)); 214 end else 215 if AType is TTypeArray then begin 216 NewNode := TreeView.Items.AddChild(Node, Name + ' = array'); 217 if Assigned(TTypeArray(AType).IndexType) then begin 218 NewNode2 := TreeView.Items.AddChild(NewNode, 'Index'); 219 AddNodeType(NewNode2, TTypeArray(AType).IndexType); 220 end; 221 if Assigned(TTypeArray(AType).ItemType) then begin 222 NewNode2 := TreeView.Items.AddChild(NewNode, 'ItemType'); 223 AddNodeType(NewNode2, TTypeArray(AType).ItemType); 224 end; 225 end else if Assigned(UsedType) then 226 NewNode := TreeView.Items.AddChild(Node, Name + ' = ' + UsedType.Name) 227 else NewNode := TreeView.Items.AddChild(Node, Name); 212 228 end; 213 229 end; … … 217 233 var 218 234 NewNode: TTreeNode; 219 NewNode2: TTreeNode;220 235 I: Integer; 221 236 begin … … 253 268 ); 254 269 var 255 NewNode: TTreeNode;256 NewNode2: TTreeNode;257 NewNode3: TTreeNode;258 270 I: Integer; 259 271 begin … … 261 273 for I := 0 to TypeRecord.Items.Count - 1 do 262 274 with TType(TypeRecord.Items[I]) do 263 if not System then begin 264 if TType(TypeRecord.Items[I]) is TTypeRecord then begin 265 NewNode2 := TreeView.Items.AddChild(NewNode, Name + ' = record'); 266 AddNodeTypeRecord(NewNode2, TTypeRecord(TypeRecord.Items[I])) 267 end else if Assigned(UsedType) then 268 NewNode2 := TreeView.Items.AddChild(NewNode, Name + ' = ' + UsedType.Name) 269 else NewNode2 := TreeView.Items.AddChild(NewNode, Name); 270 end; 275 if not System then 276 AddNodeType(Node, TType(TypeRecord.Items[I])); 271 277 end; 272 278 end;
Note:
See TracChangeset
for help on using the changeset viewer.