Main Menu

KB#00393-Program demonstrating the use of fonts for GUI controls


Program demonstrating the use of fonts for GUI controls


REM Setup sysgui device window 
        open(100) "X0" 
        dim e$:tmpl(100) 
        dim s$:tmpl(100,IND=0) 
        print(100)'window'((s.screen_width-470)/2,50,470,180,"Font Example",$02$,$03000000$)

REM Read in font families for menu 

REM Print the menu and controls 
        print(100)'text'(20,10,20,70,20,"Font Size:",$8000$) 
        print(100)'edit'(7,10,110,250,60,"Edit Control",$$) 
REM Parse out font string into list box 
        while pos($0a$=fonts$)>0 

REM Fill in the listbutton, highlight current size 
        for i = 1 to 50 
        next i 

REM event loop 
                 read record(100,siz=len(e$))e$ 
                 switch dec(e.code$) 
                          case 88; end; REM closed the window 
                 case 108; REM changed font or size 
                          if then which_font$=ctrl(100,26,1) 
                          gosub set_font 
                 case 66; REM back to normal font 
                          gosub set_font 
                 case 99; REM changed look of font 
                          if ctrl(100,23,2)=$01$ then font_style=font_style+1 
                          if ctrl(100,24,2)=$01$ then font_style=font_style+2 
                          if ctrl(100,25,2)=$01$ then font_style=font_style+16 
                          gosub set_font 
                 goto event_loop 

REM set fontname and fontsize 
        print (100)'font'(7,which_font$,num(ctrl(100,21,1)),font_style) 

Last Modified: 12/24/1997 Product: Visual PRO/5 Operating System: Windows

BASIS structures five components of their technology into the BBx Generations.

  Google+ View BASIS LinkedIN Profile Visit our Twitter Feed Check out our Facebook Public Profile Click to View the BASIS youTube channel