Kbase 13477: how to add a LABEL to a DYNAMIC widget such as a FILL-IN
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/05/1998 |
|
how to add a LABEL to a DYNAMIC widget such as a FILL-IN
When creating widgets dynamically (as opposed to using the DEFINE
VARIABLE c AS CHAR VIEW-AS FILL-IN statement) one of the problems
is that you must take care of many unforeseen details on your own.
One such detail is the label. Whereas the DEFINE VAR ... VIEW-AS
FILL-IN statement will create the label for you automatically, with
a dynamic widget you must create the label separately and attach it
to the widget yourself.
Below is an example which shows how this can be done. The label is
created using a TEXT widget.
----------------------- cut here ----------------------------------
DEF FRAME f WITH SIZE 30 BY 20.
DEF VAR x AS WIDGET-HANDLE.
DEF VAR t AS WIDGET-HANDLE.
CREATE TEXT t ASSIGN
ROW = 6
COLUMN = 5
FRAME = FRAME f:HANDLE
VISIBLE = TRUE
SCREEN-VALUE = "xxxx:" /* This is the label text */
CREATE FILL-IN x ASSIGN
ROW = 6
COLUMN = 12
HEIGHT-CHARS = 12
FORMAT = "99/99/99"
FRAME = FRAME f:HANDLE
SENSITIVE = TRUE
VISIBLE = TRUE
SIDE-LABEL-HANDLE = t.
WAIT-FOR GO OF FRAME f.
You must use FONT-TABLE:GET-TEXT-WIDTH-CHARS(string [,font#]) on the
text widget's screen-value (i.e., on the label text string) in order
find out how big it really is so you can position it properly. This
is what is used to position fill-in labels in the UIB.
Progress Software Technical Support Note # 13477