Summary:
See also Interface built-in class.
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").
WCI configuration is done dynamically at the beginning of programs, by using the ui.Interface built-in class.
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
MAIN02
CALL ui.Interface.setName("parent1")03
CALL ui.Interface.setType("container")04
CALL ui.Interface.setText("SoftStore Manager")05
CALL ui.Interface.setSize("600px","1000px")06
CALL ui.Interface.loadStartMenu("mystartmenu")07
MENU "Main"08
COMMAND "Help" CALL help()09
COMMAND "About" CALL aboutbox()10
COMMAND "Exit" EXIT MENU11
END MENU12
END MAIN
You can define the initial size of the parent container window with the setSize(height,width) method.
WCI children programs must attach to a parent container by giving the name of the container program:
01
MAIN02
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 by the front-end. This will result in a runtime error -6313 on the application server side. To avoid this, you should control that there are no more running child programs before terminating the parent container program. The WCI container program can query for the existence of children with the getChildCount() and getChildInstances() methods:
01
MAIN02
CALL ui.Interface.setName("parent1")03
CALL ui.Interface.setType("container")04
CALL ui.Interface.setText("SoftStore Manager")05
CALL ui.Interface.setSize("600px","1000px")06
CALL ui.Interface.loadStartMenu("mystartmenu")07
MENU "Main"08
COMMAND "Help" CALL help()09
COMMAND "About" CALL aboutbox()10
COMMAND "Exit"11
IF ui.Interface.getChildCount()>0 THEN12
ERROR "You must first exit the child programs."13
ELSE14
EXIT MENU15
END IF16
END MENU17
END MAIN
yes
.
Values can be: