Changeset 11 for trunk/StudioPackage/Forms/UFormSourceCode.pas
- Timestamp:
- Aug 3, 2012, 3:06:51 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/StudioPackage/Forms/UFormSourceCode.pas
r4 r11 1 1 unit UFormSourceCode; 2 2 3 {$mode objfpc}{$H+}3 {$mode delphi}{$H+} 4 4 5 5 interface … … 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, 9 SynEdit, SynHighlighterPas , UProject;9 SynEdit, SynHighlighterPas; 10 10 11 11 type … … 18 18 procedure SynEditSourceChange(Sender: TObject); 19 19 private 20 FFileName: string; 20 21 FOnChange: TNotifyEvent; 21 FProjectFile: TProjectFile; 22 procedure SetProjectFile(const AValue: TProjectFile); 22 procedure SetFileName(AValue: string); 23 23 public 24 property ProjectFile: TProjectFile read FProjectFile write SetProjectFile;24 property FileName: string read FFileName write SetFileName; 25 25 procedure Save; 26 26 procedure UpdateInterface; … … 47 47 end; 48 48 49 procedure TFormSourceCode.Set ProjectFile(const AValue: TProjectFile);49 procedure TFormSourceCode.SetFileName(AValue: string); 50 50 begin 51 if F ProjectFile = AValue then Exit;52 F ProjectFile := AValue;53 if Assigned(AValue) then54 SynEditSource.Lines. Assign(FProjectFile.Source)51 if FFileName = AValue then Exit; 52 FFileName := AValue; 53 if FileExistsUTF8(FFileName) then 54 SynEditSource.Lines.LoadFromFile(FFileName) 55 55 else SynEditSource.ClearAll; 56 56 end; … … 58 58 procedure TFormSourceCode.Save; 59 59 begin 60 if Assigned(ProjectFile) then61 ProjectFile.Source.Assign(SynEditSource.Lines); 60 { if Assigned(ProjectFile) then 61 ProjectFile.Source.Assign(SynEditSource.Lines);} 62 62 end; 63 63 64 64 procedure TFormSourceCode.UpdateInterface; 65 65 begin 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; 68 68 end; 69 69
Note:
See TracChangeset
for help on using the changeset viewer.