Kbase 15283: Why define browse font with variable looks different
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  5/10/1998 |
|
Why define browse font with variable looks different
In the following code, two browse widgets are defined. One uses
font x where x is defined to be 0 and one uses font 0. These
browse widgets appear at run-time with the same font but the sizing
may be off. You may see horizontal scroll bars and/or whitespace
with the browse using font x:
def var x as int init 0.
def query q for customer.
def query g for customer.
def browse b query q display cust-num name address with 5 down font x.
def browse c query g display cust-num name address with 5 down font 0.
open query q for each customer.
open query g for each customer.
enable b c with frame x.
wait-for window-close of current-window.
The reason that you may see whitespace or different sizing in the
browse b that is defined with font x is that The initial frame layout
occurs at compile time and can then be tweaked at run
time. In this case, the compiler doesn't know what the value of x is
when it
does the frame layout so it just uses the default font, which is NOT
font 0.
This determines the size of the frame and the size of the browse
widget. So
even though the correct font gets used at run time, the sizes have
already
been established and do not change. This is why the layout is
different than
if you hardcode font 0 at compile time
Progress Software Technical Support Note # 15283