[futurebasic] Re: Font Question (more detail) and Field Question

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : January 2003 : Group Archive : Group : All Groups

From: Ken Shmidheiser <kshmidheiser@...>
Date: Sun, 5 Jan 2003 04:27:29 -0500
Chip also asked:

>With respect to my font question: I don't need to do a fancy parsing
>(in this case) because it will be static text labeling an edit field.
>So I just need to be able to create an edit field with some standard
>alphanumeric as well as some symbol font text intermixed.


Maybe this is what you are looking for.

Ken


#if cpu68K
compile shutdown "Requires PPC or Carbon Compile"
#endif

local fn BuildWindow
dim as rect r

setrect( r, 0, 0, 450, 180 )
appearance Window -1, "", @r, _kDocumentWindowClass,¬
_kWindowStandardFloatingAttributes

def SetWindowBackground(_kThemeActiveDialogBackgroundBrush,_zTrue)

text _symbol, 36
setrect( r, 10, 10, 440, 170 )
edit field 100, chr$(13) + "S = W/105*D"¬
+ chr$(13), @r, _statFramed, _centerJust

window 1

end fn

local fn MixedFontEditField
dim as str255 infoStr

edit text #100, _symbol, 36, 0
infoStr = "(Perhaps this will prove enlightening)"
edit$(100, _maxInt ) = infoStr
edit text #100, _applFont, 20, 0
edit field 0

end fn

local fn DoDialog
dim as long evnt, id

evnt = dialog(0)
id = dialog(evnt)

select case( evnt )
case _wndClose
select( id )
case 1 :  gFBQuit = _zTrue
end select
end select

end fn

on dialog fn DoDialog

fn BuildWindow
fn MixedFontEditField

do
handleevents
until gFBQuit
end