mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 05:39:29 +02:00
lcl: when menu shortcut is executed perform action update and click starting from the parent to node (this is delphi compatible behavior). Fixes issue #0015427
git-svn-id: trunk@23311 -
This commit is contained in:
parent
8f7b3f6e4b
commit
a35c06eeb7
@ -246,6 +246,19 @@ begin
|
||||
end;
|
||||
|
||||
function TMenu.IsShortcut(var Message: TLMKey): boolean;
|
||||
|
||||
procedure HandleItem(Item: TMenuItem);
|
||||
begin
|
||||
if Item = nil then
|
||||
Exit;
|
||||
HandleItem(Item.Parent);
|
||||
if Item.Enabled then
|
||||
begin
|
||||
Item.InitiateActions;
|
||||
Item.Click;
|
||||
end;
|
||||
end;
|
||||
|
||||
var
|
||||
Item: TMenuItem;
|
||||
Shortcut: TShortcut;
|
||||
@ -258,9 +271,8 @@ begin
|
||||
//DebugLn(['TMenu.IsShortcut ',dbgsName(Self),' Result=',Result,' Message.CharCode=',Message.CharCode,' ShiftState=',dbgs(ShiftState)]);
|
||||
if Result then
|
||||
begin
|
||||
FShortcutHandled := true;
|
||||
Item.InitiateActions;
|
||||
Item.Click;
|
||||
FShortcutHandled := True;
|
||||
HandleItem(Item);
|
||||
Result := FShortcutHandled;
|
||||
end;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user