This class is using the MSHTML ActiveX control so you must install the MS Internet Explorer to use it.
:CLASS HTMLControl <SUPER AXControl
HTML control class.
:M Start: ( Parent -- )
Start the control
:M GetLocationURL: ( -- str len )
Retrieves the URL of the resource that the browser is currently displaying.
:M GetLocationName: ( -- str len )
Retrieves the name of the resource that the browser is currently displaying.
:M GetType: ( -- str len )
Retrieves the type name of the contained document object.
:M Busy?: ( -- flag )
Retrieves a boolean value that indicates whether the browser is engaged in a downloading operation or other activity.
:M Offline?: ( -- flag )
Retrieves a Boolean value indicating whether the browser is currently operating in offline mode.
:M GoURL: ( str len -- )
Navigates to a resource identified by a Uniform Resource Locator (URL) or to the file identified by a full path.
:M SetURL: ( zUrl -- )
Navigates to a resource identified by a Uniform Resource Locator (URL) or to the file identified by a full path.
:M GoHome: ( -- )
Navigates to the current home or start page.
:M GoSearch: ( -- )
Navigates to the current search page.
:M GoForward: ( -- )
Navigates forward one item in the history list.
:M GoBack: ( -- )
Navigates backward one item in the history list.
:M Refresh: ( -- )
Reloads the file that the browser is currently displaying.
:M Stop: ( -- )
Cancels any pending navigation or download operation and stops any dynamic page elements, such as background sounds and animations.
;CLASS
End of HTML control class
needs HtmlControl.f \ Create a simple browser window :class Browserwin <super window HTMLcontrol html :M On_Init: ( -- ) On_Init: super self Start: html ;M :M On_Size: ( h m w -- ) 2drop drop autosize: html ;M :M GoURL: ( str len -- ) GoURL: html ;M :M GetLocationURL: ( -- str len ) GetLocationURL: html ;M :M GetLocationName: ( -- str len ) GetLocationName: html ;M :M Busy?: ( -- flag ) Busy?: html ;M :M Offline?: ( -- flag ) Offline?: html ;M :M GetType: ( -- str len ) GetType: html ;M :M Wait: ( -- ) \ Wait until the browser has finished all \ downloading operation or other activity. begin winpause Busy?: self 0= until ;M ;class BrowserWin bwin : test \ start the window start: bwin \ let the browser load a document Offline?: bwin if s" doc\p-index.htm" Prepend<home>\ else s" www.win32forth.org\doc\p-index.htm" then GoURL: bwin \ wait until browser is ready Wait: bwin \ display some information about the document cr GetLocationURL: bwin type cr GetLocationName: bwin type cr GetType: bwin type ; test
Document $Id: HTMLcontrol.htm,v 1.11 2007/05/26 10:24:12 dbu_de Exp $