Skip to content

TFmxHelpChatAI reference ​

Unit FMX.HelpChatAI · package HelpChatAIFmx · palette group Ethea HelpChatAI · Delphi 12 and later.

The FireMonkey twin of TVclHelpChatAI: same engine, same page, same events. Only what FireMonkey does differently is different.

Published properties ​

PropertyTypeDefaultDescription
SettingsTHelpChatSettingsSee the Settings reference
ActiveBooleanFalseStarts engine, transport and hooks
RegisterHelpViewerBooleanTrueRegister with System.HelpIntfs, for code that calls the help system
HandleF1BooleanTrueF1 on the host form opens the chat (its OnKeyDown is chained)
Captionstring(empty)Title of the window the chat opens in when it is not embedded. Empty = the localized "Help" / "Aiuto"
AssistantNamestring(empty)What the assistant is called, written in the header of the panel next to its icon. Empty = the localized "Assistant" / "Assistente"
ShowBubbleBooleanTrueThe round button with the assistant icon, in the bottom-right corner of the host form
ImagesTCustomImageListnilImage list holding the bubble icon; nil uses the icons compiled into the component. The same icon is drawn in the header of the chat panel
ImageIndexTImageIndex-1The icon by position. With no image list of your own it picks among the built-in ones
ImageNamestring(empty)The icon by name: AIAssistant_Male, AIAssistant_Female, Assistant_Male, Assistant_Female. The Object Inspector drops down the four
ConfigFileNameTFileName(empty)The configuration file. Empty = merge the three standard helpchatai.json on activation; named = that one and nothing else, raising EHelpChatConfigError if it is not there
ActionsEnabledBooleanTrueOffer the registered actions to the model
RememberPanelPositionBooleanTrueReopen the own window where the user left it
ThemeModeTFmxHelpChatThemeModetmAutotmAuto (page defaults, following the system), tmLight, tmDark
ContainerTFmxObjectnilWhere the chat is embedded; nil = the component's own window
PanelWidthInteger400Size of the own window
PanelHeightInteger600

Published events ​

Identical to the VCL ones, except that OnBeforeShowHelp carries a TFmxObject:

EventSignature
OnGetContext(Sender; var AContext: THelpChatContext)
OnGetTheme(Sender; var ATheme: THelpChatTheme)
OnBeforeShowHelp(Sender; var AContainer: TFmxObject)
OnAfterShowHelp / OnBeforeHideHelp / OnAfterHideHelp(Sender)
OnActionConfirm(Sender; const AName; const AArgs; var AAllow)
OnActionExecuted(Sender; const AName; const AOutcome; const AResult)

Confirmation is not optional in FMX

With no OnActionConfirm, an action marked Confirm is refused: there is no dialog that can be waited for on every FireMonkey platform, and a worker thread is waiting for the answer.

Methods ​

Same as the VCL — Open, OpenForCurrentScreen, OpenForHelp, OpenWithQuestion, Close, Toggle, IsPanelVisible, BuildContext, BuildTheme, ApplyTheme — plus:

MethodDescription
HandleKeyDown(var AKey: Word; const AShift: TShiftState): BooleanCall it from the OnKeyDown of any other form to give it F1 too. Returns True when it consumed the key

Public properties ​

Actions, Engine, Transport, ActiveContainer as in the VCL; View is a TFmxHelpChatPanel and OwnForm a TFmxHelpChatForm. HostForm (TCommonCustomForm) is public and not published, as in the VCL: set it in code, because at design time there would be nothing to choose from.

Minimal example ​

pascal
uses HelpChatAI.Types, FMX.HelpChatAI;

procedure TMainForm.FormCreate(Sender: TObject);
begin
  HelpChatAI.Settings.Provider := 'docsearch';
  HelpChatAI.Settings.DocIndexFile := TPath.Combine(
    TPath.GetDirectoryName(ParamStr(0)), 'help-index.json');
  HelpChatAI.ThemeMode := tmAuto;
  HelpChatAI.Active := True;
end;

procedure TMainForm.FormKeyDown(Sender: TObject; var Key: Word;
  var KeyChar: WideChar; Shift: TShiftState);
begin
  HelpChatAI.HandleKeyDown(Key, Shift);
end;

Platform notes ​

  • Windows: WebView2 (WindowsEngine = EdgeOnly), verified.
  • macOS, iOS, Android: the native web view; the code compiles but has not been tested yet.
  • Delphi 12: a navigation outside the panel cannot be cancelled (OnShouldLoadURL arrived in Delphi 13), so an external link opens in the system browser and the panel returns to its own page.
  • On mobile, use a remote server: no local HTTP server, no key in the package.

Released under the Apache License 2.0