Ignore:
Timestamp:
Dec 24, 2017, 11:13:05 AM (7 years ago)
Author:
chronos
Message:
  • Modified: Show rules list docked directly to main form.
Location:
branches/generator
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/generator

    • Property svn:ignore
      •  

        old new  
         1generator
        12generator.exe
        23generator.lps
        34lib
        45heaptrclog.trc
         6Generated
  • branches/generator/UGrammer.pas

    r129 r130  
    113113  private
    114114    FModified: Boolean;
     115    FOnChange: TNotifyEvent;
     116    FOnDestroy: TNotifyEvent;
    115117    procedure SetModified(AValue: Boolean);
     118    procedure DoChange;
     119    procedure DoDestroy;
    116120  public
    117121    FileName: string;
     
    125129    procedure GetUsedByRule(RefRule: TRule; UsedByRules: TStrings);
    126130    function GetString: string;
     131    procedure Change;
    127132    property Modified: Boolean read FModified write SetModified;
     133    property OnChange: TNotifyEvent read FOnChange write FOnChange;
     134    property OnDestroy: TNotifyEvent read FOnDestroy write FOnDestroy;
    128135  end;
    129136
     
    141148  if FModified = AValue then Exit;
    142149  FModified := AValue;
     150  if AValue then DoChange;
     151end;
     152
     153procedure TGrammer.DoChange;
     154begin
     155  if Assigned(FOnChange) then FOnChange(Self);
     156end;
     157
     158procedure TGrammer.DoDestroy;
     159begin
     160  if Assigned(FOnDestroy) then FOnDestroy(Self);
    143161end;
    144162
     
    165183    end;
    166184  finally
    167     Doc.Free;
     185    FreeAndNil(Doc);
    168186  end;
    169187
     
    195213    Modified := False;
    196214  finally
    197     Doc.Free;
     215    FreeAndNil(Doc);
    198216  end;
    199217end;
     
    213231destructor TGrammer.Destroy;
    214232begin
     233  DoDestroy;
    215234  FreeAndNil(Rules);
    216235  inherited Destroy;
     
    229248begin
    230249  Result := Rules.GetString;
     250end;
     251
     252procedure TGrammer.Change;
     253begin
     254  DoChange;
    231255end;
    232256
Note: See TracChangeset for help on using the changeset viewer.