View Issue Details

IDProjectCategoryView StatusLast Update
0021720LazarusWidgetsetpublic2014-09-21 02:20
Reportergoldenfox Assigned ToZeljan Rikalo  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version0.9.31 (SVN) 
Summary0021720: Shortcut Keys not disabled when parent menu is disabled
DescriptionShortcut keys of the sub-menus should be disabled likewise when the parent menu is disabled.

Please see attachment.
Additional InformationWindows 7 Ultimated 32bit
IDE SVN 36730
TagsNo tags attached.
Fixed in Revision46113
LazTarget-
WidgetsetQT
Attached Files

Relationships

has duplicate 0025809 closedJuha Manninen TMainMenu: can launch disabled menu items via shortcuts 

Activities

2012-04-12 02:39

 

goldenfox

2014-09-01 15:51

reporter   ~0076827

Last edited: 2014-09-01 15:52

View 2 revisions

Still present in trunk (revision 46100 as of this note).

Mukhin Alexey

2014-09-02 11:38

reporter  

issue_0021720.patch (799 bytes)   
From 509b49f2fdcb5a5339e5176d4494e1c2d2f9872e Mon Sep 17 00:00:00 2001
From: Mukhin Alexey <uskamicadze@gmail.com>
Date: Tue, 2 Sep 2014 20:34:09 +1100
Subject: [PATCH 2/2] MenuItem: close up for issue_0021720 associated with
 Shortcut Keys not disabled when parent menu is disabled

---
 lcl/include/menu.inc |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lcl/include/menu.inc b/lcl/include/menu.inc
index 2e1adff..06693cc 100644
--- a/lcl/include/menu.inc
+++ b/lcl/include/menu.inc
@@ -241,7 +241,7 @@ function TMenu.IsShortcut(var Message: TLMKey): boolean;
     if Item = nil then
       Exit;
     HandleItem(Item.Parent);
-    if Item.Enabled then
+    if FShortcutHandled and Item.Enabled then
     begin
       Item.InitiateActions;
       Item.Click;
-- 
1.7.10.4

issue_0021720.patch (799 bytes)   

goldenfox

2014-09-02 13:15

reporter   ~0076845

@Mukhin Alexey, the patch solved the problem on my machine.

Windows 8.1 32bit
Lazarus trunk

Juha Manninen

2014-09-03 00:27

developer   ~0076854

I applied the patch in r46111. Thanks.
I tested with GTK2 and QT on Linux. It works with GTK2 but not with QT. Assigning to Zeljko. Shortcuts are handled differently with QT, bypassing the LCL code.

The second shortcut never works here. It may be worth another report.

Zeljan Rikalo

2014-09-03 10:16

developer   ~0076857

Please test and close if ok. Note that second shortcuts does not work ok under gtk2 and qt (maybe under win32 too), so pls. open another issue about it.

Issue History

Date Modified Username Field Change
2012-04-12 02:39 goldenfox New Issue
2012-04-12 02:39 goldenfox File Added: menushortcut-goldenfox.zip
2012-04-12 02:39 goldenfox Widgetset => Win32/Win64
2014-09-01 15:51 goldenfox Note Added: 0076827
2014-09-01 15:52 goldenfox Note Edited: 0076827 View Revisions
2014-09-02 11:38 Mukhin Alexey File Added: issue_0021720.patch
2014-09-02 13:15 goldenfox Note Added: 0076845
2014-09-02 23:55 Juha Manninen Assigned To => Juha Manninen
2014-09-02 23:55 Juha Manninen Status new => assigned
2014-09-03 00:27 Juha Manninen Note Added: 0076854
2014-09-03 00:27 Juha Manninen Assigned To Juha Manninen => Zeljan Rikalo
2014-09-03 00:28 Juha Manninen LazTarget => -
2014-09-03 00:28 Juha Manninen Widgetset Win32/Win64 => QT
2014-09-03 00:28 Juha Manninen Category IDE => Widgetset
2014-09-03 00:36 Juha Manninen Relationship added duplicate of 0025809
2014-09-03 00:36 Juha Manninen Relationship replaced has duplicate 0025809
2014-09-03 10:16 Zeljan Rikalo Fixed in Revision => 46113
2014-09-03 10:16 Zeljan Rikalo Note Added: 0076857
2014-09-03 10:16 Zeljan Rikalo Status assigned => resolved
2014-09-03 10:16 Zeljan Rikalo Resolution open => fixed