Hi all,
I have a listbox (width 90) without scrollbars on a floating window (width 90) without scrollbars.
In the CellTextPaint event I draw an icon (width 64) and some text (stored in a dynamic constant)
[code]Function CellTextPaint(g As Graphics, row As Integer, column As Integer, x as Integer, y as Integer) As Boolean
g.TextFont = “System”
g.TextSize = 10
g.Bold = True
g.Italic = True
g.ForeColor = &cBBBBBB
select case row
case 0
g.DrawPicture( NewDigest_64x64, 13, 5, 64, 64 ) // (90-64) / 2 = 13
g.DrawString( kTB_NewDigest, ( me.Width - g.StringWidth( kTB_NewDigest ) )/2, 80 )
case 1
g.DrawPicture( OpenDigest_64x64, 13, 5, 64, 64 ) // (90-64) / 2 = 13
g.DrawString( kTB_OpenDigest, (me.Width - g.StringWidth(kTB_OpenDigest) )/2, 80 )
// etc
end Select
End Function[/code]
However neither the picture nor the text are drawn centred.
Any idea where I am going wrong?
Tried it in both RS 2012R2.1 and Xojo 2014R2 on MacOS X 10.9.4