How to auto-size browser when changing font

tonydt1g3r

New Member
Hi, I have a newbie question. Currently I am having all my browsers auto resize on the window resize trigger so that my browser is always at the maximum size. What I want to do is add an option that allows the user to select how large or small he wants the font in the browser to be. However I cant figure out how to resize the columns and rows in the browser to accomodate for the larger and smaller fonts. I am using 10.0A.

Thanks in advance, Tony
 
Tony, Try this for the rows where ip-hBrowse is the browser handle
Code:
ASSIGN ip-hBrowse:ROW-HEIGHT-CHARS = FONT-TABLE:GET-TEXT-HEIGHT-CHARS(ip-hBrowse:FONT).

The easiest solution for the columns is to make them resizable and let the user do the hard work.:rolleyes:
 

tonydt1g3r

New Member
For the column width I am trying to do something like this but the select-next-row option isnt available for a column browse. I want the columnb width to be the size of the largest value width wise in the column or the label size depending whichever is bigger.
DO:
DEFINE VARIABLE i AS INTEGER NO-UNDO.
DEFINE VARIABLE j AS INTEGER NO-UNDO.
DEFINE VARIABLE ColSize AS INTEGER NO-UNDO.
DEFINE VARIABLE h AS HANDLE NO-UNDO.
DEFINE VARIABLE c AS CHARACTER NO-UNDO.

h = PositionsBROWSE:FIRST-COLUMN IN FRAME positionsFrame.
DO i = 1 TO PositionsBROWSE:NUM-COLUMNS:
c = h:LABEL.
colSize = FONT-TABLE:GET-TEXT-WIDTH-CHARS(c).
IF FONT-TABLE:GET-TEXT-WIDTH-CHARS(c) > 2
THEN DO:
DO j = 1 TO PositionsBrowse:NUM-ENTRIES:
IF colSize < h:WIDTH-CHARS THEN
colSize = h:WIDTH-CHARS.
h:SELECT-NEXT-ROW.
END.
END.
ELSE
h:WIDTH-CHARS = 2.
h = h:NEXT-COLUMN.
END.
h:WIDTH-CHARS = colSize.
END.
 
Top