Kbase P105345: How to left align the labels of all BUTTON widgets on a SmartWindow?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  6/15/2005 |
|
Status: Unverified
GOAL:
How to left align the labels of all BUTTON widgets on a SmartWindow?
FIX:
1. Define an internal Procedure 'LeftAlignAllButtonWidgetLabels':
/*------------------------------------------------------------------------------
Purpose: Walk the widget tree looking for button widgets. When a button is found:
1. Create a dynamic TEXT widget.
2. Copy the button's label into this TEXT widget.
3. Blank the button's label
4. Position the dynamic text widget to act as a label
------------------------------------------------------------------------------*/
DEFINE VARIABLE h AS HANDLE NO-UNDO.
DEFINE VARIABLE hLabel AS HANDLE NO-UNDO.
ASSIGN
h = FRAME fMain:FIRST-CHILD
h = h:FIRST-CHILD.
DO WHILE VALID-HANDLE(h):
IF h:TYPE = "BUTTON" THEN DO:
CREATE TEXT hLabel
ASSIGN
FRAME = FRAME fMain:HANDLE
DATA-TYPE = "CHARACTER"
FORMAT = "X(10)"
HIDDEN = TRUE.
ASSIGN
hLabel:SCREEN-VALUE = h:LABEL
h:LABEL = ""
hLabel:X = h:X + 5
hLabel:Y = h:Y + 5
hLabel:VISIBLE = TRUE.
END. /* If IF h:TYPE = "BUTTON" */
ASSIGN h = h:NEXT-SIBLING.
END. /* DO WHILE */
END PROCEDURE.
2. Run the internal Procedure 'LeftAlignAllButtonWidgetLabels' defined above ONCE from a local "initializeObject" override:
RUN SUPER.
RUN LeftAlignAllButtonWidgetLabels.