[Lazarus] TAction and Short-cut conflicts

R.Smith ryansmithhe at gmail.com
Mon May 25 21:19:40 CEST 2020


I've been using the TActionList and TAction objects, which I think is 
not only making life easier, but a good design choice, and it's been 
working a treat.

One niggle is, when I assign a short-cut to a TAction and then assign 
that TAction to any of the action-enabled controls, it lists the 
shortcut in the conflict list, which is a false positive - it's ok with 
a shortcut item to conflict with itself or it's own action (impossible 
not to, actually).

To be precise - say I have a TAction named actCut to cut text, set the 
Shortcut to "Ctrl+X", then assign the action to one menu item in my 
TMainMenu, say mmnuCut (which is new and had no other properties 
changed), I then will see the following in my ShortCut conflict list 
(accessed via the Right-click in the Menu editor --> Shortcuts --> 
Resolve Shortcut conflicts):

- Resolved Conflicts: 0

- Remaining Conflicts: 1
  "Ctrl+X" in actCut conflicts with "Ctrl+X" in mmnuCut
...

What's worse, if I also assign the same Action to another menu item 
(which is the point of using actions) in the pop-up context menu, say 
puCut, I can see a three-way false-positive like this:

  "Ctrl+X" in actCut conflicts with "Ctrl+X" in mmnuCut
  "Ctrl+X" in actCut conflicts with "Ctrl+X" in puCut
  "Ctrl+X" in puCut conflicts with "Ctrl+X" in mmnuCut

I use many Actions and shortcuts, so now resolving any REAL conflicts 
becomes really hard.

So before I log a bug report, let me ask the community first:
- Is this a bug?
- Is it a feature request?
- Is it a stupidity and there is some config setting I'm missing?

Also, in the conflict list, if the window is resized, the inner panel 
does not - like someone forgot to swicth its Align from alTop to alClient.

-------- Technical-----------------------------
A conflict should only be positive is:
1 . The conflict is NOT between a control and its own action,
2.  The conflict is NOT with a control which uses the same action -
   2.1  Unless the Shortcut does not originate from the shared Action 
itself.
-------------------------------------------------

Thank you kindly,
Ryan




More information about the lazarus mailing list