OnClick on opened submenu in popupmenu
Original Reporter info from Mantis: rfwoolf
-
Reporter name: Richard Woolf
Original Reporter info from Mantis: rfwoolf
- Reporter name: Richard Woolf
Description:
In 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 reproduce:
For if you want to set AutoCheck is set to true:
- Create a TPopupMenu
- Inside it: Create a Menu Item (parent)
Set Checked := true;
Set AutoCheck := true;
- Inside that menu item: Create a sub Menu item (child) to the right.
- 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):
- Create a TPopupMenu
- Inside it: Create a Menu Item (parent)
Set Checked := true;
Set AutoCheck := false;
- Inside that menu item: Create a sub Menu item (child) to the right.
- Create an OnClick event handler for the parent Menu Item:
showmessage('Clicked!');
- Run the program, and hover over the parent menu.
Problem: It triggers the OnClick event.
Mantis conversion info:
- Mantis ID: 37210
- Build: Lazarus 2.0.6
- Version: 2.0.6
- Fixed in revision: r63518 (#c8da6308)