View Issue Details

IDProjectCategoryView StatusLast Update
0037210PatchesPatchpublic2020-07-06 11:05
ReporterRichard Woolf Assigned ToJuha Manninen  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version2.0.6 
Summary0037210: OnClick on opened submenu in popupmenu
DescriptionIn report 0035219, the fix created a new bug:
When a submenu in a popupmenu is opened, it is **incorrectly** calling the OnClick event of the parent menuitem.
Steps To ReproduceFor if you want to set AutoCheck is set to true:
1. Create a TPopupMenu
2. Inside it: Create a Menu Item (parent)
    Set Checked := true;
    Set AutoCheck := true;
3. Inside that menu item: Create a **sub** Menu item (child) to the right.
4. Run the program, and **hover** over the parent menu.
Problem: It toggles the 'checked' status of the parent MenuItem.

For if you want to set AutoCheck to false (here, checking is handled by the OnClick event):
1. Create a TPopupMenu
2. Inside it: Create a Menu Item (parent)
    Set Checked := true;
    Set AutoCheck := false;
3. Inside that menu item: Create a **sub** Menu item (child) to the right.
4. Create an **OnClick** event handler for the parent Menu Item:
   showmessage('Clicked!');
5. Run the program, and **hover** over the parent menu.
Problem: It triggers the OnClick event.
TagsTMenuItem, TPopupMenu
Fixed in Revisionr63518
LazTarget-
WidgetsetWin32/Win64
Attached Files

Relationships

related to 0035219 new OnClick on opened submenu in popupmenu 

Activities

Richard Woolf

2020-06-13 04:31

reporter  

Popup menu bug.jpg (16,380 bytes)   
Popup menu bug.jpg (16,380 bytes)   

Juha Manninen

2020-06-14 10:00

developer   ~0123427

Do you know how to fix it? You selected project "Patches" for this report after all. :)
If not, I will ask if the author of related issue can fix it. If he cannot then I will revert the commit.

Benito van der Zander

2020-07-05 17:05

reporter   ~0123765

Is that not right?

How does Delphi handle AutoCheck?

OnClick is called without clicking: https://stackoverflow.com/questions/2809862/how-to-detect-popup-of-a-sub-menu-of-a-popup-menu-and-how-to-populate-it-dynami

Juha Manninen

2020-07-06 11:05

developer   ~0123770

Yes, I reverted r60679. I have applied LCL-Win patches although my OS is not Windows, because they often end up being ignored otherwise.
I now ask developers who's development OS is Windows to take care of them in the future.

Issue History

Date Modified Username Field Change
2020-06-13 04:31 Richard Woolf New Issue
2020-06-13 04:31 Richard Woolf File Added: Popup menu bug.jpg
2020-06-13 04:31 Richard Woolf Issue generated from: 0035219
2020-06-13 04:31 Richard Woolf Relationship added related to 0035219
2020-06-13 04:31 Richard Woolf Tag Attached: TMenuItem
2020-06-13 04:31 Richard Woolf Tag Attached: TPopupMenu
2020-06-14 09:58 Juha Manninen Assigned To => Juha Manninen
2020-06-14 09:58 Juha Manninen Status new => assigned
2020-06-14 10:00 Juha Manninen Note Added: 0123427
2020-07-05 17:05 Benito van der Zander Note Added: 0123765
2020-07-06 11:05 Juha Manninen Status assigned => resolved
2020-07-06 11:05 Juha Manninen Resolution open => fixed
2020-07-06 11:05 Juha Manninen Fixed in Revision => r63518
2020-07-06 11:05 Juha Manninen LazTarget => -
2020-07-06 11:05 Juha Manninen Widgetset Win32/Win64 => Win32/Win64
2020-07-06 11:05 Juha Manninen Note Added: 0123770