mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-06 18:24:26 +08:00
Remove helper function ToggleCheckListBox, replace the few callers with simple code alternatives
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user