Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2017-04

Win32 setting menu shortcut

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Alexey

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

Reply by email