Kbase 13455: Effects on TAB order using ENABLE or VISIBLE and SENSITIVE
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/05/1998 |
|
Effects on TAB order using ENABLE or VISIBLE and SENSITIVE
The TAB order of widgets is affected differently depending on whether
you enable them with an ENABLE statement or by setting the :VISIBLE
and :SENSITIVE attributes.
One way to allow widgets to accept user input is to set their :VISIBLE
and :SENSITIVE attributes to TRUE. For example:
ASSIGN FILL-1:VISIBLE = TRUE
FILL-1:SENSITIVE = TRUE
BUTTON-1:VISIBLE = TRUE
BUTTON-1:SENSITIVE = TRUE.
Another way is to use the ENABLE statement:
ENABLE FILL-1 BUTTON-1 WITH FRAME f.
In the first case, where :VISIBLE and :SENSITIVE are used, PROGRESS
sets the TAB order to be the same as the order in which the widgets
were defined in the FRAME. In the second case, using ENABLE, PROGRESS
places the widgets in the ENABLE statement to the *end* of the TAB
order.
The differences in behavior are most noticeable when using both
approaches in the same program. As an example, let's look at a frame
defined with the following widgets, where fill-1 and fill-2 are
fill-in widgets and b_save and b_cancel are button widgets:
DEFINE FRAME f fill-1 fill-2 b_save b_cancel.
The default TAB order is the same as the order the widgets are defined
in the frame. If the programmer uses the :VISIBLE and :SENSITIVE
attributes to enable the widgets for input, this default order is
preserved no matter what order is used to set the attributes:
ASSIGN fill-2:VISIBLE = TRUE
fill-2:SENSITIVE = TRUE
b_cancel:VISIBLE = TRUE
b_cancel:SENSITIVE = TRUE
b_save:VISIBLE = TRUE
fill-1:VISIBLE = TRUE
b_save:SENSITIVE = TRUE
fill-1:SENSITIVE = TRUE.
However if the programmer uses the ENABLE for fill-1, for example,
then the default TAB order is overridden and fill-1 goes to the end
of the line:
ENABLE fill-1 WITH FRAME f.
ASSIGN fill-2:VISIBLE = TRUE
fill-2:SENSITIVE = TRUE
b_cancel:VISIBLE = TRUE
b_cancel:SENSITIVE = TRUE
b_save:VISIBLE = TRUE
b_save:SENSITIVE = TRUE.
Here, the TAB order becomes: (1) fill-2
(2) b_save
(3) b_cancel
(4) fill-1
What if the ENABLE statement was used with both fill-1 and fill-2,
but in reverse order?
ENABLE fill-2 fill-1 WITH FRAME f.
ASSIGN b_cancel:VISIBLE = TRUE
b_cancel:SENSITIVE = TRUE
b_save:VISIBLE = TRUE
b_save:SENSITIVE = TRUE.
The TAB order for the buttons would keep to the order of their frame
definition, however the two fill-in's would be placed after them in
the order they were named in the ENABLE:
(1) b_save
(2) b_cancel
(3) fill-2
(4) fill-1
In Version 7.3 there is a new FRAME attribute called :KEEP-TAB-ORDER,
which will insure that the TAB order of the frame definition is
always maintained, regardless of how ENABLE, :VISIBLE, and :SENSITIVE
are used.
Progress Software Technical Support Note # 13455