Web Browser Window

The Web Browser window allows you to view and interact with an HTML page, but does not include full browser controls. The use of the shell.explorer ActiveX control allows you to select pages to view. Refer to {ACTIVEX} and Display an Xdialog Box for more information.

This approach to displaying HTML is similar to the HTML Text Window.

dim edit as P

dim edit.object as P

dim edit.class as C

dim edit.events as C

dim shared varC_result as C

dim edit_url as C

edit.class = "shell.explorer"

edit.events = <<%code%

...

%code%

edit_url = ""

ok_button_label = "&OK"

cancel_button_label = "&Cancel"

varC_result = ui_dlg_box("Browser Window",<<%dlg%

{startup=init}

{region}

URL: | [.50edit_url] <&GO!edit_go>;

| {activex=100,25edit?.f.};

{endregion};

{line=1,0};

{region}

<*15=ok_button_label!OK> <15=cancel_button_label!CANCEL>

{endregion};

%dlg%,<<%code%

if a_dlg_button = "init" then

    a_dlg_button = ""

    hourglass_cursor(.t.)

    if edit_url <> "" then

        on error goto edit_error

        edit.object.navigate(edit_url)

        on error goto 0

    end if

    hourglass_cursor(.f.)

end if

if a_dlg_button = "edit_go" then

    a_dlg_button = ""

    hourglass_cursor(.t.)

    if edit_url <> "" then

        on error goto edit_error

        edit.object.navigate(edit_url)

        on error goto 0

    end if

    hourglass_cursor(.f.)

end if

end

edit_error:

ui_msg_box("Error","Invalid URL.",UI_STOP_SYMBOL)

end

%code%)

See Also

HTMLText Window, Xdialog Language Directives and Operators, Xdialog Control Reference

Supported By

Alpha Five Version 6 and Above