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:
Kenny Shields 2013-11-07 18:24:23 -05:00
parent b4ae334842
commit 973bb1b8ef
4 changed files with 28 additions and 24 deletions

View File

@ -13,6 +13,8 @@ Version 0.9.6.4 - Alpha (Release Date TBD)
[ADDED] a new textinput method: GetMasked()
[ADDED] a new textinput method: SetMaskChar(char)
[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: GetLinksEnabled()
[ADDED] a new text event callback: OnClickLink(object, text)

View File

@ -513,8 +513,10 @@ function newobject:SelectRow(row, ctrl)
onrowselected(self, row, row:GetColumnData())
end
end
elseif v ~= row and not multiselect and not ctrl then
v.selected = false
elseif v ~= row then
if (not multiselect and ctrl) or (not multiselect and not ctrl) or (multiselect and not ctrl) then
v.selected = false
end
end
end

View File

@ -1325,26 +1325,6 @@ function newobject:GetText()
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)
- desc: enables or disables allowing multiple lines for
@ -1972,3 +1952,23 @@ function newobject:GetMaskChar()
return self.maskchar
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

View File

@ -908,7 +908,7 @@ function skin.DrawTextInput(object)
local text = object:GetText()
local multiline = object:GetMultiLine()
local lines = object:GetLines()
local placeholder = object:GetPlaceholder()
local placeholder = object:GetPlaceholderText()
local offsetx = object:GetOffsetX()
local offsety = object:GetOffsetY()
local indicatorx = object:GetIndicatorX()
@ -1031,7 +1031,7 @@ function skin.DrawTextInput(object)
local maskchar = object:GetMaskChar()
str = str:gsub(".", maskchar)
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
else
str = lines[1]