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.
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:firstname.lastname@example.org".
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.