Consultor Eletrônico



Kbase 13859: Example: change HELP text on widget based on SCREEN-VALUE
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/05/1998
Example: change HELP text on widget based on SCREEN-VALUE


The following example uses a RADIO-SET widget to demonstrate a way
to make the HELP text reflect something different depending on what
the current value of the widget is.

Two things to note first:

(1) The window containing the widget must have a STATUS-AREA defined.
(If you're working in the UIB, this can be done using the window's
Property Sheet.)

(2) The change to the :HELP attribute will not become visible until
you have re-entered the widget. That's why ENTRY is applied to
SELF when each change takes place. (Watch out for any conflicts
this might cause if you already have an ON ENTRY trigger defined
for the widget. A way to get around this might be to use a
flag in the ON ENTRY trigger that checks for whether the ENTRY
event is happening due to a :HELP change.)


ON VALUE-CHANGED OF radio-set-1 IN FRAME frame-a DO:

CASE radio-set-1:SCREEN-VALUE:

WHEN "1" THEN DO:
radio-set-1:HELP = "You're in the first item".
APPLY "ENTRY" TO SELF.
END.

WHEN "2" THEN DO:
radio-set-1:HELP = "You're in the second item".
APPLY "ENTRY" TO SELF.
END.

WHEN "3" THEN DO:
radio-set-1:HELP = "You're in the third item".
APPLY "ENTRY" TO SELF.
END.

END CASE.

END.

Progress Software Technical Support Note # 13859