Remove helper function ToggleCheckListBox, replace the few callers with simple code alternatives

This commit is contained in:
Ansgar Becker
2012-05-01 06:50:57 +00:00
parent 3e2d4371a3
commit 5cb54b3711
3 changed files with 14 additions and 52 deletions

View File

@ -145,8 +145,6 @@ type
function BestTableName(Data: TDBQuery): String;
function urlencode(url: String): String;
procedure StreamWrite(S: TStream; Text: String = '');
procedure ToggleCheckListBox(list: TCheckListBox; state: Boolean); Overload;
procedure ToggleCheckListBox(list: TCheckListBox; state: Boolean; list_toggle: TStringList); Overload;
function _GetFileSize(Filename: String): Int64;
function MakeInt( Str: String ) : Int64;
function MakeFloat( Str: String ): Extended;
@ -431,46 +429,6 @@ begin
end;
{***
Check/Uncheck all items in a CheckListBox
@param TCheckListBox List with checkable items
@param boolean Check them?
@return void
}
procedure ToggleCheckListBox(list: TCheckListBox; state: Boolean);
var
i : Integer;
begin
// select all/none
for i:=0 to list.Items.Count-1 do
list.checked[i] := state;
end;
{***
Check/Uncheck items in a CheckListBox which come in a second list
@param TCheckListBox List with checkable items
@param boolean Check them?
@param TStringList Second list with items to change
@return void
}
procedure ToggleCheckListBox(list: TCheckListBox; state: Boolean; list_toggle: TStringList);
var
i : Integer;
begin
for i:=0 to list.Items.Count-1 do begin
if list_toggle.IndexOf(list.Items[i]) > -1 then
list.Checked[i] := state
else
list.Checked[i] := not state;
end;
end;
{***
Return filesize of a given file
@param string Filename