WINDOW

 

WINDOW object data type describes a 4GL window. If a variable of this data type used to open and manipulate a window, it becomes the subject of the scoping rules for 4GL variables. A window object declared implicitly by using the OPEN WINDOW statement has the global scope, whereas a WINDOW variable can have any scope of reference depending on the place where it is declared. Thus a window opened using a WINDOW variable can have any scope of reference.

 

WINDOW variable is declared in the same was as variables of simple data types. It can be passed to functions as an argument and returned by them. You should not assign values to these variables using the LET statement. You should use the special methods instead to open and manipulate windows. A method should be prefixed by a variable of the WINDOW data type and separated from it by a full stop, i.e.:

 

variable.Method()

 

Here are the methods used with the variables of the WINDOW data type:

 

forName()

binds the window opened with an OPEN WINDOW statement with a Window object

getCurrent()

binds the current window with a ui.Window object

open()

initializes a ui.Window object and opens a window

createForm()

create an empty form and displays it to the associated window

openWithForm()

initializes a ui.Window object and opens a window with a form in it

setText()

specifies the title of the window

getText()

retrieves the title of the window

setImage()

specifies the icon for the window title bar

getImage()

retrieves the icon for the window title bar

getForm()

allows the user to manipulate the form objects

clear()

clears a window opened by Open() or by OpenWithForm() methods

move()

moves the window associated with the variable to a new position

raise()

brings the specified window to the top of the window stack, i.e. makes it the current window

close()

closes a window opened by Open() or byOpenWithForm() methods or initialized with a DEFINE statement

displayAt()

displays a text to a specified window location

message()

displays a text to the reserved message line of the specified window

error()

displays a text to the reserved error line of the specified window