CreateHTMLView( x,y,width,height,group[,style] )

Parameters

x,y,width,height - Initial shape of the htmlview gadget
group - A group gadget handle
style (optional) - Style flag:
0: Nothing (default)
1: NOCONTEXTMENU
2: NONAVIGATE

Description

Creates an htmlview gadget and returns its handle.

The optional style parameter allows you to change the behaviour of the htmlview gadget. Specifying a value of 1 (NOCONTEXTMENU), will disable the right-button menu. A value of 2 (NONAVIGATE), will stop the user navigating links and will generates a gadget event so you can intercept them.

The gadget events that are generated have eventdata settings 0=loaded 1=usernavigate. 0 is generated when a page's html has loaded after using HtmlViewGo . 1 is generated when a user clicks a link (but only when style is set to NONAVIGATE).

About the htmlview gadget:

Htmlview gadgets allow you to display html documents - useful for help files and so on. It is based on the Microsoft Internet Explorer control, and as such everything supported by the version of Internet Explorer that the user has installed will work. Note that this can be both a blessing (CSS and JavaScript support) and a burden (Open in New Window on right clicking links will open a proper IE window).

See also: HTMLViewGo, HTMLViewBack, HTMLViewForward, HtmlViewCurrentURL, HtmlViewEventURL, HtmlViewStatus, HtmlViewRun.

Example

; A Basic Blitz Web Browser!
win=CreateWindow("Basic Blitz Web Browser",100,100,500,500,0,35)
html = CreateHtmlView(0,0,500,500,win)
SetGadgetLayout html,1,1,1,1 ; ensure the HTML view will stretch to meet the size of the window when it is resized.
HtmlViewGo html,"http:\\www.blitzbasic.com"

; a simple loop
Repeat
id = WaitEvent()
If id=$803 Then Exit
Forever

End ; bye!

Index

Click here to view the latest version of this page online