replace TCustomCheckListBox.KeyPress with TCustomCheckListBox.KeyDown

git-svn-id: trunk@9404 -
This commit is contained in:
mattias 2006-06-05 10:28:44 +00:00
parent 88a04ff101
commit 56df0109ff

View File

@ -45,8 +45,7 @@ type
procedure SetChecked(const AIndex: Integer; const AValue: Boolean);
procedure SendItemChecked(const AIndex: Integer; const AChecked: Boolean);
procedure DoChange(var Msg); message LM_CHANGED;
procedure KeyPress(var Key: char); override;
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
protected
procedure AssignItemDataToCache(const AIndex: Integer; const AData: Pointer); override;
procedure AssignCacheToItemData(const AIndex: Integer; const AData: Pointer); override;
@ -166,15 +165,15 @@ begin
Result := Items.Count;
end;
procedure TCustomCheckListBox.KeyPress(var Key: char);
procedure TCustomCheckListBox.KeyDown(var Key: Word; Shift: TShiftState);
begin
if Key = ' ' then begin
if (Key = VK_SPACE) and (Shift=[]) then begin
Checked[ItemIndex]:=not Checked[ItemIndex];
end;
inherited KeyPress(Key);
Key:=VK_UNKNOWN;
end else
inherited KeyDown(Key,Shift);
end;
procedure TCustomCheckListBox.SendItemChecked(const AIndex: Integer;
const AChecked: Boolean);
begin