WEB-BROWSER Control (deprecated)

Note: This topic documents the WEB-BROWSER control for use with the Microsoft Internet Explorer browser. It is now considered deprecated, but is available for backward compatibility. It is no longer updated for use with ACUCOBOL-GT.

The ACUCOBOL-GT® Development System includes an Internet-related graphical control called WEB-BROWSER. This control broadens the usefulness and scope of your COBOL programs by giving them all of the capabilities of Microsoft Internet Explorer's Web browser control Version 4.0 and later (this control is designed for Windows users only). For instance, the WEB-BROWSER control lets you:

ACUCOBOL-GT's WEB-BROWSER control is used just as any other graphical control in ACUCOBOL-GT is used, except that it opens a resource such as an HTML page, graphical image, video, audio, e-mail program, file folder or any other resource that a Web browser can open. When you include the WEB-BROWSER control in your source code, your application launches Microsoft Internet Explorer (MS IE) on your user's machine and displays the resource you specified.

For the control to work, your users must have Microsoft Internet Explorer Version 4.0 or later on their machine.

You specify the resource using standard URL naming conventions with any protocol that Internet Explorer recognizes, such as http:, ftp:, mailto:, file:, or javascript:.

For example to display our Web page on the user's machine, you might create a WEB-BROWSER control identified by the name BROWSER-1, then add the following lines to a Screen Section item:

03  BROWSER-1 WEB-BROWSER, VALUE "www.acucorp.com" 
    COLUMN 5, LINE 5, SIZE 60, LINES 20.

or add the following Procedure Division code:

DISPLAY WEB-BROWSER, VALUE "www.acucorp.com"
 COLUMN 5, LINE 5, SIZE 60, LINES 20.

You can then close the screen, close the window, or destroy the control as you would destroy any other ACUCOBOL-GT control.

The VALUE of the WEB-BROWSER control determines which resource to display. Therefore, if you include:

DISPLAY WEB-BROWSER, VALUE "mailto:info@acucorp.com".

your application launches your user's default e-mail program and creates a new message with the "To:" field prefilled. This allows your user to quickly compose and mail a message to the specified address.

The default settings used by Internet Explorer when it performs these Web browser functions (such as the "home page," security options, e-mail program) are included in the user's control panel under the Internet option. Users who want to alter the behavior of the browser controls should modify their control panel Internet settings.

As with any ACUCOBOL-GT control, you can add the WEB-BROWSER control to user interface screens using the AcuBench® Screen Designer. The control can be found on the screen design control palette along with the other controls. Click the control, fill in its value clause, and the Screen Painter will show you what the screen will look like to the user.

Your WEB-BROWSER control can be as simple or involved as you like. In its simplest form, the WEB-BROWSER control is activated in a single DISPLAY statement. If desired, you can specify the size and color of the resulting browser window; you can activate the browser control's back, forward, home, and search buttons; or you can capture events such as download progress, status bar text changes or resource title change so you can communicate them to your user.

For information on the methods, properties, events, and event properties of the WEB-BROWSER control, see User Interface Programming.