Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure TComponentManager.ButtonClearClick;
- var
- I: Integer;
- begin
- for I := 0 to (((Sender as TButton).Parent) as TForm).ComponentCount - 1 do
- if (((Sender as TButton).Parent) as TForm).Components[I] is TCheckBox then
- ((((Sender as TButton).Parent) as TForm).Components[I] as TCheckBox)
- .Checked := False;
- end;
- procedure TComponentManager.ButtonVoteClick;
- var
- I, CheckedCount: Integer;
- begin
- CheckedCount := 0;
- for I := 0 to (((Sender as TButton).Parent) as TForm).ComponentCount - 1 do
- if ((((Sender as TButton).Parent) as TForm).Components[I] is TCheckBox) and
- (((((Sender as TButton).Parent) as TForm).Components[I] as TCheckBox)
- .Checked = True) then
- CheckedCount := CheckedCount + 1;
- if (CheckedCount < 4) then
- begin
- for I := 0 to (((Sender as TButton).Parent) as TForm).ComponentCount - 1 do
- if ((((Sender as TButton).Parent) as TForm).Components[I] is TCheckBox)
- and (((((Sender as TButton).Parent) as TForm)
- .Components[I] as TCheckBox).Checked = True) then
- begin
- Ini.WriteInteger('COUNTERS', IntToStr(I + 1),
- Ini.ReadInteger('COUNTERS', IntToStr(I + 1), 0) + 1);
- ((((Sender as TButton).Parent) as TForm).Components[I] as TCheckBox)
- .Checked := False;
- end;
- Ini.WriteInteger('COUNTERS', 'Total', Ini.ReadInteger('COUNTERS', 'Total',
- 0) + CheckedCount);
- end
- else
- begin
- for I := 0 to (((Sender as TButton).Parent) as TForm).ComponentCount - 1 do
- if (((Sender as TButton).Parent) as TForm).Components[I]
- is TCheckBox then ((((Sender as TButton).Parent) as TForm)
- .Components[I] as TCheckBox)
- .Checked := False;
- Ini.WriteInteger('COUNTERS', 'Invalid', Ini.ReadInteger('COUNTERS',
- 'Invalid', 0) + 1);
- end; (((Sender as TButton).Parent) as TForm)
- .Close();
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement