Vs owner and Taction hotkeys on frames

I have a form with a panel.

I create frames at runtime and display them in the panel, setting the property of the parent element in the panel.

When creating panels, I do not set the owner property because I control the frame lifetime.

So far I have not had a problem. Then I put the TActionList in the frame with some labels on the actions.

I found that my actions were not performed until I set the frame owner property to the panel.

Can anyone explain this to me? I thought that the property of the owner was due to the fact that the component is responsible for releasing the child components and is not responsible for sending key events.

+6
delphi
source share
2 answers

Form label processing is performed in TCustomForm.IsShortCut , where components are repeated, including TActionsLists. As long as the frame does not belong to the form, none of the action lists in the frame were found during the iteration. You can get around this by changing the owner of the action list or the full frame to the form while the frame is attached to the panel. Change of ownership after creation can be done using InsertComponent .

+5
source share

The owner is mainly about life management. But there is at least a poOwnerFormCenter that the Owner uses for a completely different purpose. And you probably stumbled upon another target.

+1
source share

All Articles