作者: yangff 时间: 2012-2-1 12:45
def onTextareaRender(sender,e)
bitmap=e.get(:bitmap)
bitmap.clear
bitmap.font=@font
@x=0
@y=0
@maxheight=0
#@text.each_byte{|b|
for i in [email protected]
b=@text
if b!="\r"
@size=bitmap.text_size(b)
@maxheight = 0 if @maxheight.nil?
@maxheight=[@maxheight,@size.height].max
if (@[email protected]>@rect.width) or b=="\n"
@x=0
@y+=@maxheight
@maxheight=0
end
bitmap.draw_text(@x,@y,@size.width*2+1,@size.height+1,b) if b!="\n"
@[email protected] if b!="\n"
end
end
#}
return false
end