New events
OnCommand ( Command, Parameters :
string )
This event is raised when the user clicks on a HREF
formatted as described in the commandPrefix property.
Only correctly formatted HREFs raise the OnCommand event.
Other HREFs (even incorrect commands) are treated as normal URL.
This is an example of code for an OnCommand event:
OnBeforeNavigate (Sender: TObject; pDisp:
IDispatch;
var URL, Flags, TargetFrameName PostData,
Headers: OleVariant; var Cancel: WordBool)
This event is raised before the browser starts loading a
page. Note that this event is not called if the URL is a correctly formatted command. In
this case only the OnCommand event is raised.
With this event you can control if the URL is reachable
(speaking about off line applications) and, if it is out of your intranet, you can set the
Cancel flag to stop the browser.
Otherwise, you can avoid your user to reach some bad site.
OnNavigateComplete (Sender: TObject; pDisp:
IDispatch;
var URL: OleVariant)
After the load of the page, when the link is reached, the
browser raise this event. This event is raised before the browser starts loading a page.
You can use this event to control in a more efficent way
the show/hiding of panels and controls.
In this example, I've used this event to manage the hiding
of the database panel, because only for the first form is used the Panel property.
Note that I've used the two methods only to show you how to
use. In my programs I use only the OnNavigateComplete event to decide which panel show or
hide.
Main derived events
OnDocumentComplete (Sender: TObject;
pDisp: IDispatch;
var URL: OleVariant)
This event is raised only when all page
component are correctly loaded.
OnStatusTextChange (Sender: TObject;
const Text: WideString)
This event inform you when there is a change
on the status text. You can show this text on your status bar to have a correct look and
feel.
OnProgressChange (Sender: TObject;
Progress, ProgressMax: Integer)
During document load, to avoid the user jawns, you can show
a progress bar.
Use this event to show something on an intranet connection
is not very useful. Maybe you can enable this during internet connections, if your
application let.
OnTitleChange (Sender: TObject; const Text:
WideString)
As the name says, this event is raised when the browser
loads a page with another title.
You can show this text on your title bar, changing the main
form caption.
|