Changeset 24 for trunk/IDE/UProject.pas


Ignore:
Timestamp:
Nov 10, 2010, 9:42:27 AM (14 years ago)
Author:
george
Message:
  • Added: Parsing type parameters.
  • Fixed: Saving edited files.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/IDE/UProject.pas

    r23 r24  
    1414
    1515  TProjectNode = class
     16  private
     17    FModified: Boolean;
     18    procedure SetModified(const AValue: Boolean);
     19  public
    1620    Parent: TProjectNode;
    1721    Name: string;
    1822    ProducedFileName: string;
    19     Modified: Boolean;
    2023    procedure SaveToXMLNode(Node: TDOMNode); virtual;
    2124    procedure LoadFromXMLNode(Node: TDOMNode); virtual;
     
    2326    procedure Save; virtual;
    2427    function GetDir(IncludeRoot: Boolean = False): string; virtual;
     28    property Modified: Boolean read FModified write SetModified;
    2529  end;
    2630
     
    197201procedure TProjectFile.Save;
    198202begin
     203  if Modified then
     204    Source.SaveToFile(Parent.GetDir(True) + Name);
    199205  inherited Save;
    200   Source.SaveToFile(Parent.GetDir(True) + Name);
    201206end;
    202207
    203208{ TProjectNode }
     209
     210procedure TProjectNode.SetModified(const AValue: Boolean);
     211begin
     212  if FModified=AValue then exit;
     213  FModified:=AValue;
     214  if Assigned(Parent) then Parent.Modified := AValue;
     215end;
    204216
    205217procedure TProjectNode.SaveToXMLNode(Node: TDOMNode);
Note: See TracChangeset for help on using the changeset viewer.