This one has been driving me nuts all week. I have some code to print stuff
that works fine on the Mac but not on Windows. I don't know if I stumbled
onto a bug or if I'm doing something stupid. My app prints the contents of
an EditField via its StyledTextPrinter method, followed by a bunch of other
stuff printed via g.DrawString and g.DrawLine. While it works on the Mac,
the stuff following the Editfield contents are not printed properly. If the
Editfield contents are not printed, the other stuff prints just fine.
I was able to replicate the problem in a small example project, and I'd
appreciate it if someone working on windows can confirm what I'm seeing.
To replicate the problem, create a new project and add an EditField
(multiline property = true) and a push button. Add the following code to the
action event of the pushbutton:
Dim stp as StyledTextPrinter
Dim g as Graphics
g= OpenPrinterDialog()
If g <> Nil then
' Print via StyledTextPrinter
stp=EditField1.StyledTextPrinter(g,72*7.5)
stp.DrawBlock 40,40,150
' Print via DrawString
g.TextSize = 12
g.TextFont = "System"
g.ForeColor = &c000000
g.DrawString("This is printed via g.DrawString", 40, 200)
End if
When you run the program, add a line or two of text to the editfield and
press the pushbutton. It is supposed to print the the editfield contents
followed by "This is printed via g.DrawString" a little further down. This
works absolutely fine on the Mac. On the PC, however, only the EditField
contents are printed properly. The string that is printed via g.DrawString
appears in the top left corner of the page in a very small size, too small
to read. Furthermore, if the line
stp.DrawBlock 40,40,150
is commented to avoid the Editfield contents from being printed, the string
printed via g.DrawString is printed just fine the way it should.
Can someone think of a reason for this?
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>