if you are a human please do not click here
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
Username :
Password :
Home
Help
Calendar
Register
Login
XMetaL Community Forums
»
General
»
XMetaL Tips and Tricks
»
Script Example: Internet Explorer WebBrowser Control Embedded in XFT
Pages:
1
« previous
next »
Print
Author
Topic: Script Example: Internet Explorer WebBrowser Control Embedded in XFT (Read 1810 times)
Derek Read
Program Manager (XMetaL)
Administrator
Member
Posts: 1548
Script Example: Internet Explorer WebBrowser Control Embedded in XFT
«
on:
August 06, 2009, 05:58:30 PM »
XFT has a lot of the standard controls you would expect to find in such a tool and you can add more provided the controls you add to your form will also be available on your end user's machines.
However, what if you're really good (or just more comfortable) with DHTML or just prefer the ease and power of styling forms in HTML?
This example demonstrates:
1) How to write HTML into the WebBrowser control from a script running in the XFT form so the XFT is fully functional without needing to read in any external HTML files. You could install an HTML file along with the XFT instead but this seems nicer to me (though it means having to double escape some strings).
2) How to create a 'contract' between the JScript functions in the HTML page and the XFT so that the functions declared in the HTML page can obtain XMetaL Author objects and call their methods.
The WebBrowser control in this example is hosted in an XFT form, however, it could be hosted in the ResourceManager or perhaps elsewhere. Note that pretty much all Windows machines have to have this control installed as it is used by the Windows operating system itself as well as applications such as Windows Live Messenger, and even XMetaL Author's "Page Preview" view. The only likely difference between machines is the version you might have installed.
All code is commented inline in the XFT so no detailed explanation is given here. You will of course need to be able to edit XFT forms, which means you will need xflayout.exe (comes with XMetaL Developer). You do not need xflayout.exe to run this example (though if you don't have XMetaL Developer you'll need to manually create an MCR file).
Installation and Usage:
1) Save the form to a known location on your machine.
2) Create an MCR script to launch the form as follows:
var xftDlg=Application.CreateFormDlg("path to the XFT form here");
xftDlg.DoModal();
xftDlg=null;
3) Launch XMetaL Author and run the script to launch the form.
embedded_ie_example.zip
(2.76 KB - downloaded 121 times.)
screenshot.gif
(21.54 KB, 706x624 - viewed 244 times.)
Logged
Pages:
1
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General
-----------------------------
=> Forum Information
=> General XMetaL Discussion
=> DITA and XMetaL Discussion
=> XMetaL Tips and Tricks
=> XMetaL Announcements and Events
Loading...