[futurebasic] RE: [FB] printing static text in an appearance button

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : September 2005 : Group Archive : Group : All Groups

From: "Edwards, Waverly" <Waverly.Edwards@...>
Date: Thu, 8 Sep 2005 13:04:28 -0400
I wonder if it is possible to use the toolbox drawcontrolincurrentport
to draw to the printer port.  If it does work you would have the control
drawn into the port and may not see the entire contents of the control.
If the contents exceed the visible area then you would only see what is
visible in the control.  From what I recall, this toolbox doesn't work
on the Databrowser but still may serve your purpose.


W.

-----Original Message-----
From: Robert Purves [mailto:robert.purves@...] 
Sent: Thursday, September 08, 2005 4:48 AM
To: futurebasic@...
Subject: Re: [FB] printing static text in an appearance button


kappalab wrote:


> I am trying to print a static text in
> an apperance button such as,
>
> appearance button 10,_activeBtn,,,,"", @r,_kControlStaticTextProc
> def SetButtonTextString( 10, "This is Appearance Button Static Text" )
>
> with "route _toPrinter". However, this
> seems not working for me.
> Does anyone know how to print a static
> text like this?
>

Between  route _toPrinter  and  route _toScreen  you must issue  
drawing and printing commands that are rendered by QuickDraw.   
Creating a control is not such a command.  A control cannot be  
created in the printer port.

If you want to print some text in the same font used by static text  
controls, you can do this:

'-----------------
dim as OSStatus  ignore

def lprint
long if ( prCancel == 0 )
route _toPrinter
ignore = fn UseThemeFont( _kThemeSystemFont, _smSystemScript )
MoveTo( 50, 200 )
print "The font used by static text controls"
route _toScreen
close lprint
end if
'-----------------

Robert P.

--