From 56df0109ffb8d94c9dad345fc7360c6041a1762a Mon Sep 17 00:00:00 2001 From: mattias Date: Mon, 5 Jun 2006 10:28:44 +0000 Subject: [PATCH] replace TCustomCheckListBox.KeyPress with TCustomCheckListBox.KeyDown git-svn-id: trunk@9404 - --- lcl/checklst.pas | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lcl/checklst.pas b/lcl/checklst.pas index 11f4bb3021..a56aef9201 100644 --- a/lcl/checklst.pas +++ b/lcl/checklst.pas @@ -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