Ignore:
Timestamp:
Oct 18, 2010, 10:00:00 AM (14 years ago)
Author:
george
Message:
  • Added: Storing application setting in system registry.
  • Added: Loading project files.
  • Added: Remembering last opened files.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Transpascal/Forms/UProjectManager.pas

    r63 r66  
    1515    procedure TreeViewProjectChange(Sender: TObject; Node: TTreeNode);
    1616  private
    17     { private declarations }
     17    procedure UpdateProjectGroup(Node: TTreeNode; Group: TProjectGroup);
    1818  public
    19     { public declarations }
    20   end; 
     19    procedure UpdateProjectTree;
     20  end;
    2121
    2222var
     
    6969end;
    7070
     71procedure TProjectManager.UpdateProjectTree;
     72var
     73  NewNode: TTreeNode;
     74begin
     75  with MainForm, TreeViewProject, Items do begin
     76    BeginUpdate;
     77    Clear;
     78    NewNode := AddChild(nil, Project.Name);
     79    UpdateProjectGroup(NewNode, Project);
     80    NewNode.Expand(True);
     81    EndUpdate;
     82    TreeViewProject.TopItem.Items[0].Selected := True;
     83  end;
     84end;
     85
     86procedure TProjectManager.UpdateProjectGroup(Node: TTreeNode; Group: TProjectGroup);
     87var
     88  I: Integer;
     89  NewNode: TTreeNode;
     90begin
     91  with MainForm do
     92  for I := 0 to Group.Items.Count - 1 do begin
     93    NewNode := TreeViewProject.Items.AddChild(Node,
     94      TProjectNode(Group.Items[I]).Name);
     95    NewNode.Data := Pointer(Group.Items[I]);
     96    if TProjectNode(Group.Items[I]) is TProjectGroup then
     97      UpdateProjectGroup(NewNode, TProjectGroup(Group.Items[I]));
     98  end;
     99end;
     100
     101
     102
    71103end.
    72104
Note: See TracChangeset for help on using the changeset viewer.