Back to Contents


MDI Windows

Summary:

See also Interface built-in class.


Purpose

By default, BDL program windows are displayed independently in separate windows on the front-end window manager. This mode is well known as SDI, Single Document Interface. The user interface can be configured to group program windows in a parent container (also known as MDI, Multiple Document Interface). 

In BDL, Multiple Document Interface is called  WCI: Window Container Interface.

The Window Container Interface (WCI) can be used to group several programs together in a parent window. The parent program is the container for the other programs, defined as children of the container. The container program can have its own windows, but this makes sense only for temporary modal windows (with style="dialog").


Usage

WCI configuration is done dynamically at the beginning of programs, by using the ui.Interface built-in class.

Configuring the parent container

The WCI container program is a separate BDL program of a special type, dedicated to contain other program windows. On the front-end, container programs automatically display a parent window that will hold all child program windows that will attach to the container.

The WCI container program must indicate that its type is special (setType method), and must identify itself (setName method):

01 MAIN
02   CALL ui.Interface.setName("parent1")
03   CALL ui.Interface.setType("container")
04   CALL ui.Interface.setText("SoftStore Manager")
05   CALL ui.Interface.loadStartMenu("mystartmenu")
06   MENU "Main"
07     COMMAND "Help" CALL help()
08     COMMAND "About" CALL aboutbox()
09     COMMAND "Exit" EXIT MENU
10   END MENU
11 END MAIN

Configuring child programs

WCI children programs must attach to a parent container by giving the name of the container program:

01 MAIN
02  CALL ui.Interface.setName("custapp")
03  CALL ui.Interface.setType("child")
04  CALL ui.Interface.setText("Customers")
05  CALL ui.Interface.setContainer("parent1")
06     ...
07 END MAIN

Multiple container programs can be used to group programs by application modules.

When the program is identified as a container (type="container"), a global window is automatically displayed as an container window. The default Toolbar and the default Topmenu are displayed and a Startmenu can be used. Other windows created by this kind of program can be displayed, inside the container (windowType="normal") or as dialog windows (windowType="modal"). Window styles can be applied to the parent window by using the default style specification (name="Window.main").

The client shows a system error and the programs stops when:

When the parent container program is stopped, other applications are automatically stopped.

The WCI container program can query for the existence of children with the getChildCount and getChildInstances methods:

01 MAIN
02   CALL ui.Interface.setName("parent1")
03   CALL ui.Interface.setType("container")
04   CALL ui.Interface.setText("SoftStore Manager")
05   CALL ui.Interface.loadStartMenu("mystartmenu")
06   MENU "Main"
07     COMMAND "Help" CALL help()
08     COMMAND "About" CALL aboutbox()
09     COMMAND "Exit"
10       IF ui.Interface.getChildCount()>0 THEN
11          ERROR "You must first exit the child programs."
12       ELSE
13          EXIT MENU
14       END IF
15   END MENU
16 END MAIN