-monitor support & getAll() for list-objects
added multiple monitor support added getAll() for lists, dropdowns, radios and menubars
This commit is contained in:
@@ -7,7 +7,7 @@ local function Label(name)
|
||||
base.fgColor = colors.white
|
||||
base.bgcolor = colors.black
|
||||
|
||||
local autoWidth = true
|
||||
local autoSize = true
|
||||
base:setValue("")
|
||||
|
||||
local textHorizontalAlign = "left"
|
||||
@@ -21,7 +21,7 @@ local function Label(name)
|
||||
setText = function(self, text)
|
||||
text = tostring(text)
|
||||
base:setValue(text)
|
||||
if (autoWidth) then
|
||||
if (autoSize) then
|
||||
self.width = text:len()
|
||||
end
|
||||
return self
|
||||
@@ -47,7 +47,7 @@ local function Label(name)
|
||||
|
||||
setSize = function(self, width, height)
|
||||
base.setSize(self, width, height)
|
||||
autoWidth = false
|
||||
autoSize = false
|
||||
self:setVisualChanged()
|
||||
return self
|
||||
end;
|
||||
@@ -68,6 +68,10 @@ local function Label(name)
|
||||
end
|
||||
else
|
||||
local tData = makeText(fontsize, self:getValue(), self.fgColor, self.bgColor)
|
||||
if(autoSize)then
|
||||
self.height = #tData[1]-1
|
||||
self.width = #tData[1][1]
|
||||
end
|
||||
for n = 1, self.height do
|
||||
if (n == verticalAlign) then
|
||||
local oX, oY = self.parent:getSize()
|
||||
|
||||
Reference in New Issue
Block a user