skip to main content

Library Routines : J$GETFROMLAF

J$GETFROMLAF
The J$GETFROMLAF library routine returns a font or a color by inquiring the current Look and Feel (LAF). In thin client environment it automatically works client side.
Syntax:
 CALL "J$GETFROMLAF" USING opCode 
Parameters:
Return code:
returnCode can be any signed numeric data item. The meaning depends on the opcode.
Examples:
Example - display a screen where LAF font and colors are used
working-storage section.
copy "iscrt.def".
copy "isgui.def".
copy "iscobol.def".   
copy "isresize.def".
77 crt-status             special-names crt status pic 9(5). 
77 close-win              pic 9 value 0.
77 result-getfromlaf      pic s9.
77 label-font             handle of font.
77 lb-bg-color            pic s9(9).
77 lb-fg-color            pic s9(9).
77 hWin                   handle of window.
screen section.
01  screen-01.
    03 label
       line                 2
       lines                2
       col                  2
       size                 68 cells
       title "The font and the color of the controls of this screen"
       foreground-color     lb-fg-color
       background-color     lb-bg-color
       font                 label-font.
    03 label
       line                 3
       lines                2
       col                  2
       size                 68 cells
       title "are loaded by 'J$GETFROMLAF' Routine"
       foreground-color     lb-fg-color
       background-color     lb-bg-color
       font                 label-font.
    03 Pb-exit  
       push-button
       line                 20 
       col                  62 
       size                 8 cells
       title                "Exit" 
       exception-value      27.
procedure division.
    perform get-label-font
    perform get-label-color
    display standard graphical window
            background-low  
            title  "J$GETFROMLAF Routine"
            event  win-evt.
    display screen-01
    accept  screen-01 until crt-status = 27 or close-win = 1
    end-accept  
    destroy screen-01
    destroy hWin    
    destroy label-font
    goback.
    call "J$GETFROMLAF" using jget-laf-font
    perform check-laf-result.
    call "J$GETFROMLAF" using jget-laf-color
    perform check-laf-result.
    call "J$GETFROMLAF" using jget-laf-color
    perform check-laf-result.
    if result-getfromlaf = -1
       display message "Invalid Laf Entry"
    end-if.
    if event-type = cmd-close
       move 1 to close-win
    end-if.

Copyright (c) 2017 Veryant
Contact us
Please share your comments on this manual or on any
Veryant product documentation with the email button at the top left