mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-01 17:36:25 +02:00
implement calling TSpeedButton.Click for accelerator key (issue #7911, patch by Boguslaw Brandys)
git-svn-id: trunk@10590 -
This commit is contained in:
parent
d79e783bb4
commit
ef8bd1af9f
@ -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;
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user