[futurebasic] Re: [FB] How do you change a font in a dialog box?

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : March 2000 : Group Archive : Group : All Groups

From: Mark G <mgoodes@...>
Date: Wed, 15 Mar 2000 21:06:20 -0500
Well, the solution turned out to be pretty simple.  This will change the font
of both the static and edit text items and, I presume, alert boxes.

% _dlgFont,_helvetica

To restore the system font for someone else's dialog boxes:

% _dlgFont,0

Joe wrote:

> Do you by any chance know how to do the same thing to the names
> of Check Boxes, Radio Buttons and Editable Text in Modal Dialogs?

There doesn't seem to be an easy way of changing the size or style of the edit
text.  I suppose you could manually get the handles to all the edit fields in
the dialog box and poke the desired values into the text edit fields, but this
would be a lot of work.  You would have to write a routine which cycled
through all the items in the dialog, checked the item type, and worked only
with items that were of the type editable text.  The routine would look
something like this:

local fn SetFontSize(dPtr&)
item%=0
do
inc(item%)
CALL GETDITEM (dPtr&,item%,dItmType%,dItmH&,dItmRect)
long if dItmH&>0 and dItmType%=_editText
dItmH&..txFont%=_helvetica
dItmH&..txSize%=12
until dItmH&=0
end fn

You would also have to set the font and size of the active edit field:
dPtr&.textH..txFont%=_helvetica
dPtr&.textH..txSize%=12

I haven't tried this so the values of the constants need to be checked against
those in the dialog record and edit record.  I don't this FB always uses the
same values as IM.  It also would skip over any items that were disabled.


> And where is this kind of stuff
> documented? If it is!
>
I keep going back to Think Reference.  I wonder if there's a similar resource
which is more current.

MG