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:
procedure TExplorerForm.BrowserCommand(Command, Parameters: String);
begin
// Show a form over the browser page
if Command='form' then
begin
HideAllPanels ;
FormExample.SubPanel.parent := Panel ;
if Parameters = 'show' then
FormExample.ShowControls ( true ) ;
if Parameters = 'showdisabled' then
FormExample.ShowControls ( false ) ;
FormExample.SubPanel.Visible := true ;
Panel.visible := true ;
end ;
// Show the message using the parameters
if Command='dialog' then
ShowMessage ( 'You have clicked the ' +
Parameters + ' link' ) ;
...
...
end ;
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 page loading, when the link is reached, the browser raise this event. 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 main panel.
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.