允许自定义textBox控件的行间距
This commit is contained in:
@@ -920,7 +920,7 @@ end
|
|||||||
function textBox:getInfo()
|
function textBox:getInfo()
|
||||||
return format("x=%d,y=%d,w=%d,h=%d",self.x+self.w*.5,self.y+self.h*.5,self.w,self.h)
|
return format("x=%d,y=%d,w=%d,h=%d",self.x+self.w*.5,self.y+self.h*.5,self.w,self.h)
|
||||||
end
|
end
|
||||||
function WIDGET.newTextBox(D)--name,x,y,w,h[,font][,fix],hide
|
function WIDGET.newTextBox(D)--name,x,y,w,h[,font][,lineH][,fix],hide
|
||||||
local _={
|
local _={
|
||||||
name= D.name,
|
name= D.name,
|
||||||
|
|
||||||
@@ -942,11 +942,11 @@ function WIDGET.newTextBox(D)--name,x,y,w,h[,font][,fix],hide
|
|||||||
h= D.h,
|
h= D.h,
|
||||||
|
|
||||||
font= D.font or 30,
|
font= D.font or 30,
|
||||||
fix=D.fix,
|
fix= D.fix,
|
||||||
texts={},
|
texts= {},
|
||||||
hide= D.hide,
|
hide= D.hide,
|
||||||
}
|
}
|
||||||
_.lineH=7*(_.font/5)
|
_.lineH=D.lineH or _.font*7/5
|
||||||
_.capacity=int((D.h-10)/_.lineH)
|
_.capacity=int((D.h-10)/_.lineH)
|
||||||
|
|
||||||
for k,v in next,textBox do _[k]=v end
|
for k,v in next,textBox do _[k]=v end
|
||||||
|
|||||||
Reference in New Issue
Block a user