mirror of
https://github.com/linux-man/LoveFrames.git
synced 2024-11-26 05:14:21 +00:00
method name changes and misc fixes
Renamed textinput:SetPlaceholder to textinput:SetPlaceholderText Renamed textinput:GetPlaceholder to textinput:GetPlaceholderText Fixed textinput placeholder text not displaying correctly in multiline mode Fixed columnlist row selection issues
This commit is contained in:
parent
b4ae334842
commit
973bb1b8ef
@ -13,6 +13,8 @@ Version 0.9.6.4 - Alpha (Release Date TBD)
|
|||||||
[ADDED] a new textinput method: GetMasked()
|
[ADDED] a new textinput method: GetMasked()
|
||||||
[ADDED] a new textinput method: SetMaskChar(char)
|
[ADDED] a new textinput method: SetMaskChar(char)
|
||||||
[ADDED] a new textinput method: GetMaskChar()
|
[ADDED] a new textinput method: GetMaskChar()
|
||||||
|
[ADDED] a new textinput method: SetPlaceholderText(text)
|
||||||
|
[ADDED] a new textinput method: GetPlaceholderText()
|
||||||
[ADDED] a new text method: SetLinksEnabled(enabled)
|
[ADDED] a new text method: SetLinksEnabled(enabled)
|
||||||
[ADDED] a new text method: GetLinksEnabled()
|
[ADDED] a new text method: GetLinksEnabled()
|
||||||
[ADDED] a new text event callback: OnClickLink(object, text)
|
[ADDED] a new text event callback: OnClickLink(object, text)
|
||||||
|
@ -513,10 +513,12 @@ function newobject:SelectRow(row, ctrl)
|
|||||||
onrowselected(self, row, row:GetColumnData())
|
onrowselected(self, row, row:GetColumnData())
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif v ~= row and not multiselect and not ctrl then
|
elseif v ~= row then
|
||||||
|
if (not multiselect and ctrl) or (not multiselect and not ctrl) or (multiselect and not ctrl) then
|
||||||
v.selected = false
|
v.selected = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1325,26 +1325,6 @@ function newobject:GetText()
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--[[---------------------------------------------------------
|
|
||||||
- func: SetText(text)
|
|
||||||
- desc: sets the object's placeholder
|
|
||||||
--]]---------------------------------------------------------
|
|
||||||
function newobject:SetPlaceholder(text)
|
|
||||||
|
|
||||||
self.placeholder = text
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
--[[---------------------------------------------------------
|
|
||||||
- func: GetText()
|
|
||||||
- desc: gets the object's placeholder
|
|
||||||
--]]---------------------------------------------------------
|
|
||||||
function newobject:GetPlaceholder()
|
|
||||||
|
|
||||||
return self.placeholder
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
--[[---------------------------------------------------------
|
--[[---------------------------------------------------------
|
||||||
- func: SetMultiline(bool)
|
- func: SetMultiline(bool)
|
||||||
- desc: enables or disables allowing multiple lines for
|
- desc: enables or disables allowing multiple lines for
|
||||||
@ -1972,3 +1952,23 @@ function newobject:GetMaskChar()
|
|||||||
return self.maskchar
|
return self.maskchar
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--[[---------------------------------------------------------
|
||||||
|
- func: SetPlaceholderText(text)
|
||||||
|
- desc: sets the object's placeholder text
|
||||||
|
--]]---------------------------------------------------------
|
||||||
|
function newobject:SetPlaceholderText(text)
|
||||||
|
|
||||||
|
self.placeholder = text
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
--[[---------------------------------------------------------
|
||||||
|
- func: GetPlaceholderText()
|
||||||
|
- desc: gets the object's placeholder text
|
||||||
|
--]]---------------------------------------------------------
|
||||||
|
function newobject:GetPlaceholderText()
|
||||||
|
|
||||||
|
return self.placeholder
|
||||||
|
|
||||||
|
end
|
@ -908,7 +908,7 @@ function skin.DrawTextInput(object)
|
|||||||
local text = object:GetText()
|
local text = object:GetText()
|
||||||
local multiline = object:GetMultiLine()
|
local multiline = object:GetMultiLine()
|
||||||
local lines = object:GetLines()
|
local lines = object:GetLines()
|
||||||
local placeholder = object:GetPlaceholder()
|
local placeholder = object:GetPlaceholderText()
|
||||||
local offsetx = object:GetOffsetX()
|
local offsetx = object:GetOffsetX()
|
||||||
local offsety = object:GetOffsetY()
|
local offsety = object:GetOffsetY()
|
||||||
local indicatorx = object:GetIndicatorX()
|
local indicatorx = object:GetIndicatorX()
|
||||||
@ -1031,7 +1031,7 @@ function skin.DrawTextInput(object)
|
|||||||
local maskchar = object:GetMaskChar()
|
local maskchar = object:GetMaskChar()
|
||||||
str = str:gsub(".", maskchar)
|
str = str:gsub(".", maskchar)
|
||||||
end
|
end
|
||||||
love.graphics.print(#str > 0 and str or (i == 1 and placeholder or ""), textx, texty + theight * i - theight)
|
love.graphics.print(#str > 0 and str or (#lines == 1 and placeholder or ""), textx, texty + theight * i - theight)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
str = lines[1]
|
str = lines[1]
|
||||||
|
Loading…
Reference in New Issue
Block a user