Changeset 17 for trunk/StudioModules/LDModuleBasic/UFormSourceCode.pas
- Timestamp:
- Aug 7, 2012, 2:57:19 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/StudioModules/LDModuleBasic/UFormSourceCode.pas
r16 r17 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, 9 SynEdit, SynHighlighterPas ;9 SynEdit, SynHighlighterPas, USource, ULDModuleBasic; 10 10 11 11 type … … 18 18 procedure SynEditSourceChange(Sender: TObject); 19 19 private 20 F FileName: string;20 FSource: TSource; 21 21 FOnChange: TNotifyEvent; 22 procedure Set FileName(AValue: string);22 procedure SetSource(AValue: TSource); 23 23 public 24 property FileName: string read FFileName write SetFileName;24 property Source: TSource read FSource write SetSource; 25 25 procedure Save; 26 26 procedure UpdateInterface; … … 45 45 end; 46 46 47 procedure TFormSourceCode.Set FileName(AValue: string);47 procedure TFormSourceCode.SetSource(AValue: TSource); 48 48 begin 49 if F FileName = AValue then Exit;50 F FileName := AValue;51 if FileExistsUTF8(FFileName) then52 SynEditSource.Lines. LoadFromFile(FFileName)49 if FSource = AValue then Exit; 50 FSource := AValue; 51 if Assigned(Source) and (Source is TSourceText) then 52 SynEditSource.Lines.Text := TSourceText(Source).Content.Text 53 53 else SynEditSource.ClearAll; 54 54 end;
Note:
See TracChangeset
for help on using the changeset viewer.