Summary:
See also: Classes and Objects.
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() |
Returns the type of the front end. |
getFrontEndVersion() |
Returns the front end version string. |
getRootNode() |
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 Presentation Styles for more details. |
setName( name STRING ) |
Sets the name to identify the program on the front-end. |
getName() |
Returns the identifier of the program. |
setText( title STRING ) |
Defines a title for the program. |
getText() |
Returns the title of the program. |
setImage( name STRING ) |
Sets the name of the icon to be used for this program. |
getImage() |
Returns the name of the icon. |
setType( type STRING ) |
Defines the type of program. |
getType() |
Returns the type of the program. |
setSize( height STRING,
width STRING ) |
Defines the initial size of the main window when using the traditional mode or when configuring a WCI container. |
setContainer( name STRING ) |
Defines the name of the parent container of this program. |
getContainer() |
Returns the name of the parent container of this program. |
getChildCount() |
Returns the number of children in this container. |
getChildInstances( name STRING ) |
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.getFrontEndName()
class method returns the type of the
front-end used by the application. This is mainly provided for debugging
purposes. Returned values can for example be 'GDC'
, 'GWC'
, 'Console'
.
The ui.Interface.getFrontEndVersion()
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 ui.Interface.setSize(height,width)
class method can be used
to define the initial size of the parent container window of an MDI application.
The parameters can be integer or string values. By default the unit is the
character grid cells, but you can add the px unit to specify the height
and width in pixels.
The setSize()
method can also be used to configure the size of
the main window when using traditional
mode, as a replacement of fgl_setsize()
built-in function.
See also MDI configuration.
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.setSize("600px","600px")06
CALL ui.Interface.loadStartMenu("appmenu")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
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