Additions:
Working with popup windows
For advanced users only
Please see the help topic about popup windows:
Popup Windows in Ebooks∞
Remember that popups are only handled by
Internet Explorer-based publications (and Self-Extracting ones of course).
Deletions:
Working with popup windows
For advanced users only
Popups (new navigation windows without menu bar, tool bar or status bar) are not officially supported because this feature requires a lot of testing, and it may also not work exactly as in Internet Explorer. However, in some cases, popups are useful (display a site contents, log in dialog...); that's why this article explains you
how to open display compiled web pages in new popups.
First remember that popups are only handled by
Internet Explorer-based publications (and Self-Extracting ones of course).
How to open a popup window?
There are several ways to open a new popup window from your HTML pages:
- with a standard <A HREF> hyperlink tag: use the target parameter _hepopup_ followed by the name of your popup window (no space, alphanumeric characters only).
Example :
<a href="popup.html" target="_hepopup_pop1">Open popup.html in a new window
</a>
The popup's name will be
pop1 and this popup will show the compiled webpage named
popup.html.
You can also use external links like
http://www.htmlexe.com∞:
<a href="http://www.htmlexe.com" target="_hepopup_web">See our website
</a>
Here the popup's name is
web
- with HEScript: an internal HEScript procedure Showpopup is available and lets you specify additional parameters for your popup window.
Syntax:
procedure ShowPopup(const Name, URL: String; Width, Height, Top, Left: Integer; IsModal, RedirectLinksToMain: Boolean);
Name: name of your popup window.
URL: url to the page that should be displayed. It can be a virtual path to a compiled page or a full URL.
Width, Height: width and height of the popup window (in pixels).
Left, Top: x and y screen coordinates of the top-left corner (in pixels).
IsModal: always set the value to false.
RedirectLinksToMain: whether you want the popup window to redirect all hyperlinks to the main window (when a user clicks on a link, the page is displayed in the main window). Could be useful for website contents.
Example: you could associate the following Boolean function
OnMyMenuClick with a
custom menu command∞ or a
toolbar button∞.
function OnMyMenuClick: Boolean;
begin
ShowPopup("mypopup", "help/tellmemore.htm", 400, 300, 50, 25, false, true);
end;
Additionally you could add the following HEScript commands to your
UserMain script:
{
NewWindow: opens a new popup window.
URL : url to the page to display
WindowName: name of the popup (for targets and other functions).
width: width of the popup
height: height of the popup
top: y screen position of the popup
left: x screen position of the popup
redirect: if "1", then all links are redirected to the main window.
}
procedure NewWindow(Url, WindowName, Width, Height, Top, Left, Redirect: String);
begin
ShowPopup(WindowName, Url, StrToInt(width), StrToInt(height), StrToInt(top),StrToInt(left), false, Redirect = "1");
end;
In this case, you can now display any popup you want without having to create a specific HEScript function for each popup.
To call the previous
NewWindow function from your HTML pages, use:
<a href="hescript://UserMain.newwindow|popup.html|pop1|200|100|50|80|0">Open a new window
</a>
Syntax:
function window.external.ShowPopup(Name, URL, Width, Height, Top, Left, Param);
Name: name of your popup window.
URL: url to the page that should be displayed. It can be a virtual path to a compiled page or a full URL.
Width, Height: width and height of the popup window (in pixels).
Left, Top: x and y screen coordinates of the top-left corner (in pixels).
Param: always set the value to 0.
Examples:
- directly in HTML
<a href="javascript:window.external.ShowPopup('newwindow', 'popup.html', 200,100,50,80,0);">Open a new window JS
</a>
- In a script
function displaypopup(url)
{
window.external.ShowPopup('newwindow', url, 200,100,50,80,0);
}
How to close a popup window?
You can either use the HEScript function:
procedure ClosePopup(const Name: String);
or the
JavaScript one:
window.external.ClosePopup(Name);
To
close all popup windows, use the HEScript function
CloseAllPopups
procedure CloseAllPopups;
Notes
- popup windows do not have tool bar, menu bar nor status bar. There is no navigation controls available, and their context menu is automatically disabled (you can activate it using a special command, please contact us if you want it). So your users can't use Back/Forward page navigation commands.
- when a popup is displayed, the UserMain's HEScript event OnDisplayWindow is fired.
- when a popup is closed, the UserMain's HEScript event OnCloseWindow is fired.
- avoid opening several popup windows (to save resources on old computers).
If you need help about opening popups, feel free to
contact the technical support∞.
Working with popup windows
For advanced users only
Popups (new navigation windows without menu bar, tool bar or status bar) are not officially supported because this feature requires a lot of testing, and it may also not work exactly as in Internet Explorer. However, in some cases, popups are useful (display a site contents, log in dialog...); that's why this article explains you
how to open display compiled web pages in new popups.
First remember that popups are only handled by
Internet Explorer-based publications (and Self-Extracting ones of course).
How to open a popup window?
There are several ways to open a new popup window from your HTML pages:
- with a standard <A HREF> hyperlink tag: use the target parameter _hepopup_ followed by the name of your popup window (no space, alphanumeric characters only).
Example :
<a href="popup.html" target="_hepopup_pop1">Open popup.html in a new window
</a>
The popup's name will be
pop1 and this popup will show the compiled webpage named
popup.html.
You can also use external links like
http://www.htmlexe.com∞:
<a href="http://www.htmlexe.com" target="_hepopup_web">See our website
</a>
Here the popup's name is
web
- with HEScript: an internal HEScript procedure Showpopup is available and lets you specify additional parameters for your popup window.
Syntax:
procedure ShowPopup(const Name, URL: String; Width, Height, Top, Left: Integer; IsModal, RedirectLinksToMain: Boolean);
Name: name of your popup window.
URL: url to the page that should be displayed. It can be a virtual path to a compiled page or a full URL.
Width, Height: width and height of the popup window (in pixels).
Left, Top: x and y screen coordinates of the top-left corner (in pixels).
IsModal: always set the value to false.
RedirectLinksToMain: whether you want the popup window to redirect all hyperlinks to the main window (when a user clicks on a link, the page is displayed in the main window). Could be useful for website contents.
Example: you could associate the following Boolean function
OnMyMenuClick with a
custom menu command∞ or a
toolbar button∞.
function OnMyMenuClick: Boolean;
begin
ShowPopup("mypopup", "help/tellmemore.htm", 400, 300, 50, 25, false, true);
end;
Additionally you could add the following HEScript commands to your
UserMain script:
{
NewWindow: opens a new popup window.
URL : url to the page to display
WindowName: name of the popup (for targets and other functions).
width: width of the popup
height: height of the popup
top: y screen position of the popup
left: x screen position of the popup
redirect: if "1", then all links are redirected to the main window.
}
procedure NewWindow(Url, WindowName, Width, Height, Top, Left, Redirect: String);
begin
ShowPopup(WindowName, Url, StrToInt(width), StrToInt(height), StrToInt(top),StrToInt(left), false, Redirect = "1");
end;
In this case, you can now display any popup you want without having to create a specific HEScript function for each popup.
To call the previous
NewWindow function from your HTML pages, use:
<a href="hescript://UserMain.newwindow|popup.html|pop1|200|100|50|80|0">Open a new window
</a>
Syntax:
function window.external.ShowPopup(Name, URL, Width, Height, Top, Left, Param);
Name: name of your popup window.
URL: url to the page that should be displayed. It can be a virtual path to a compiled page or a full URL.
Width, Height: width and height of the popup window (in pixels).
Left, Top: x and y screen coordinates of the top-left corner (in pixels).
Param: always set the value to 0.
Examples:
- directly in HTML
<a href="javascript:window.external.ShowPopup('newwindow', 'popup.html', 200,100,50,80,0);">Open a new window JS
</a>
- In a script
function displaypopup(url)
{
window.external.ShowPopup('newwindow', url, 200,100,50,80,0);
}
How to close a popup window?
You can either use the HEScript function:
procedure ClosePopup(const Name: String);
or the
JavaScript one:
window.external.ClosePopup(Name);
To
close all popup windows, use the HEScript function
CloseAllPopups
procedure CloseAllPopups;
Notes
- popup windows do not have tool bar, menu bar nor status bar. There is no navigation controls available, and their context menu is automatically disabled (you can activate it using a special command, please contact us if you want it). So your users can't use Back/Forward page navigation commands.
- when a popup is displayed, the UserMain's HEScript event OnDisplayWindow is fired.
- when a popup is closed, the UserMain's HEScript event OnCloseWindow is fired.
- avoid opening several popup windows (to save resources on old computers).
If you need help about opening popups, feel free to
contact the technical support∞.