Ignore:
Timestamp:
Aug 3, 2012, 3:06:51 PM (12 years ago)
Author:
chronos
Message:
  • Modified: Project management as separated module.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/StudioPackage/Forms/UFormSourceCode.pas

    r4 r11  
    11unit UFormSourceCode;
    22
    3 {$mode objfpc}{$H+}
     3{$mode delphi}{$H+}
    44
    55interface
     
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
    9   SynEdit, SynHighlighterPas, UProject;
     9  SynEdit, SynHighlighterPas;
    1010
    1111type
     
    1818    procedure SynEditSourceChange(Sender: TObject);
    1919  private
     20    FFileName: string;
    2021    FOnChange: TNotifyEvent;
    21     FProjectFile: TProjectFile;
    22     procedure SetProjectFile(const AValue: TProjectFile);
     22    procedure SetFileName(AValue: string);
    2323  public
    24     property ProjectFile: TProjectFile read FProjectFile write SetProjectFile;
     24    property FileName: string read FFileName write SetFileName;
    2525    procedure Save;
    2626    procedure UpdateInterface;
     
    4747end;
    4848
    49 procedure TFormSourceCode.SetProjectFile(const AValue: TProjectFile);
     49procedure TFormSourceCode.SetFileName(AValue: string);
    5050begin
    51   if FProjectFile = AValue then Exit;
    52   FProjectFile := AValue;
    53   if Assigned(AValue) then
    54     SynEditSource.Lines.Assign(FProjectFile.Source)
     51  if FFileName = AValue then Exit;
     52  FFileName := AValue;
     53  if FileExistsUTF8(FFileName) then
     54    SynEditSource.Lines.LoadFromFile(FFileName)
    5555    else SynEditSource.ClearAll;
    5656end;
     
    5858procedure TFormSourceCode.Save;
    5959begin
    60   if Assigned(ProjectFile) then
    61     ProjectFile.Source.Assign(SynEditSource.Lines);
     60{  if Assigned(ProjectFile) then
     61    ProjectFile.Source.Assign(SynEditSource.Lines);}
    6262end;
    6363
    6464procedure TFormSourceCode.UpdateInterface;
    6565begin
    66   SynEditSource.Enabled := Assigned(DataModule1.Project);
    67   if not Assigned(DataModule1.Project) then SynEditSource.ClearAll;
     66//  SynEditSource.Enabled := Assigned(DataModule1.Project);
     67//  if not Assigned(DataModule1.Project) then SynEditSource.ClearAll;
    6868end;
    6969
Note: See TracChangeset for help on using the changeset viewer.