Custom HTML Dialog Boxes

Applies to HTML Viewer, IE Browser publications.

HTML Executable lets you display your own dialog boxes to end users. Dialog boxes are actually HTML pages associated to an HEScript script. You can manage them in the "Application Behavior => Dialog Boxes" page.

Example: click this button to display a blank dialog box:

imgYou will find ready-to-use dialog templates in the "CustomDialogs" subfolder of HTML Executable. You should start writing a custom dialog from the DummyDialog template. This folder also contains a Readme.txt with additional instructions that you should read.

imgCustom dialogs (HTML pages and scripts) are stored in XML files. HTML Viewer and IE Browser publications do not share the same dialog boxes because their HTML engines are not the same. Consequently, an XML file contains two code versions of the dialog box: one for HTML Viewer publications, and one for IE publications.

imgWhen a custom dialog is imported, both the dialog box's code and its script are added to their respective lists (Dialog Boxes and User Scripts). You are also prompted to provide an identifier for the new dialog box. This identifier is used to invoke the dialog box with scripting.

img

An identifier for an user-imported dialog box always begins with "user" + a unique alphanumeric expression.

imgA script for a custom dialog box contains script events that are called by form controls like the OK or Cancel buttons:

  • procedure OnInitialization; is called before the dialog box is shown.
  • procedure OnShowDialog2; is called when the dialog box is displayed.

img

IMPORTANT: to close the current dialog box, you should call the CloseCurrentDialog HEScript function.

imgTo invoke a custom dialog, use the DisplayCustomDialog HEScript function. For instance,

DisplayCustomDialog("dialog identifier", false);

For further details, please see Readme.txt in the "CustomDialogs" subfolder of HTML Executable.

Example of a full dialog script:

procedure OKDialog;
begin
// Close the dialog.
CloseCurrentDialog;
end;

procedure OnInitialization;
begin
// Ensure the <div> named divreg is visible
ShowHTMLBlockID("divreg", true);
end;

About

This is the online documentation of HTML Executable.

About HTML Executable

HTML Executable is a versatile HTML compiler and ebook compiler: it lets you create secure ebooks and desktop applications with your websites, HTML or PDF documents.

You can easily create attractive ebooks, full-featured HTML applications (RIA) and software, digital publications from your websites, PDF files and HTML documents for online or offline distribution.

Learn more - Free Trial