I have a multi-purpose window that I use to present text to the user.
The window adjusts its size for the text, adding a scrollbar if
necessary, and limits it by the available screen size. Everything
works correctly on the Mac. On windows XP, the text height is
calculated incorrectly. Strangely, if I run the same executable under
WINE, it works correctly.
Any idea as to why the following code gives the wrong result in Windows?
Thanks in advance!
David Linker
In the TextChange method of the EditField, the following is the call
of the procedure to calculate the height:
theHeight = CalcTextHeight(me.TextFont, me.TextSize)
Function CalcTextHeight(fontName As String, fontSize As Integer)
As Integer
dim p as new Picture(400, 400, 2)
Dim i as Integer
If p.Graphics is nil then //file a bug report
Return 0
End if
p.Graphics.TextFont = fontName
p.Graphics.TextSize = fontSize+2
i = p.Graphics.TextHeight
Return p.Graphics.TextHeight
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>