Navigation: ABC Library Reference > WindowManager > WindowManager Methods >====== Open (open and initialize a window structure) ====== | |
Open, VIRTUAL
Open ( mainwindow, <;ownerwindow> ), VIRTUAL
mainwindow | The label of the window that needs to be opened. |
ownerwindow | The label of the owner window, if applicable. This is the label of the APPLICATION or WINDOW structure which “owns” the mainwindow being opened. |
The Open method, when called with the mainwindow and optional ownerwindow parameters, is used to open a window for processing. A mainwindow with an ownerwindow always appears on top, and is automatically hidden if the ownerwindow is minimized or hidden. If the ownerwindow is closed, all owned windows are also automatically closed.
The Open method when called without parameters, prepares the window for display. It is designed to execute on window opening events such as EVENT:OpenWindow and EVENT:GainFocus, and can optionally translate a window if necessary.
Implementation:
The Open method invokes the Translator if present and calls the Reset method to reset the WINDOW.
The TakeWindowEvent method calls the Open method.
Example:
ThisWindow.TakeWindowEvent PROCEDURE
CODE
CASE EVENT()
OF EVENT:OpenWindow
IF ~BAND(SELF.Inited,1)
SELF.Open(Window)
END
OF EVENT:GainFocus
IF BAND(SELF.Inited,1)
SELF.Reset
ELSE
SELF.Open
END
END
RETURN Level:Benign
ThisWindow.Open PROCEDURE
CODE
IF ~SELF.Translator&=NULL
SELF.Translator.TranslateWindow
END
SELF.Reset
SELF.Inited = BOR(SELF.Inited,1)
!Usage with parameter(s):
SELF.Open(Window)
See Also: Reset, TakeWindowEvent , TranslateWindow OPEN