unit unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls,
Menus, LCLIntf, MacOSAll;
type
{ TForm1 }
TForm1 = class(TForm)
MainMenu1: TMainMenu;
MenuItem_AppHelp: TMenuItem;
MenuItem_Help: TMenuItem;
procedure FormShow(Sender: TObject);
procedure MenuItem_AppHelpClick(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
function GetResourcesPath(): string;
var
pathRef: CFURLRef;
pathCFStr: CFStringRef;
pathStr: shortstring;
begin
pathRef := CFBundleCopyBundleURL(CFBundleGetMainBundle());
pathCFStr := CFURLCopyFileSystemPath(pathRef, kCFURLPOSIXPathStyle);
CFStringGetPascalString(pathCFStr, @pathStr, 255, CFStringGetSystemEncoding());
CFRelease(pathRef);
CFRelease(pathCFStr);
Result := pathStr + '/Contents/Resources/';
end;
procedure TForm1.MenuItem_AppHelpClick(Sender: TObject);
var
helpPath: String;
begin
helpPath := GetResourcesPath + 'MyApp.help';
OpenDocument(helpPath );
end;
procedure TForm1.FormShow(Sender: TObject);
begin
ShowMessage('Help Help');
end;
end.