문제

When the number of actions in DXE IDE grows, in a single actionlist, it quickly becomes hard to locate the action you want to inspect or change.

There is no search / filter box like there is for components, and actions are not automatically sorted. Sorting action declarations in code does not alter the order in which they are displayed in the actionlist editor.

Not even incremental search works: if you focus the actionlist pane and start typing, the keypresses go to the object inspector (and you inadvertently change some property or other). Major annoyance!

Is there perhaps a hidden setting, a registry hack (there are quite a few for Delphi), or maybe a third-party extension that would keep actions sorted?

도움이 되었습니까?

해결책

You could sort them in the dfm file. You would want to write a little utility script to do it.

Or a workaround would be to use categories to make the list of actions more manageable.

다른 팁

Write a small IDE plugin that extends the context menu of a TActionList with a Sort option. For sorting the actionlist you can use this code:

procedure SortActions(ActionList: TActionList);
var
  act: TContainedAction;
  arr: TArray<TContainedAction>;
  I: Integer;
begin
  SetLength(arr, ActionList.ActionCount);
  for I := 0 to ActionList.ActionCount - 1 do begin
    arr[I] := ActionList[I];
  end;
  TArray.Sort<TContainedAction>(arr,
    TDelegatedComparer<TContainedAction>.Create(
      function(const Left, Right: TContainedAction): Integer
      begin
        result := CompareText(Left.Name, Right.Name);
      end));
  for I := 0 to High(arr) do
    arr[I].Index := I;
end;
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top