Browser Control for OpenInsight
OpenInsight 10 introduces a new "browser" control that can be used to display any HTML content, either from the internet, from an intranet, or produced directly in OpenInsight. This control "wraps" the Chromium Embedded Framework object, most commonly seen in the Google Chrome browser.
This control forms the basis for the O4W_CHILD_FORM (see more information about the O4W_CHILD_FORM ), but can also be used separately in your own form.
To use the new browser control, you must create an OLE object on your form, and set the "Text" property of that control to ChromeOI.CEFBrowser. You can then set the properties below, or invoke the methods below, to control the display.
Note that there is also a "helper utility", RTI_CEF_OLE_EVENTS, that can be called to properly process the OLE events. To use RTI_CEF_OLE_EVENTS, be sure to register your stored procedure to handle OLE events, and when they occur, you can use the following code:
CALL RTI_CEF_OLE_EVENTS(param1, param2, winID$, statusLine$)
Where "param1" and "param2" are the first two parameters passed into your commuter module after the control entity ID and the "method" arguments, winID$ is the name of the window, and statusLine$ is the name of the status line control (if any) that should be updated with status information.
Methods
Back: Navigates backwards through the browser history
Copy: copies the currently-selected text into the clipboard
Cut: cuts the currently-selected text into the clipboard
Forward: Navigates forwards through the browser history
Navigate2: pass in a URL to have the browser load the specified page
Paste: pastes the contents of the clipboard into the browser at the current cursor position
Reload: Reloads (refreshes) the current page
Save: pass in the full path and file name where the html of the current page should be saved
setHTML: pass in the html, and the "base file URL" (the URL that you want to "pretend" this page came from, so that things like images, etc. can be loaded from that location)
ShutdownOK: returns "1" if it's ok for the browser to shut down (ie, it's not in a busy state)
Shutdown: tells the browser control to shut down
StopLoad: stops loading the current page
Zoom: pass in an increment (for example, "+.1" or "-.1") to increase/decrease the text size
Properties
CanGoBack: (read only) Returns 0/1 if the browser cannot/can go 'back' in history
CanGoForward: (read only) Returns 0/1 if the browser cannot/can go 'forwards' through history
Debug: Set to 0/1 to disable/enable additional debug output
DefaultURL: Set to the URL you wish the control to display at startup
HTML: (read only) Returns the current page's HTML
History: (read only) Returns a list of the URLs that the browser control has visited
ShowContextMenu: pass in 0/1 to disable/enable the browsers own context menu
OLE Events
(Event passed in "param1", with details in "param2"):
BrowserDownload: details are "file name":@TM:"file type":@TM:"binary flag":@TM:"content"
BrowserEvent: details are "event type":@TM:"event details". Event types are "title", "navigating", "navigated", "validating", "validated", "DocumentCompleted", "status", "tooltip", "message" and "windowClosed"
BrowserNewWindow: details are "destination":@TM:"window name"