Summary:
See also: Built-in classes.
The Interface class is a built-in class provided to manipulate the user interface.
ui.Interface
Class Methods | |
Name | Description |
frontCall( module STRING, name STRING,
parameter-list, returning-list ) |
Calls the front end function name of the module module. See Front End Functions for more details. |
getDocument() RETURNING om.DomDocument |
Returns the DOM document owning the Abstract User Interface tree. |
getFrontEndName() RETURNING STRING |
Returns the type of the front end ( 'Gdc' , 'Gwc' , 'Gjc' , 'Console'
). |
getFrontEndVersion() RETURNING STRING |
Returns the front end version string. |
getRootNode() RETURNING om.DomNode |
Returns the root DOM node of the Abstract User Interface tree. |
loadStartMenu( file STRING ) |
Loads the start menu defined in an XML file into the AUI tree. See StartMenus for more details. |
loadToolBar( file STRING ) |
Loads the toolbar defined in an XML file into the AUI tree. See Toolbars for more details. |
loadTopMenu( file STRING ) |
Loads the topmenu defined in an XML file into the AUI tree. See TopMenus for more details. |
loadActionDefaults( file STRING
) |
Loads the default decoration for actions from a specific XML file into the AUI tree. See Action Defaults for more details. |
loadStyles( file STRING ) |
Loads styles defined in an XML file into the AUI tree. See Prensentation Styles for more details. |
setName( name STRING ) |
Sets the name to identify the program on the front-end. |
getName() RETURNING STRING |
Returns the identifier of the program. |
setText( title STRING ) |
Defines a title for the program. |
getText() RETURNING STRING |
Returns the title of the program. |
setImage( name STRING ) |
Sets the name of the icon to be used for this program. |
getImage() RETURNING STRING |
Returns the name of the icon. |
setType( type STRING ) |
Defines the type of program. |
getType() RETURNING STRING |
Returns the type of the program. |
setContainer( name STRING ) |
Defines the name of the parent container of this program. |
getContainer() RETURNING STRING |
Returns the name of the parent container of this program. |
getChildCount() RETURNING INTEGER |
Returns the number of children in this container. |
getChildInstances( name STRING ) RETURNING INTEGER |
Returns the number of children identified by name. |
refresh() |
Synchronizes the front end with the current AUI tree. |
The ui.Interface.getDocument()
class method returns the DomDocument
object of the Abstract user Interface tree.
The ui.Interface.getFronEndName()
class method returns the type of the
front-end used by the application. This is mainly provided for debugging
purposes.
The ui.Interface.getFronEndVersion()
class method returns the version number
of the front-end used by the application. This is mainly provided for debugging
purposes.
The ui.Interface.getRootNode()
class method returns the root DomNode
of the Abstract user Interface tree.
The ui.Interface.setName()
class method can be used to identify the application on
the front-end. For example, this name is used in MDI
configuration.
Use the ui.Interface.getName()
class method to get the name of the application
previously set by setName()
.
The ui.Interface.setText()
class method can be used to define a main title for the
application on the front-end. This title is displayed in the main Window.
Use the ui.Interface.getText()
class method to get the title of the application
previously set by setText()
.
The ui.Interface.setImage()
class method can be used to define the icon of the
application on the front-end. This icon will be used in taskbars, for example.
Use the ui.Interface.getImage()
class method to get the image name of the application
previously set by setImage()
.
The ui.Interface.setType()
class method can be used to define the
type of the
application, typically used in MDI
configurations.
Possible values can be 'normal'
, 'container'
or 'child'
.
Use the ui.Interface.getType()
class method to get the type of the application,
previously set by setType()
.
The parent container can be specified with the ui.Interface.setContainer()
class method, typically used in MDI
configurations.
Use the ui.Interface.getContainer()
method to get the name
of the parent container of the application.
Use the ui.Interface.getChildCount()
class method to get the
current number of child applications in this parent WCI.
See also MDI configuration.
If you need to known how many child instances of the same application are
started in the current WCI container, call the ui.Interface.getChildInstances()
class method.
This method takes the application name as a parameter (the one defined with setName())
See also MDI configuration.
Use the ui.Interface.refresh()
class method to synchronize the
server-side AUI tree with the frond-end AUI tree. For more details, see "When
is the front-end synchronized?".
01
MAIN02
MENU "Test"03
COMMAND "Get"04
DISPLAY "Name = " || ui.Interface.getFrontEndName()05
DISPLAY "Version = " || ui.Interface.getFrontEndVersion()06
COMMAND "Exit"07
EXIT MENU08
END MENU09
END MAIN
01
MAIN02
DEFINE n om.DomNode03
MENU "Test"04
COMMAND "SaveUI"05
LET n = ui.Interface.getRootNode()06
CALL n.writeXml("auitree.xml")07
COMMAND "Exit"08
EXIT MENU09
END MENU10
END MAIN
The WCI parent program:
01
MAIN02
CALL ui.Interface.setName("main1")03
CALL ui.Interface.setText("This is the MDI container")04
CALL ui.Interface.setType("container")05
CALL ui.Interface.loadStartMenu("appmenu")06
MENU "Main"07
COMMAND "Help" CALL help()08
COMMAND "About" CALL aboutbox()09
COMMAND "Exit"10
IF ui.Interface.getChildCount()>0 THEN11
ERROR "You must first exit the child programs."12
ELSE13
EXIT MENU14
END IF15
END MENU16
END MAIN
The WCI child program:
01
MAIN02
CALL ui.Interface.setName("prog1")03
CALL ui.Interface.setText("This is module 1")04
CALL ui.Interface.setType("child")05
CALL ui.Interface.setContainer("main1")06
MENU "Test"07
COMMAND "Exit"08
EXIT MENU09
END MENU10
END MAIN
01
MAIN02
DEFINE cnt INTEGER03
OPEN WINDOW w WITH FORM "myform"04
FOR cnt=1 TO 1005
DISPLAY BY NAME cnt06
CALL ui.Interface.refresh()07
SLEEP 108
END FOR09
END MAIN