Ignore:
Timestamp:
Aug 8, 2017, 11:15:41 PM (7 years ago)
Author:
chronos
Message:
  • Added: Rule items can be managed.
  • Added: Show BNF syntax on main form.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/generator/Forms/UFormMain.pas

    r109 r110  
    2020    ActionList1: TActionList;
    2121    MainMenu1: TMainMenu;
     22    MemoBNF: TMemo;
    2223    MenuItem1: TMenuItem;
    2324    MenuItem2: TMenuItem;
     
    3334    procedure ARulesExecute(Sender: TObject);
    3435    procedure ASaveAsExecute(Sender: TObject);
     36    procedure FormShow(Sender: TObject);
    3537  private
    3638    { private declarations }
     
    5557begin
    5658  FormRules.Rules := Core.Rules;
    57   FormRules.Show;
     59  FormRules.ShowModal;
     60  MemoBNF.Lines.Text := Core.Rules.GetBNF;
    5861end;
    5962
    6063procedure TFormMain.ASaveAsExecute(Sender: TObject);
    6164begin
     65  SaveDialog1.FileName := Core.Rules.FileName;
    6266  if SaveDialog1.Execute then begin
    6367    Core.Rules.SaveToXmlFile(SaveDialog1.FileName);
    6468  end;
     69end;
     70
     71procedure TFormMain.FormShow(Sender: TObject);
     72begin
     73  MemoBNF.Lines.Text := Core.Rules.GetBNF;
    6574end;
    6675
     
    7281procedure TFormMain.AOpenExecute(Sender: TObject);
    7382begin
     83  OpenDialog1.FileName := Core.Rules.FileName;
    7484  if OpenDialog1.Execute then begin
    7585    Core.Rules.LoadFromXmlFile(OpenDialog1.FileName);
Note: See TracChangeset for help on using the changeset viewer.