Define and use widgets in classes
- Last Updated: May 29, 2019
- 1 minute read
- OpenEdge
- Version 13.0
- Documentation
A class definition file can use all static widgets (for
example, BROWSE, BUTTON, FRAME, IMAGE, MENU, RECTANGLE, SUB-MENU),
as well as certain other static handle-based objects, including STREAM and WORK-TABLE objects.
However, you can only define these handle-based objects as data
members that are local to a class definition file, that is, as PRIVATE data
members.
Also, because a class definition file does not support executable
code in the main block, neither the WAIT-FOR statement
nor conditional code is supported within the main block of a class
definition file. The main block can only contain the CLASS statement, DEFINE statements,
and ON statements. Typical graphical user interface
(GUI) applications have a WAIT-FOR statement or
include ON statements within conditional execution
pathways.
Therefore, when using GUI objects you must follow these restrictions:
- An
ONstatement cannot have any conditional code surrounding its definition. - The
WAIT-FORstatement can only be specified in a method or constructor. - All GUI objects must be implicitly or explicitly defined as
PRIVATE.
Given these rules, the following class definition file is valid:
|
However, the following class definition file is invalid,
because the lines marked with bold-faced comments (#1 and #2) contain executable code:
|