Class helper for updating a TActionList

On occasions I've wanted to provoke all actions in an action list to update themselves - when waiting for the application to update them when idle isn't soon enough.

I would have thought that TActionList would have a suitable method, but it doesn't seem to.

To save having to come up with the same hack over and again, I've started using this class helper:

  TActionListHelper = class helper for TCustomActionList
    procedure Update;
procedure TActionListHelper.Update;
  Action: TContainedAction;
  for Action in Self do

You can now update all the actions in an action list by calling the Update that has been injected into any TActionList instance.

Seems to work so I thought I'd share it.

If you've got a better way, please comment.


Popular posts from this blog

Focus On: Deleaker - a Delphi, C++ & C# Memory Leak Detector

Embarcadero Announce RAD Studio 11 Is Coming

Some Features of the Upcoming Delphi 11 (probably)