LCL: Exit TCustomSpeedButton.DialogChar silently if Message.Msg <> LM_SYSCHAR.

git-svn-id: trunk@29854 -
This commit is contained in:
juha 2011-03-15 15:50:03 +00:00
parent 4e95f6a390
commit 0313811e63

View File

@ -477,10 +477,9 @@ end;
function TCustomSpeedButton.DialogChar(var Message: TLMKey): boolean; function TCustomSpeedButton.DialogChar(var Message: TLMKey): boolean;
begin begin
Result := False; Result := False;
if Message.Msg <> LM_SYSCHAR then // Sometimes LM_CHAR is received instead of LM_SYSCHAR, maybe intentionally
DebugLn(Format('*** Warning: Key %d passed to TCustomSpeedButton.DialogChar.'+ // (LCL handles it) or maybe sent by mistake. In either case exit.
' Should be LM_SYSCHAR (%d) ***', [Message.Msg, LM_SYSCHAR])); if (Message.Msg <> LM_SYSCHAR) or not FShowAccelChar then Exit;
if not FShowAccelChar then Exit;
if IsAccel(Message.CharCode, Caption) then if IsAccel(Message.CharCode, Caption) then
begin begin
Result := True; Result := True;