Ignore:
Timestamp:
Aug 7, 2012, 2:57:19 PM (12 years ago)
Author:
chronos
Message:
  • Modified: Minor opened files and source management enhancement.
  • Added: Included used packages sources.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/StudioModules/LDModuleBasic/UFormSourceCode.pas

    r16 r17  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
    9   SynEdit, SynHighlighterPas;
     9  SynEdit, SynHighlighterPas, USource, ULDModuleBasic;
    1010
    1111type
     
    1818    procedure SynEditSourceChange(Sender: TObject);
    1919  private
    20     FFileName: string;
     20    FSource: TSource;
    2121    FOnChange: TNotifyEvent;
    22     procedure SetFileName(AValue: string);
     22    procedure SetSource(AValue: TSource);
    2323  public
    24     property FileName: string read FFileName write SetFileName;
     24    property Source: TSource read FSource write SetSource;
    2525    procedure Save;
    2626    procedure UpdateInterface;
     
    4545end;
    4646
    47 procedure TFormSourceCode.SetFileName(AValue: string);
     47procedure TFormSourceCode.SetSource(AValue: TSource);
    4848begin
    49   if FFileName = AValue then Exit;
    50   FFileName := AValue;
    51   if FileExistsUTF8(FFileName) then
    52     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
    5353    else SynEditSource.ClearAll;
    5454end;
Note: See TracChangeset for help on using the changeset viewer.