BBjFontChooser::getFontSizes

Description

In BBj 22.10 and higher, this method returns the list of available font sizes in the BBjFontChooser as a BBjVector of integers.

Syntax

Return Value

Method

BBjVector

getFontSizes()

Parameters

None.

Return Value

Returns the list of available font sizes in the BBjFontChooser as a BBjVector of integers.

Remarks

None.

Example

Copy
BBjFontChooser::getFontSizes Examples
rem ' BBjFontChooser::getFontSizes
sysgui = unt
open (sysgui)"X0"
sysgui! = bbjapi().getSysGui()
width = 500, height = 400
title$ = "BBjFontChooser"
window! = sysgui!.addWindow(25,25,width+50,height+100,title$,$00090083$)
window!.setCallback(window!.ON_CLOSE,"eoj")
window!.setCallback(window!.ON_RESIZE,"resize")
fontchooser! = window!.addFontChooser(101,25,25,width,height)
fontchooser!.setCallback(fontchooser!.ON_FONTCHOOSER_CHANGE,"change")
fontchooser!.setCallback(fontchooser!.ON_FONTCHOOSER_APPROVE,"approve")
fontchooser!.setCallback(fontchooser!.ON_FONTCHOOSER_CANCEL,"cancel")
rem fontchooser!.setCallback(fontchooser!.ON_GAINED_FOCUS,"event")
rem fontchooser!.setCallback(fontchooser!.ON_LOST_FOCUS,"event")
rem fontchooser!.setCallback(fontchooser!.ON_MOUSE_ENTER,"event")
rem fontchooser!.setCallback(fontchooser!.ON_MOUSE_EXIT,"event")
button! = window!.addButton(1,width+25-120,height+50,120,25,"Random",$$)
button!.setCallback(button!.ON_BUTTON_PUSH,"random")
status! = window!.addStatusBar(99)
families! = fontchooser!.getFontFamilies()
i = msgbox(str(families!),0,"getFontFamilies")
sizes! = fontchooser!.getFontSizes()
i = msgbox(str(sizes!),0,"getFontSizes")
families! = new BBjVector()
restore families
while 1
  dread family$,err=*break
  if family$ = "" then break
  families!.add(family$)
wend
i = msgbox(str(families!),0,"setFontFamilies")
fontchooser!.setFontFamilies(families!)
sizes! = new BBjVector()
restore sizes
while 1
  dread size,err=*break
  if size = 0 then break
  sizes!.add(size)
wend
i = msgbox(str(sizes!),0,"setFontSizes")
fontchooser!.setFontSizes(sizes!)
gosub random
rem families! = fontchooser!.getFontFamilies()
rem i = msgbox(str(families!),0,"getFontFamilies")
rem sizes! = fontchooser!.getFontSizes()
rem i = msgbox(str(sizes!),0,"getFontSizes")
process_events
families:
data "Arial", "Brush Script MT", "Courier New", "Garamond", "Georgia"
data "Tahoma", "Times New Roman", "Trebuchet MS", "Verdana", ""
sizes:
data 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 0
eoj:
  release
status:
  status!.setText(status$)
  print status$
return
resize:
  event! = sysgui!.getLastEvent()
  fontchooser!.setSize(event!.getWidth()-50,event!.getHeight()-80)
  button!.setLocation(event!.getWidth()-120-25,event!.getHeight()-30)
  status$ = event!.getEventName()+" width="+str(event!.getWidth())+",height="+str(event!.getHeight())
  gosub status
return
random:
  family$ = families!.get(rnd(families!.size()))
  size = sizes!.get(rnd(sizes!.size()))
  style = rnd(4)
  font! = sysgui!.makeFont(family$,size,style)
  status$ = "setSelectedFont "+str(font!)
  gosub status
  fontchooser!.setSelectedFont(font!)
return
change:
  event! = sysgui!.getLastEvent()
  event$ = event!.getEventName()
  status$ = event$+": "+str(event!.getFont())
  gosub status
return
approve:
  event! = sysgui!.getLastEvent()
  event$ = event!.getEventName()
  status$ = event$+": "+str(event!.getFont())
  gosub status
return
cancel:
  event! = sysgui!.getLastEvent()
  event$ = event!.getEventName()
  status$ = event$
  gosub status
return
event:
  event! = sysgui!.getLastEvent()
  event$ = event!.getEventName()
  status$ = event$
  gosub status
return

See Also

BBjAPI

BBjSysGui

BBjWindow

BBjFontChooser

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