Working with pop-up windows |
Applies to IE Browser publications. HTML Executable lets you open several windows called pop-up windows (or popups) in the same IE browser publication; thus your users can see additional information without navigating away from the current page in the main window. Popup windows are windows without menu bar, tool bar or status bar. Each popup has a unique name. How to open a popup windowThere are several ways to open a new popup window from your HTML pages:
Examples:
The popup's name will be pop1 and this popup will show the compiled webpage named popup1.htm You can also use external links like http://www.htmlexe.com:
window.open will only take account of the "width" and "height" parameters if available. If you want to set the position too, use window.external.ShowPopup instead.
Syntax for window.external.ShowPopup: function window.external.ShowPopup(Name, URL, Width, Height, Top, Left, Param); Name: name of your popup window. Note: to create a screen-centered popup, set both Left and Top to -1. All parameters are required.
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). If both set to -1, the popup appears centered. 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 a link, the page is displayed in the main window). Could be useful for website contents. Example: you could associate the following procedure (ShowFirstPopup) with a custom menu command or a toolbar button. procedure ShowFirstPopup;
begin
ShowPopup("mypopup", "popup1.htm", 400, 300, 50, 25, false, false);
end;Additionally you could add the following HEScript commands to your UserMain script:
In that case, you can now display any popup you want without having to create a specific HEScript function for each popup. <a href="hescript://UserMain.newwindow|popup1.html|pop1|200|100|50|80|0">Open a new window</a> How to close a popup window
End users may be prompted by Internet Explorer if they want to close the window.
Contrary to the previous one, this function does not ask end users whether they want to close the popup window.
Example: Open the popup / Close the popup This function also exists in HEScript: procedure ClosePopup(const Name: String);
procedure CloseAllPopups; How to modify a popup size/positionYou can set up properties for popup windows using the SetUIProp function (available as HEScript or window.external JavaScript extension). JavaScript Syntax: window.external.SetUIProp('popup_[name]', 'property name', 'property value');Available property names are Left (x position), Top (y position), Width, Height, Caption (window title). Example: we want to move an existing popup to another location. We can use this JavaScript code:
|