Ignore:
Timestamp:
Dec 26, 2017, 6:59:40 PM (7 years ago)
Author:
chronos
Message:
  • Added: Support for whitespaces in And rule.
  • Added: Terminals can be specified as escaped strings with slash.
File:
1 edited

Legend:

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

    r129 r136  
    2020    AMoveUp: TAction;
    2121    ARemove: TAction;
    22     ComboBox1: TComboBox;
     22    CheckBoxWhiteSpace: TCheckBox;
     23    ComboBoxOperator: TComboBox;
    2324    Label1: TLabel;
    2425    ListView1: TListView;
     
    4041    procedure AMoveUpExecute(Sender: TObject);
    4142    procedure ARemoveExecute(Sender: TObject);
     43    procedure ComboBoxOperatorChange(Sender: TObject);
    4244    procedure FormCreate(Sender: TObject);
    4345    procedure FormShow(Sender: TObject);
     
    8284  NewRuleItem := TRuleItem.Create;
    8385  NewRuleItem.Grammer := RuleItems.Grammer;
     86  NewRuleItem.ParentRule := RuleItems.ParentRule;
    8487  FormRuleItem := TFormRuleItem.Create(nil);
    8588  FormRuleItem.LoadData(NewRuleItem);
     
    141144end;
    142145
     146procedure TFormRuleItems.ComboBoxOperatorChange(Sender: TObject);
     147begin
     148  UpdateInterface;
     149end;
     150
    143151procedure TFormRuleItems.FormCreate(Sender: TObject);
    144152begin
     
    174182  AMoveUp.Enabled := Assigned(ListView1.Selected) and (ListView1.Selected.Index > 0);
    175183  AMoveDown.Enabled := Assigned(ListView1.Selected) and (ListView1.Selected.Index < (ListView1.Items.Count - 1));
     184  CheckBoxWhiteSpace.Enabled := ComboBoxOperator.ItemIndex = 0;
    176185end;
    177186
     
    186195begin
    187196  Self.RuleItems := RuleItems;
    188   ComboBox1.ItemIndex := Integer(RuleItems.RuleType);
     197  ComboBoxOperator.ItemIndex := Integer(RuleItems.RuleType);
     198  CheckBoxWhiteSpace.Checked := RuleItems.WithWhiteSpeaces;
    189199end;
    190200
    191201procedure TFormRuleItems.SaveData(RuleItems: TRuleItems);
    192202begin
    193   RuleItems.RuleType := TRuleType(ComboBox1.ItemIndex);
     203  RuleItems.RuleType := TRuleType(ComboBoxOperator.ItemIndex);
     204  RuleItems.WithWhiteSpeaces := CheckBoxWhiteSpace.Checked;
    194205end;
    195206
Note: See TracChangeset for help on using the changeset viewer.