The 1st function can call 2nd and be simple.

function CompleteMenuItemCaption(const AMenuItem: TMenuItem; Spacing: String): string;
begin
  Result := AMenuItem.Caption;
  if AMenuItem.ShortCut <> scNone then
    Result := Result + Spacing + MenuItemShortCut(AMenuItem);
end;

(* Idem with external string caption *)
function CompleteMenuItemStringCaption(const AMenuItem: TMenuItem; ACaption: String; Spacing: String): string;
begin
  Result := ACaption;
  if AMenuItem.ShortCut <> scNone then
    Result := Result + Spacing + MenuItemShortCut(AMenuItem);
end;


--
Regards,
Alexey

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus-ide.org/listinfo/lazarus

Reply via email to