implement calling TSpeedButton.Click for accelerator key (issue #7911, patch by Boguslaw Brandys)

git-svn-id: trunk@10590 -
This commit is contained in:
micha 2007-02-05 17:32:20 +00:00
parent d79e783bb4
commit ef8bd1af9f
2 changed files with 17 additions and 0 deletions

View File

@ -303,6 +303,7 @@ type
FState: TButtonState;
function GetNumGlyphs: Integer;
procedure GlyphChanged(Sender: TObject);
function DialogChar(var Message: TLMKey): boolean; override;
procedure MouseEnter; override;
procedure MouseLeave; override;
procedure MouseDown(Button: TMouseButton; Shift: TShiftState;

View File

@ -402,6 +402,22 @@ Begin
Invalidate;
end;
function TCustomSpeedButton.DialogChar(var Message: TLMKey): boolean;
begin
Result := false;
Assert(Message.Msg = LM_SYSCHAR, '*** Warning: non LM_SYSCHAR passed to TCustomSpeedButton.DialogChar ! ***');
if not FShowAccelChar then exit;
if IsAccel(Message.CharCode, Caption) then
begin
Result := true;
Self.Click;
end else
Result := inherited DialogChar(Message);
end;
{------------------------------------------------------------------------------
Method: TCustomSpeedButton.Paint
Params: none