mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-05 15:16: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;
|
FState: TButtonState;
|
||||||
function GetNumGlyphs: Integer;
|
function GetNumGlyphs: Integer;
|
||||||
procedure GlyphChanged(Sender: TObject);
|
procedure GlyphChanged(Sender: TObject);
|
||||||
|
function DialogChar(var Message: TLMKey): boolean; override;
|
||||||
procedure MouseEnter; override;
|
procedure MouseEnter; override;
|
||||||
procedure MouseLeave; override;
|
procedure MouseLeave; override;
|
||||||
procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
|
procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
|
||||||
|
@ -402,6 +402,22 @@ Begin
|
|||||||
Invalidate;
|
Invalidate;
|
||||||
end;
|
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
|
Method: TCustomSpeedButton.Paint
|
||||||
Params: none
|
Params: none
|
||||||
|
Loading…
Reference in New Issue
Block a user