BBjSysGui::setLookAndFeel

 

In BBj 5.0, this method is deprecated; use the LF option documented in Running BBj from the Command Line.

Description

In BBj 3.01 and higher, this method sets the look and feel of the BBjSysGui

Syntax

Return Value

Method

void

setLookAndFeel(string lookAndFeel)

Parameters

Variable

Description

lookAndFeel

Specifies the look and feel of the SysGui.

"WindowsXPLookAndFeel" = The Windows XP look and feel.

"ClassicLookAndFeel" = The Visual PRO/5 look and feel.

Return Value

None.

Remarks

None.

Example

restart:
    sysgui = unt
    open (sysgui)"X0"
    print (sysgui)'window'(250,250,200,640,"Control Border Test",$00010883$)
    print (sysgui)'setmenu',"&Look And Feel,1000,,"+$0a$+
    :                          " &Classic Look and Feel,1003,,"+$0a$+
    :                          " &Windows XP Look and Feel,1004,,"+$0a0a$
    flag$ = $0000$; rem ' default border for control
    col = 0
    x = col*200+10,y = 10,w = 180,h = 30
    print (sysgui)'button'(col*100+1,x,10,w,h,"Button",flag$)
    print (sysgui)'checkbox'(col*100+2,x,50,w,h,"Check",flag$)
    print (sysgui)'cedit'(col*100+3,x,90,w,h,"CEdit",flag$)
    print (sysgui)'edit'(col*100+4,x,140,w,h,"Edit",flag$)
    print (sysgui)'groupbox'(col*100+5,x,190,w,h,"Group",flag$)
    print (sysgui)'hscroll'(col*100+6,x,230,w,h,"HScroll",flag$)
    print (sysgui)'inpute'(col*100+7,x,270,w,h,flag$,255,$$,val$)
    print (sysgui)'inputn'(col*100+8,x,310,w,h,flag$,"###0",$$,0,val)
    print (sysgui)'listbox'(col*100+9,x,350,w,h,"listbox",flag$),
    :             'listadd'(col*100+9,-1,"Element 1","Element 2","Element 3","Element 4")
    print (sysgui)'listbutton'(col*100+10,x,390,w,100,"listbutton",flag$),
    :             'listadd'(col*100+10,-1,"Element 1","Element 2","Element 3","Element 4")
    print (sysgui)'listedit'(col*100+11,x,430,w,100,"listedit",flag$),
    :             'listadd'(col*100+11,-1,"Element 1","Element 2","Element 3","Element 4")
    print (sysgui)'radiobutton'(col*100+12,x,470,w,h,"RadioButton",flag$)
    print (sysgui)'tabctrl'(col*100+13,x,510,w,h,"TAB Control",flag$)
    print (sysgui)'tbutton'(col*100+14,x,550,w,h,"Tool Button",flag$)
    print (sysgui)'vscroll'(col*100+15,x,590,w,h,"VScroll",flag$)
    dim event$:tmpl(sysgui)

    repeat
        read record(sysgui,siz = 10)event$
        if event.code$="C" then gosub LookAndFeel; close (sysgui); exitto restart
    until event.code$="X"
release

LookAndFeel:
    switch event.id
        case 1003; rem ' Windows (BASIS Classic)
            rem 'to make sure Java is Set to use Windows L&F
            javax.swing.UIManager.setLookAndFeel(new com.sun.java.swing.plaf.windows.WindowsLookAndFeel(),err=*next)

            rem 'set the BBjLookAndFeel
            BBjAPI().getSysGui().setLookAndFeel("ClassicLookAndFeel",err=*next)
        break

        case 1004; rem ' Windows XP
        rem ' If the client is Java 1.4.2 or later on Windows XP, set XP L&F:
        rem ' (1) Don't show borders on button controls
        rem ' (2) Force XP borders on list and edit controls
        if (info(3,6)="0" and info(0,0)="Windows XP" and info(1,1)>="1.4.2") or (info(3,6)<>"0" and
            :     BBjAPI().getThinClient(err=*next).getClientOSName(err=*next)="Windows XP" and
            :     BBjAPI().getThinClient(err=*next).getClientJavaVersion(err=*next)>="1.4.2")
            if (java.lang.System.getProperty("swing.noxp") = null()) then
                rem 'to make sure Java is Set to use Windows L&F
                javax.swing.UIManager.setLookAndFeel(new com.sun.java.swing.plaf.windows.WindowsLookAndFeel())

                rem 'set the BBjLookAndFeel
                BBjAPI().getSysGui().setLookAndFeel("WindowsXPLookAndFeel",err=*next)
                break
            endif
        endif
    swend
return

See Also

BBjAPI

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.