Ignore:
Timestamp:
Nov 29, 2017, 12:31:26 PM (7 years ago)
Author:
chronos
Message:
  • Added: New rules flag directing if source node should be generated for them.
  • Added: New and Save menu actions.
File:
1 edited

Legend:

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

    r117 r119  
    5858  UFormRule, UCore;
    5959
     60const
     61  BooleanText: array[Boolean] of string = ('No', 'Yes');
     62
    6063{ TFormRules }
    6164
     
    8891  FormRule: TFormRule;
    8992begin
    90   Rule := TRule(ListView1.Selected.Data);
    91   FormRule := TFormRule.Create(nil);
    92   FormRule.LoadData(Rule);
    93   if FormRule.ShowModal = mrOk then begin
    94     FormRule.SaveData(Rule);
    95     ReloadList;
     93  if Assigned(ListView1.Selected) then begin
     94    Rule := TRule(ListView1.Selected.Data);
     95    FormRule := TFormRule.Create(nil);
     96    FormRule.LoadData(Rule);
     97    if FormRule.ShowModal = mrOk then begin
     98      FormRule.SaveData(Rule);
     99      ReloadList;
     100    end;
     101    FreeAndNil(FormRule);
    96102  end;
    97   FreeAndNil(FormRule);
    98103end;
    99104
     
    123128    Item.Caption := Rules[Item.Index].Name;
    124129    Item.Data := Rules[Item.Index];
    125     Item.SubItems.Add(Rules[Item.Index].Items.GetBNF);
     130    Item.SubItems.Add(BooleanText[Rules[Item.Index].CreateSourceNode]);
     131    Item.SubItems.Add(Rules[Item.Index].Items.GetString);
    126132  end;
    127133end;
Note: See TracChangeset for help on using the changeset viewer.