Changeset 128 for branches/generator/Forms/UFormRuleItems.pas
- Timestamp:
- Nov 30, 2017, 6:33:17 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/generator/Forms/UFormRuleItems.pas
r126 r128 111 111 procedure TFormRuleItems.AMoveDownExecute(Sender: TObject); 112 112 begin 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; 116 118 end; 117 119 118 120 procedure TFormRuleItems.AMoveUpExecute(Sender: TObject); 119 121 begin 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; 123 127 end; 124 128 … … 131 135 for I := ListView1.Items.Count - 1 downto 0 do 132 136 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)); 134 138 RuleItems.Grammer.Modified := True; 135 139 end;
Note:
See TracChangeset
for help on using the changeset viewer.