TMainMenu/TPopupMenu: "ENTER method" for editing menu item captions is broken since Laz 3.0
- Lazarus/FPC Version: Lazarus 3.99 (rev main_3_99-2223-gf46d09e16f) FPC 3.2.2 i386-win32-win32/win64, all version back to Laz 3.0 affected
- Operating System: Windows 11, issue occurs also in Linux.
- CPU / Bitness: Intel, 64bit (IDE 32 bit, or 64 bit, both affected)
What happens
There is a little-known method how to quickly enter the caption of menu items without having to go to the Object Inspector and the Caption property: When a newly created menu item is selected in the menu editor and ENTER is pressed, an edit box appears in the menu editor in which the Caption of the new menu item can be entered conveniently. This used to work until Laz 2.2.6, but is broken since Laz 3.0: When the first character is typed the Object Inspector is focused on its currently selected property, usually the Action property. This makes this feature useless.
What did you expect
Behaviour like in Laz 2.2.6: Keypresses should go into the edit box in the menu editor.
Steps to reproduce
- Add a TMainMenu or TPopupMenu to the form. Double-click on it to open the menu editor.
- Click on the field "+ Add menu item" in the menu editor -> the menu bar appears with the first menu item having the Caption "MenuItem1"
- Press ENTER
- An edit box appears in the menu bar (there are some display issues here - see screenshot)
- Begin to type the Caption of the menu item --> after the first (and any other) key press, the Object Inspector is activated in the "Action" property.
In my opinion this feature is a bit more complicated than the usual way to select the Caption property in the ObjectInspector after creating the first menu item, since this property remains focused after adding further items in the menu editor and the captions can be typed immediately. Therefore, I'd vote to remove it completely. This would also "fix" the display issues.