Kbase 16876: HIDDEN vs VISIBLE (The Attribute Story)
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  5/10/1998 |
|
HIDDEN vs VISIBLE (The Attribute Story)
The HIDDEN and VISIBLE attributes are not simple opposites of each
other.
You will want to set the HIDDEN attribute to selectively show
different aspects of your interface. In some cases, you may want to
hide some fields from some users. In other cases you may want to
hide a screen while you programmatically manipulate its contents.
The reason that HIDDEN should be used is that VISIBLE has side
effects. VISIBLE was added to thePROGRESS 4GL in Version 7 to
parallel the behavior of the keyword VIEW.
Both VIEW and VISIBLE, when applied to an object, implicitly make
other objects visible. If you view a button, the frame that contains
it and the window that contains the frame are also made visible. The
following code sample shows this behavior when run from the
Procedure Editor.
DEFINE BUTTON b LABEL "Hello, World".
DEFINE FRAME f
b AT ROW 1 COLUMN 1 WITH NO-LABELS.
ASSIGN b:VISIBLE = YES.
Running the above program will make the "Hello, World" button visible.
But because the button won't actually be seen until the parent frame
is made visible, PROGRESS will do that too. Compare this to the
following program. If you run this program you should not be able to
see either the frame or the button.
DEFINE BUTTON b LABEL "Hello, World".
DEFINE FRAME f
b AT ROW 1 COLUMN 1 WITH NO-LABELS.
ASSIGN b:HIDDEN = NO.
Even though the button is not HIDDEN, the user never sees it because
its container has not been explicitly viewed.
When you are setting up the contents of a frame, you want to control
the timing of when that frame is made visible to your users. You do
not want the frame to appear before it is ready to be seen. If you
use the VISIBLE attribute on objects in the frame, there is a chance
that the frame will appear before all your setup code has executed.
Because of these reasons, it is always safer to set the HIDDEN
attribute.
Progress Software Technical Support Note # 16876