procedure ExecuteEditRule(Rule: TBottleChainRule);
public
{ Public \90é\8c¾ }
+ procedure UpdateCheckBox;
procedure UpdateDisplay;
end;
end;
procedure TfrmBottleChainList.btnDeleteClick(Sender: TObject);
-var Del: TBottleChainRule;
+var
+ Del: TBottleChainRule;
+ Index: integer;
begin
- if lstRules.ItemIndex < 0 then Exit;
- Del := BottleChainRuleList[lstRules.ItemIndex];
+ Index := lstRules.ItemIndex;
+ if Index < 0 then
+ Exit;
+ Del := BottleChainRuleList[Index];
Del.Free;
- UpdateDisplay;
+ lstRules.Items.Delete(Index);
end;
procedure TfrmBottleChainList.btnUpClick(Sender: TObject);
i := lstRules.ItemIndex;
if i > 0 then begin
BottleChainRuleList.List.Move(i, i - 1);
+ lstRules.Items.Move(i, i-1);
lstRules.ItemIndex := i - 1;
- UpdateDisplay;
end;
end;
i := lstRules.ItemIndex;
if (i >= 0) and (i < lstRules.Items.Count-1) then begin
BottleChainRuleList.List.Move(i, i + 1);
+ lstRules.Items.Move(i, i+1);
lstRules.ItemIndex := i + 1;
- UpdateDisplay;
end;
end;
New := TBottleChainRule.Create(BottleChainRuleList);
New.Assign(BottleChainRuleList.Rules[lstRules.ItemIndex]);
New.RuleList := BottleChainRuleList;
- UpdateDisplay;
+ lstRules.Items.Insert(lstRules.ItemIndex + 1, New.StringExpression);
+ UpdateCheckBox;
end;
end;
+procedure TfrmBottleChainList.UpdateCheckBox;
+var
+ i: integer;
+begin
+ for i := 0 to BottleChainRuleList.Count-1 do
+ lstRules.Checked[i] := BottleChainRuleList[i].Enabled;
+end;
+
end.