Specifies the width and height of a widget. You can express the dimensions in either character units or pixels.
width BY heightSIZE SIZE-CHARS SIZE-PIXELSSIZE SIZE-CHARSSpecifies the width of the widget. If the units are characters, width must be a decimal constant. If the units are pixels, width must be an integer constant.Specifies the height of the widget. If the units are characters, the value height must be a decimal constant. If the units are pixels, height must be an integer constant.The following example uses SIZE phrases to set the initial dimensions of the rectangle rec and to set the dimensions of the frame sz-frame. When you choose the b_size button, the rectangle is randomly resized.
DEFINE BUTTON b_quit LABEL "Quit"TRIGGERS:ON CHOOSE QUIT.END.DEFINE BUTTON b_size LABEL "Size It".DEFINE RECTANGLE rec SIZE 5 BY 5.DEFINE FRAME butt-frameb_size b_quitWITH CENTERED ROW SCREEN-LINES - 2.DEFINE FRAME sz-frameSKIP(1) SPACE(1) recWITH SIZE 80 BY 10 TITLE "The rectangle is 5 by 5".ON CHOOSE OF b_size IN FRAME butt-frameASSIGNrec:WIDTH-CHARS IN FRAME sz-frame =RANDOM(1, FRAME sz-frame:WIDTH-CHARS - 3)rec:HEIGHT-CHARS = RANDOM(1, FRAME sz-frame:HEIGHT-CHARS - 2)FRAME sz-frame:TITLE = "The rectangle is " + STRING(rec:WIDTH-CHARS) +" by " + STRING(rec:HEIGHT-CHARS).ENABLE rec WITH FRAME sz-frame.ENABLE b_size b_quit WITH FRAME butt-frame.WAIT-FOR CHOOSE OF b_quit IN FRAME butt-frame.
![]()
ABL supports fractional character units. Therefore, if you express dimensions in characters, the width and height values can include up to two decimal places.
© 2012 Progress Software Corporation and/or its subsidiaries or affiliates. |