Kbase 21070: ADM2. How to Resize a SmartDataBrowse Along With Its Parent Window?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  16/10/2008 |
|
Status: Unverified
GOAL:
How to Resize a SmartDataBrowse Along With Its Parent Window?
GOAL:
How to resize a SmartDataBrowse?
FACT(s) (Environment):
Progress 9.1x
OpenEdge 10
FIX:
These steps guide you in building a sample program which will resize the SmartDataBrowser object whenever you resize the browser's parent window.
1) Instantiate a SmartDataBrowser object to a SmartWindow at the top left corner of that window.
2) Access the SmartWindow's Property Sheet screen and turn on its "Resize" attribute.
3) Through the Property Sheet screen of the SmartWindow's frame, check its "Size to fit" attribute on so that extra scroll bars do not appear on the object's initialization.
4) Create an override version of the initializeObject procedure for the SmartWindow that contains the SmartDataBrowser.Place the code below in the override procedure, just after the Progress standard behavior execution, such that the Smart Window is always started at the same size for the end user no matter what size is set at design time:
ASSIGN {&WINDOW-NAME}:MAX-WIDTH = SESSION:WIDTH-CHARS
{&WINDOW-NAME}:MAX-HEIGHT = SESSION:HEIGHT-CHARS.
/* {&WINDOW-NAME}:WIDTH-CHARS = 104.40. */
/* {&WINDOW-NAME}:HEIGHT-CHARS = 10.91. */
APPLY "WINDOW-RESIZED":U TO {&WINDOW-NAME}.
5) Create the "WINDOW-RESIZED" trigger for the SmartWindow that contains the SmartDataBrowser, and place the code below in it. This will resize the SmartDataBrowser object within the SmartWindow:
HIDE FRAME {&FRAME-NAME}.
ASSIGN FRAME {&FRAME-NAME}:HEIGHT-CHARS = {&WINDOW-NAME}:HEIGHT-CHARS
FRAME {&FRAME-NAME}:WIDTH-CHARS = {&WINDOW-NAME}:WIDTH-CHARS.
RUN resizeObject IN <SmartDataBrowser-widget-handle>
({&WINDOW-NAME}:HEIGHT-CHARS,
{&WINDOW-NAME}:WIDTH-CHARS).
ASSIGN FRAME {&FRAME-NAME}:VISIBLE = TRUE.