Ignore:
Timestamp:
Nov 30, 2017, 6:33:17 PM (7 years ago)
Author:
chronos
Message:
  • Modified: Show char length of rule.
File:
1 edited

Legend:

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

    r126 r128  
    111111procedure TFormRuleItems.AMoveDownExecute(Sender: TObject);
    112112begin
    113   RuleItems.ParentRule.Items.Move(ListView1.Selected.Index, ListView1.Selected.Index + 1);
    114   ListView1.ItemIndex := ListView1.Selected.Index + 1;
    115   ReloadList;
     113  if Assigned(ListView1.Selected) then begin
     114    RuleItems.Move(ListView1.Selected.Index, ListView1.Selected.Index + 1);
     115    ListView1.ItemIndex := ListView1.Selected.Index + 1;
     116    ReloadList;
     117  end;
    116118end;
    117119
    118120procedure TFormRuleItems.AMoveUpExecute(Sender: TObject);
    119121begin
    120   RuleItems.ParentRule.Items.Move(ListView1.Selected.Index, ListView1.Selected.Index - 1);
    121   ListView1.ItemIndex := ListView1.Selected.Index - 1;
    122   ReloadList;
     122  if Assigned(ListView1.Selected) then begin
     123    RuleItems.Move(ListView1.Selected.Index, ListView1.Selected.Index - 1);
     124    ListView1.ItemIndex := ListView1.Selected.Index - 1;
     125    ReloadList;
     126  end;
    123127end;
    124128
     
    131135  for I := ListView1.Items.Count - 1 downto 0 do
    132136  if ListView1.Items[I].Selected then begin
    133     RuleItems.ParentRule.Items.Remove(TRuleItem(ListView1.Items[I].Data));
     137    RuleItems.Remove(TRuleItem(ListView1.Items[I].Data));
    134138    RuleItems.Grammer.Modified := True;
    135139  end;
Note: See TracChangeset for help on using the changeset viewer.