Add support for method chaining

This commit is contained in:
Kenny Shields 2014-02-11 07:34:07 -05:00
parent 73e1704fdd
commit ffed66b9af
20 changed files with 348 additions and 2 deletions

View File

@ -280,6 +280,8 @@ function newobject:SetPos(x, y, center)
self.staticy = y
end
return self
end
--[[---------------------------------------------------------
@ -301,6 +303,8 @@ function newobject:SetX(x, center)
else
self.staticx = x
end
return self
end
@ -324,6 +328,8 @@ function newobject:SetY(y, center)
self.staticy = y
end
return self
end
--[[---------------------------------------------------------
@ -410,6 +416,8 @@ function newobject:Center(area)
self.staticy = height/2 - self.height/2
end
return self
end
--[[---------------------------------------------------------
@ -429,6 +437,8 @@ function newobject:CenterX()
self.staticx = width/2 - self.width/2
end
return self
end
--[[---------------------------------------------------------
@ -448,6 +458,8 @@ function newobject:CenterY()
self.staticy = height/2 - self.height/2
end
return self
end
--[[---------------------------------------------------------
@ -462,6 +474,8 @@ function newobject:CenterWithinArea(x, y, width, height)
self.x = x + width/2 - selfwidth/2
self.y = y + height/2 - selfheight/2
return self
end
--[[---------------------------------------------------------
@ -473,6 +487,8 @@ function newobject:SetSize(width, height)
self.width = width
self.height = height
return self
end
--[[---------------------------------------------------------
@ -482,6 +498,7 @@ end
function newobject:SetWidth(width)
self.width = width
return self
end
@ -492,6 +509,7 @@ end
function newobject:SetHeight(height)
self.height = height
return self
end
@ -548,6 +566,8 @@ function newobject:SetVisible(bool)
end
end
return self
end
--[[---------------------------------------------------------
@ -580,6 +600,7 @@ function newobject:SetParent(parent)
self:SetState(tparent.state)
table.insert(tparent.children, self)
return self
end
@ -619,6 +640,8 @@ function newobject:Remove()
end
end
return self
end
--[[---------------------------------------------------------
@ -645,6 +668,8 @@ function newobject:SetClickBounds(x, y, width, height)
end
end
return self
end
--[[---------------------------------------------------------
@ -682,6 +707,8 @@ function newobject:RemoveClickBounds()
end
end
return self
end
--[[---------------------------------------------------------
@ -701,6 +728,8 @@ function newobject:InClickBounds()
return false
end
return self
end
--[[---------------------------------------------------------
@ -926,6 +955,8 @@ function newobject:MoveToTop()
table.insert(pchildren, self)
end
return self
end
--[[---------------------------------------------------------
@ -951,6 +982,8 @@ function newobject:SetSkin(name)
end
end
return self
end
--[[---------------------------------------------------------
@ -986,6 +1019,7 @@ end
function newobject:SetAlwaysUpdate(bool)
self.alwaysupdate = bool
return self
end
@ -1007,6 +1041,7 @@ end
function newobject:SetRetainSize(bool)
self.retainsize = bool
return self
end
@ -1114,6 +1149,7 @@ function newobject:SetDrawOrder()
loveframes.drawcount = loveframes.drawcount + 1
self.draworder = loveframes.drawcount
return self
end
@ -1134,6 +1170,7 @@ end
function newobject:SetProperty(name, value)
self[name] = value
return self
end
@ -1188,6 +1225,8 @@ function newobject:SetState(name)
end
end
return self
end
--[[---------------------------------------------------------

View File

@ -193,6 +193,7 @@ end
function newobject:SetText(text)
self.text = text
return self
end
@ -213,6 +214,7 @@ end
function newobject:SetClickable(bool)
self.clickable = bool
return self
end
@ -233,6 +235,7 @@ end
function newobject:SetEnabled(bool)
self.enabled = bool
return self
end

View File

@ -268,6 +268,8 @@ function newobject:SetText(text)
self.internals = {}
end
return self
end
--[[---------------------------------------------------------
@ -296,6 +298,8 @@ function newobject:SetSize(width, height)
self.boxwidth = width
self.boxheight = height
return self
end
--[[---------------------------------------------------------
@ -305,6 +309,7 @@ end
function newobject:SetWidth(width)
self.boxwidth = width
return self
end
@ -315,6 +320,7 @@ end
function newobject:SetHeight(height)
self.boxheight = height
return self
end
@ -332,6 +338,8 @@ function newobject:SetChecked(bool)
onchanged(self)
end
return self
end
--[[---------------------------------------------------------
@ -359,6 +367,8 @@ function newobject:SetFont(font)
text:SetFont(font)
end
return self
end
--[[---------------------------------------------------------
@ -408,6 +418,7 @@ end
function newobject:SetEnabled(bool)
self.enabled = bool
return self
end

View File

@ -216,6 +216,7 @@ end
function newobject:SetText(text)
self.text = text
return self
end
@ -250,6 +251,8 @@ function newobject:SetObject(object)
object:SetPos(self.padding, self.closedheight + self.padding)
table.insert(self.children, object)
return self
end
--[[---------------------------------------------------------
@ -276,6 +279,7 @@ end
function newobject:SetSize(width, height)
self.width = width
return self
end
@ -285,7 +289,7 @@ end
--]]---------------------------------------------------------
function newobject:SetHeight(height)
return
return self
end
@ -296,6 +300,7 @@ end
function newobject:SetClosedHeight(height)
self.closedheight = height
return self
end
@ -342,6 +347,8 @@ function newobject:SetOpen(bool)
onopenedclosed(self)
end
return self
end
--[[---------------------------------------------------------

View File

@ -234,6 +234,8 @@ function newobject:AdjustColumns()
x = x + columnwidth
end
return self
end
--[[---------------------------------------------------------
@ -254,6 +256,8 @@ function newobject:AddColumn(name)
list:SetSize(width, height)
list:SetPos(0, 0)
return self
end
--[[---------------------------------------------------------
@ -267,6 +271,7 @@ function newobject:AddRow(...)
local list = internals[1]
list:AddRow(arg)
return self
end
@ -308,6 +313,8 @@ function newobject:SetSize(width, height)
list:CalculateSize()
list:RedoLayout()
return self
end
--[[---------------------------------------------------------
@ -327,6 +334,8 @@ function newobject:SetWidth(width)
list:CalculateSize()
list:RedoLayout()
return self
end
--[[---------------------------------------------------------
@ -346,6 +355,8 @@ function newobject:SetHeight(height)
list:CalculateSize()
list:RedoLayout()
return self
end
--[[---------------------------------------------------------
@ -359,6 +370,7 @@ function newobject:SetMaxColorIndex(num)
local list = internals[1]
list.colorindexmax = num
return self
end
@ -372,6 +384,7 @@ function newobject:Clear()
local list = internals[1]
list:Clear()
return self
end
@ -395,6 +408,8 @@ function newobject:SetAutoScroll(bool)
end
end
return self
end
--[[---------------------------------------------------------
@ -406,6 +421,7 @@ function newobject:SetButtonScrollAmount(amount)
self.buttonscrollamount = amount
self.internals[1].buttonscrollamount = amount
return self
end
@ -428,6 +444,7 @@ function newobject:SetMouseWheelScrollAmount(amount)
self.mousewheelscrollamount = amount
self.internals[1].mousewheelscrollamount = amount
return self
end
@ -459,6 +476,7 @@ function newobject:SetColumnHeight(height)
list:CalculateSize()
list:RedoLayout()
return self
end
@ -471,6 +489,7 @@ function newobject:SetDTScrolling(bool)
self.dtscrolling = bool
self.internals[1].dtscrolling = bool
return self
end
@ -520,6 +539,8 @@ function newobject:SelectRow(row, ctrl)
end
end
return self
end
--[[---------------------------------------------------------
@ -530,6 +551,7 @@ end
function newobject:DeselectRow(row)
row.selected = false
return self
end
@ -561,6 +583,7 @@ end
function newobject:SetSelectionEnabled(bool)
self.selectionenabled = bool
return self
end
@ -583,6 +606,7 @@ end
function newobject:SetMultiselectEnabled(bool)
self.multiselect = bool
return self
end
@ -611,6 +635,8 @@ function newobject:RemoveColumn(id)
end
end
return self
end
--[[---------------------------------------------------------
@ -627,6 +653,8 @@ function newobject:SetColumnName(id, name)
end
end
return self
end
--[[---------------------------------------------------------
@ -655,6 +683,7 @@ function newobject:SizeToChildren(max)
self:SetSize(width, height)
self:AdjustColumns()
return self
end
@ -674,6 +703,7 @@ function newobject:RemoveRow(id)
list:CalculateSize()
list:RedoLayout()
return self
end
@ -692,6 +722,8 @@ function newobject:SetRowColumnText(text, rowid, columnid)
row.columndata[columnid] = text
end
return self
end
--[[---------------------------------------------------------
@ -710,4 +742,6 @@ function newobject:SetRowColumnData(rowid, columndata)
end
end
return self
end

View File

@ -197,6 +197,8 @@ function newobject:AddItem(object)
table.insert(children, object)
self:LayoutObjects()
return self
end
--[[---------------------------------------------------------
@ -218,6 +220,7 @@ function newobject:RemoveItem(data)
end
self:LayoutObjects()
return self
end
@ -268,6 +271,8 @@ function newobject:LayoutObjects()
self.height = height + largest_height
end
return self
end
--[[---------------------------------------------------------
@ -277,6 +282,7 @@ end
function newobject:SetLayoutType(ltype)
self.layout = ltype
return self
end
@ -298,6 +304,7 @@ end
function newobject:SetTopMargin(margin)
self.topmargin = margin
return self
end
@ -319,6 +326,7 @@ end
function newobject:SetName(name)
self.name = name
return self
end

View File

@ -663,6 +663,7 @@ end
function newobject:SetName(name)
self.name = name
return self
end
@ -683,6 +684,7 @@ end
function newobject:SetDraggable(bool)
self.draggable = bool
return self
end
@ -705,6 +707,7 @@ end
function newobject:SetScreenLocked(bool)
self.screenlocked = bool
return self
end
@ -730,6 +733,7 @@ function newobject:ShowCloseButton(bool)
close.visible = bool
self.showclose = bool
return self
end
@ -776,6 +780,8 @@ function newobject:MakeTop()
end
end
return self
end
--[[---------------------------------------------------------
@ -816,6 +822,8 @@ function newobject:SetModal(bool)
end
end
return self
end
--[[---------------------------------------------------------
@ -849,6 +857,8 @@ function newobject:SetVisible(bool)
closebutton.visible = bool
end
return self
end
--[[---------------------------------------------------------
@ -859,6 +869,7 @@ end
function newobject:SetParentLocked(bool)
self.parentlocked = bool
return self
end
@ -885,6 +896,8 @@ function newobject:SetIcon(icon)
self.icon = icon
end
return self
end
--[[---------------------------------------------------------
@ -912,6 +925,7 @@ end
function newobject:SetDockable(dockable)
self.dockable = dockable
return self
end
@ -934,6 +948,7 @@ end
function newobject:SetDockZoneSize(size)
self.dockzonesize = size
return self
end
@ -954,6 +969,7 @@ end
function newobject:SetResizable(bool)
self.canresize = bool
return self
end
@ -974,6 +990,7 @@ end
function newobject:SetMinWidth(width)
self.minwidth = width
return self
end
@ -994,6 +1011,7 @@ end
function newobject:SetMaxWidth(width)
self.maxwidth = width
return self
end
@ -1014,6 +1032,7 @@ end
function newobject:SetMinHeight(height)
self.minheight = height
return self
end
@ -1034,6 +1053,7 @@ end
function newobject:SetMaxHeight(height)
self.maxheight = height
return self
end

View File

@ -221,6 +221,8 @@ function newobject:AddItem(object, row, column)
object.height = ch - (self.cellpadding * 2)
end
return self
end
--[[---------------------------------------------------------
@ -250,6 +252,7 @@ end
function newobject:SetItemAutoSize(bool)
self.itemautosize = bool
return self
end
@ -271,6 +274,7 @@ end
function newobject:SetRows(rows)
self.rows = rows
return self
end
@ -292,6 +296,7 @@ end
function newobject:SetColumns(columns)
self.columns = columns
return self
end
@ -312,6 +317,7 @@ end
function newobject:SetCellWidth(width)
self.cellwidth = width
return self
end
@ -332,6 +338,7 @@ end
function newobject:SetCellHeight(height)
self.cellheight = height
return self
end
@ -353,6 +360,7 @@ function newobject:SetCellSize(width, height)
self.cellwidth = width
self.cellheight = height
return self
end
@ -373,6 +381,7 @@ end
function newobject:SetCellPadding(padding)
self.cellpadding = padding
return self
end

View File

@ -122,6 +122,8 @@ function newobject:SetImage(image)
self.width = self.image:getWidth()
self.height = self.image:getHeight()
return self
end
--[[---------------------------------------------------------
@ -141,6 +143,7 @@ end
function newobject:SetColor(r, g, b, a)
self.imagecolor = {r, g, b, a}
return self
end
@ -161,6 +164,7 @@ end
function newobject:SetOrientation(orientation)
self.orientation = orientation
return self
end
@ -181,6 +185,7 @@ end
function newobject:SetScaleX(scalex)
self.scalex = scalex
return self
end
@ -201,6 +206,7 @@ end
function newobject:SetScaleY(scaley)
self.scaley = scaley
return self
end
@ -223,6 +229,8 @@ function newobject:SetScale(scalex, scaley)
self.scalex = scalex
self.scaley = scaley
return self
end
--[[---------------------------------------------------------
@ -242,6 +250,7 @@ end
function newobject:SetOffsetX(x)
self.offsetx = x
return self
end
@ -262,6 +271,7 @@ end
function newobject:SetOffsetY(y)
self.offsety = y
return self
end
@ -284,6 +294,8 @@ function newobject:SetOffset(x, y)
self.offsetx = x
self.offsety = y
return self
end
--[[---------------------------------------------------------
@ -303,6 +315,7 @@ end
function newobject:SetShearX(shearx)
self.shearx = shearx
return self
end
@ -323,6 +336,7 @@ end
function newobject:SetShearY(sheary)
self.sheary = sheary
return self
end
@ -345,6 +359,8 @@ function newobject:SetShear(shearx, sheary)
self.shearx = shearx
self.sheary = sheary
return self
end
--[[---------------------------------------------------------

View File

@ -195,6 +195,7 @@ end
function newobject:SetText(text)
self.text = text
return self
end
@ -215,6 +216,7 @@ end
function newobject:SetClickable(bool)
self.clickable = bool
return self
end
@ -235,6 +237,7 @@ end
function newobject:SetEnabled(bool)
self.enabled = bool
return self
end
@ -259,6 +262,8 @@ function newobject:SetImage(image)
else
self.image = image
end
return self
end
@ -284,7 +289,9 @@ function newobject:SizeToImage()
self.width = image:getWidth()
self.height = image:getHeight()
end
return self
end
--[[---------------------------------------------------------

View File

@ -175,6 +175,7 @@ end
function newobject:SetFollowCursor(bool)
self.followcursor = bool
return self
end
@ -199,6 +200,8 @@ function newobject:SetObject(object)
self.x = object.x
self.y = object.y
return self
end
--[[---------------------------------------------------------
@ -221,6 +224,7 @@ function newobject:SetText(text)
local textobject = internals[1]
textobject:SetText(text)
return self
end
@ -248,6 +252,7 @@ function newobject:SetTextMaxWidth(width)
local textobject = internals[1]
textobject:SetMaxWidth(width)
return self
end
@ -258,6 +263,7 @@ end
function newobject:SetOffsetX(xoffset)
self.xoffset = xoffset
return self
end
@ -278,6 +284,7 @@ end
function newobject:SetOffsetY(yoffset)
self.yoffset = yoffset
return self
end
@ -300,6 +307,8 @@ function newobject:SetOffsets(xoffset, yoffset)
self.xoffset = xoffset
self.yoffset = yoffset
return self
end
--[[---------------------------------------------------------
@ -319,6 +328,7 @@ end
function newobject:SetPadding(padding)
self.padding = padding
return self
end
@ -332,6 +342,7 @@ function newobject:SetFont(font)
local textobject = internals[1]
textobject:SetFont(font)
return self
end
@ -356,6 +367,7 @@ end
function newobject:SetFollowObject(bool)
self.followobject = bool
return self
end

View File

@ -272,6 +272,8 @@ function newobject:AddItem(object)
self:CalculateSize()
self:RedoLayout()
return self
end
--[[---------------------------------------------------------
@ -295,6 +297,8 @@ function newobject:RemoveItem(data)
self:CalculateSize()
self:RedoLayout()
return self
end
--[[---------------------------------------------------------
@ -389,6 +393,8 @@ function newobject:CalculateSize()
end
end
return self
end
--[[---------------------------------------------------------
@ -498,6 +504,8 @@ function newobject:RedoLayout()
end
end
return self
end
--[[---------------------------------------------------------
@ -520,6 +528,8 @@ function newobject:SetDisplayType(type)
self:CalculateSize()
self:RedoLayout()
end
return self
end
@ -549,6 +559,8 @@ function newobject:SetPadding(amount)
self:RedoLayout()
end
return self
end
--[[---------------------------------------------------------
@ -567,6 +579,8 @@ function newobject:SetSpacing(amount)
self:RedoLayout()
end
return self
end
--[[---------------------------------------------------------
@ -578,6 +592,8 @@ function newobject:Clear()
self.children = {}
self:CalculateSize()
self:RedoLayout()
return self
end
@ -591,6 +607,8 @@ function newobject:SetWidth(width)
self:CalculateSize()
self:RedoLayout()
return self
end
--[[---------------------------------------------------------
@ -603,6 +621,8 @@ function newobject:SetHeight(height)
self:CalculateSize()
self:RedoLayout()
return self
end
--[[---------------------------------------------------------
@ -616,6 +636,8 @@ function newobject:SetSize(width, height)
self:CalculateSize()
self:RedoLayout()
return self
end
--[[---------------------------------------------------------
@ -655,6 +677,8 @@ function newobject:SetAutoScroll(bool)
scrollbar.autoscroll = bool
end
return self
end
--[[---------------------------------------------------------
@ -665,6 +689,7 @@ end
function newobject:SetButtonScrollAmount(amount)
self.buttonscrollamount = amount
return self
end
@ -686,6 +711,7 @@ end
function newobject:SetMouseWheelScrollAmount(amount)
self.mousewheelscrollamount = amount
return self
end
@ -715,6 +741,8 @@ function newobject:EnableHorizontalStacking(bool)
self:RedoLayout()
end
return self
end
--[[---------------------------------------------------------
@ -736,6 +764,7 @@ end
function newobject:SetDTScrolling(bool)
self.dtscrolling = bool
return self
end

View File

@ -218,6 +218,7 @@ function newobject:AddOption(text, icon, func)
menuoption:SetFunction(func)
table.insert(self.internals, menuoption)
return self
end
@ -234,6 +235,8 @@ function newobject:RemoveOption(id)
end
end
return self
end
--[[---------------------------------------------------------
@ -266,6 +269,7 @@ function newobject:AddSubMenu(text, icon, menu)
end
table.insert(self.internals, menuoption)
return self
end
@ -278,6 +282,7 @@ function newobject:AddDivider()
local menuoption = loveframes.objects["menuoption"]:new(self, "divider")
table.insert(self.internals, menuoption)
return self
end
@ -318,4 +323,6 @@ function newobject:SetVisible(bool)
end
end
return self
end

View File

@ -176,6 +176,8 @@ function newobject:AddChoice(choice)
local choices = self.choices
table.insert(choices, choice)
return self
end
--[[---------------------------------------------------------
@ -194,6 +196,8 @@ function newobject:RemoveChoice(choice)
end
end
return self
end
--[[---------------------------------------------------------
@ -203,6 +207,7 @@ end
function newobject:SetChoice(choice)
self.choice = choice
return self
end
@ -224,6 +229,8 @@ function newobject:SelectChoice(choice)
onchoiceselected(self, choice)
end
return self
end
--[[---------------------------------------------------------
@ -233,6 +240,7 @@ end
function newobject:SetListHeight(height)
self.listheight = height
return self
end
@ -243,6 +251,7 @@ end
function newobject:SetPadding(padding)
self.listpadding = padding
return self
end
@ -253,6 +262,7 @@ end
function newobject:SetSpacing(spacing)
self.listspacing = spacing
return self
end
@ -283,6 +293,7 @@ end
function newobject:SetText(text)
self.text = text
return self
end
@ -304,6 +315,7 @@ end
function newobject:SetButtonScrollAmount(amount)
self.buttonscrollamount = amount
return self
end
@ -325,6 +337,7 @@ end
function newobject:SetMouseWheelScrollAmount(amount)
self.mousewheelscrollamount = amount
return self
end
@ -346,6 +359,7 @@ end
function newobject:SetDTScrolling(bool)
self.dtscrolling = bool
return self
end
@ -374,6 +388,8 @@ function newobject:Sort(func)
table.sort(self.choices, default)
end
return self
end
--[[---------------------------------------------------------
@ -383,6 +399,7 @@ end
function newobject:SetSortFunction(func)
self.sortfunc = func
return self
end
@ -407,6 +424,8 @@ function newobject:Clear()
self.choice = ""
self.text = "Select an option"
return self
end
--[[---------------------------------------------------------
@ -416,6 +435,7 @@ end
function newobject:SetEnabled(bool)
self.enabled = bool
return self
end

View File

@ -292,6 +292,8 @@ function newobject:SetValue(value)
onvaluechanged(self, value)
end
return self
end
--[[---------------------------------------------------------
@ -311,6 +313,7 @@ end
function newobject:SetIncreaseAmount(amount)
self.increaseamount = amount
return self
end
@ -331,6 +334,7 @@ end
function newobject:SetDecreaseAmount(amount)
self.decreaseamount = amount
return self
end
@ -364,6 +368,8 @@ function newobject:SetMax(max)
end
end
return self
end
--[[---------------------------------------------------------
@ -396,6 +402,8 @@ function newobject:SetMin(min)
end
end
return self
end
--[[---------------------------------------------------------
@ -437,6 +445,8 @@ function newobject:SetMinMax(min, max)
end
end
return self
end
--[[---------------------------------------------------------
@ -495,6 +505,8 @@ function newobject:ModifyValue(type)
end
end
return self
end
--[[---------------------------------------------------------
@ -505,6 +517,7 @@ end
function newobject:SetDecimals(decimals)
self.decimals = decimals
return self
end

View File

@ -171,6 +171,7 @@ end
function newobject:SetMax(max)
self.max = max
return self
end
@ -191,6 +192,7 @@ end
function newobject:SetMin(min)
self.min = min
return self
end
@ -213,6 +215,8 @@ function newobject:SetMinMax(min, max)
self.min = min
self.max = max
return self
end
--[[---------------------------------------------------------
@ -242,6 +246,8 @@ function newobject:SetValue(value)
self.value = value
end
return self
end
--[[---------------------------------------------------------
@ -265,6 +271,8 @@ function newobject:SetLerp(bool)
self.lerpto = self:GetValue()
self.lerpvalue = self:GetValue()
return self
end
--[[---------------------------------------------------------
@ -285,6 +293,7 @@ end
function newobject:SetLerpRate(rate)
self.lerprate = rate
return self
end
@ -326,6 +335,7 @@ end
function newobject:SetText(text)
self.text = text
return self
end

View File

@ -261,6 +261,8 @@ function newobject:SetValue(value)
onvaluechanged(self, newval)
end
return self
end
--[[---------------------------------------------------------
@ -285,6 +287,8 @@ function newobject:SetMax(max)
self.value = self.max
end
return self
end
--[[---------------------------------------------------------
@ -309,6 +313,8 @@ function newobject:SetMin(min)
self.value = self.min
end
return self
end
--[[---------------------------------------------------------
@ -338,6 +344,8 @@ function newobject:SetMinMax(min, max)
self.value = self.min
end
return self
end
--[[---------------------------------------------------------
@ -357,6 +365,7 @@ end
function newobject:SetText(text)
self.text = text
return self
end
@ -378,6 +387,7 @@ end
function newobject:SetDecimals(decimals)
self.decimals = decimals
return self
end
@ -406,6 +416,8 @@ function newobject:SetButtonSize(width, height)
sliderbutton.height = height
end
return self
end
--[[---------------------------------------------------------
@ -435,6 +447,8 @@ function newobject:SetSlideType(slidetype)
self:SetValue(self.min)
end
return self
end
--[[---------------------------------------------------------
@ -455,6 +469,7 @@ end
function newobject:SetScrollable(bool)
self.scrollable = bool
return self
end
@ -477,6 +492,7 @@ end
function newobject:SetScrollIncrease(increase)
self.scrollincrease = increase
return self
end
@ -499,6 +515,7 @@ end
function newobject:SetScrollDecrease(decrease)
self.scrolldecrease = decrease
return self
end
@ -520,6 +537,7 @@ end
function newobject:SetEnabled(bool)
self.enabled = bool
return self
end

View File

@ -336,6 +336,8 @@ function newobject:AddTab(name, object, tip, image, onopened, onclosed)
object:SetSize(self.width - padding * 2, (self.height - tabheight) - padding * 2)
end
return self
end
--[[---------------------------------------------------------
@ -467,6 +469,8 @@ function newobject:SwitchToTab(tabnumber)
self.tab = tabnumber
self.children[tabnumber].visible = true
return self
end
--[[---------------------------------------------------------
@ -483,6 +487,8 @@ function newobject:SetScrollButtonSize(width, height)
end
end
return self
end
--[[---------------------------------------------------------
@ -492,6 +498,7 @@ end
function newobject:SetPadding(padding)
self.padding = padding
return self
end
@ -537,6 +544,8 @@ function newobject:SetTabHeight(height)
end
end
return self
end
--[[---------------------------------------------------------
@ -553,6 +562,8 @@ function newobject:SetToolTipFont(font)
end
end
return self
end
--[[---------------------------------------------------------
@ -597,6 +608,7 @@ function newobject:RemoveTab(id)
end
self.tabnumber = tabnumber
return self
end
@ -608,6 +620,7 @@ end
function newobject:SetButtonScrollAmount(amount)
self.buttonscrollamount = amount
return self
end
@ -629,6 +642,7 @@ end
function newobject:SetMouseWheelScrollAmount(amount)
self.mousewheelscrollamount = amount
return self
end
@ -650,6 +664,7 @@ end
function newobject:SetDTScrolling(bool)
self.dtscrolling = bool
return self
end
@ -684,6 +699,8 @@ function newobject:SetTabObject(id, object)
children[id] = object
end
return self
end
--[[---------------------------------------------------------
@ -693,6 +710,7 @@ end
function newobject:SetButtonAreaX(x)
self.buttonareax = x
return self
end
@ -713,6 +731,7 @@ end
function newobject:SetButtonAreaWidth(width)
self.buttonareawidth = width
return self
end
@ -734,6 +753,7 @@ end
function newobject:SetAutoButtonAreaWidth(bool)
self.autobuttonareawidth = bool
return self
end

View File

@ -430,6 +430,7 @@ function newobject:SetText(t)
end
self.height = drawy + prevlargestheight
return self
end
@ -521,6 +522,8 @@ function newobject:DrawText()
end
end
return self
end
--[[---------------------------------------------------------
@ -534,6 +537,8 @@ function newobject:SetMaxWidth(width)
self.maxw = width
self:SetText(original)
return self
end
--[[---------------------------------------------------------
@ -553,6 +558,7 @@ end
function newobject:SetWidth(width)
self:SetMaxWidth(width)
return self
end
@ -573,6 +579,7 @@ end
function newobject:SetSize(width, height)
self:SetMaxWidth(width)
return self
end
@ -591,6 +598,8 @@ function newobject:SetFont(font)
self:SetText(original)
end
return self
end
--[[---------------------------------------------------------
@ -620,6 +629,7 @@ end
function newobject:SetIgnoreNewlines(bool)
self.ignorenewlines = bool
return self
end
@ -641,6 +651,7 @@ end
function newobject:SetShadow(bool)
self.shadow = bool
return self
end
@ -664,6 +675,8 @@ function newobject:SetShadowOffsets(offsetx, offsety)
self.shadowxoffset = offsetx
self.shadowyoffset = offsety
return self
end
--[[---------------------------------------------------------
@ -683,6 +696,7 @@ end
function newobject:SetShadowColor(r, g, b, a)
self.shadowcolor = {r, g, b, a}
return self
end
@ -703,6 +717,7 @@ end
function newobject:SetDefaultColor(r, g, b, a)
self.defaultcolor = {r, g, b, a}
return self
end
@ -725,6 +740,7 @@ end
function newobject:SetLinksEnabled(enabled)
self.linksenabled = enabled
return self
end
@ -747,6 +763,7 @@ end
function newobject:SetDetectLinks(detect)
self.detectlinks = detect
return self
end

View File

@ -866,6 +866,8 @@ function newobject:RunKey(key, unicode, is_text)
ontextchanged(self, ckey)
end
return self
end
--[[---------------------------------------------------------
@ -895,6 +897,8 @@ function newobject:MoveIndicator(num, exact)
self.showindicator = true
self:UpdateIndicator()
return self
end
--[[---------------------------------------------------------
@ -954,6 +958,8 @@ function newobject:UpdateIndicator()
self.indicatory = texty
end
return self
end
--[[---------------------------------------------------------
@ -1104,6 +1110,8 @@ function newobject:GetTextCollisions(x, y)
end
end
return self
end
--[[---------------------------------------------------------
@ -1135,6 +1143,8 @@ function newobject:PositionText()
self.texty = (y - offsety) + textoffsety
end
return self
end
--[[---------------------------------------------------------
@ -1144,6 +1154,7 @@ end
function newobject:SetTextOffsetX(num)
self.textoffsetx = num
return self
end
@ -1154,6 +1165,7 @@ end
function newobject:SetTextOffsetY(num)
self.textoffsety = num
return self
end
@ -1164,6 +1176,7 @@ end
function newobject:SetFont(font)
self.font = font
return self
end
@ -1203,6 +1216,8 @@ function newobject:SetFocus(focus)
end
end
return self
end
--[[---------------------------------------------------------
@ -1232,6 +1247,7 @@ end
function newobject:SetLimit(limit)
self.limit = limit
return self
end
@ -1243,6 +1259,7 @@ end
function newobject:SetUsable(usable)
self.usable = usable
return self
end
@ -1265,6 +1282,7 @@ end
function newobject:SetUnusable(unusable)
self.unusable = unusable
return self
end
@ -1291,6 +1309,8 @@ function newobject:Clear()
self.offsety = 0
self.indicatornum = 0
return self
end
--[[---------------------------------------------------------
@ -1324,6 +1344,8 @@ function newobject:SetText(text)
self.indicatornum = #text
end
return self
end
--[[---------------------------------------------------------
@ -1375,6 +1397,8 @@ function newobject:SetMultiline(bool)
self.hbar = false
self.linenumberspanel = false
end
return self
end
@ -1490,6 +1514,8 @@ function newobject:ShowLineNumbers(bool)
self.linenumbers = bool
end
return self
end
--[[---------------------------------------------------------
@ -1611,6 +1637,7 @@ end
function newobject:SetTabReplacement(tabreplacement)
self.tabreplacement = tabreplacement
return self
end
@ -1632,6 +1659,7 @@ end
function newobject:SetEditable(bool)
self.editable = bool
return self
end
@ -1654,6 +1682,7 @@ end
function newobject:SetButtonScrollAmount(amount)
self.buttonscrollamount = amount
return self
end
@ -1675,6 +1704,7 @@ end
function newobject:SetMouseWheelScrollAmount(amount)
self.mousewheelscrollamount = amount
return self
end
@ -1703,6 +1733,8 @@ function newobject:SetAutoScroll(bool)
internals[2].internals[1].internals[1].autoscroll = bool
end
return self
end
--[[---------------------------------------------------------
@ -1723,6 +1755,7 @@ end
function newobject:SetRepeatDelay(delay)
self.repeatdelay = delay
return self
end
@ -1743,6 +1776,7 @@ end
function newobject:SetRepeatRate(rate)
self.repeatrate = rate
return self
end
@ -1763,6 +1797,7 @@ end
function newobject:SetValue(value)
self:SetText(value)
return self
end
@ -1788,6 +1823,8 @@ function newobject:SetVisible(bool)
self.keydown = "none"
end
return self
end
--[[---------------------------------------------------------
@ -1803,6 +1840,8 @@ function newobject:Copy()
love.system.setClipboardText(text)
end
return self
end
--[[---------------------------------------------------------
@ -1920,6 +1959,8 @@ function newobject:Paste()
onpaste(self, text)
end
return self
end
--[[---------------------------------------------------------
@ -1929,6 +1970,7 @@ end
function newobject:SelectAll()
self.alltextselected = true
return self
end
@ -1939,6 +1981,7 @@ end
function newobject:DeselectAll()
self.alltextselected = false
return self
end
@ -1949,6 +1992,7 @@ end
function newobject:SetMasked(masked)
self.masked = masked
return self
end
@ -1969,6 +2013,7 @@ end
function newobject:SetMaskChar(char)
self.maskchar = char
return self
end
@ -1989,6 +2034,7 @@ end
function newobject:SetPlaceholderText(text)
self.placeholder = text
return self
end