Version 0.9.4.6 - Alpha (see changelog.txt)

This commit is contained in:
Kenny Shields 2012-12-10 09:19:35 -05:00
parent 4e2a12fe82
commit 105fcc31cc
8 changed files with 102 additions and 73 deletions

View File

@ -1,3 +1,15 @@
================================================
Version 0.9.4.6 - Alpha (December 10 - 2012)
================================================
[ADDED] a new textinput event callback: OnFocusGained(object)
[ADDED] a new textinput event callback: OnFocusLost(object)
[FIXED] the textinput object accepting input from the tab and delete keys when object.editable was set to false
[CHANGED] all "." are now replaced with "/" in loveframes.config["DIRECTORY"] after all inernal Love Frames libraries have been loaded (this is to prevent filesystem errors)
[REMOVED] loveframes.util.TrimString(string)
================================================
Version 0.9.4.5 - Alpha (November 28 - 2012)
================================================

View File

@ -9,7 +9,7 @@ loveframes = {}
-- library info
loveframes.info = {}
loveframes.info.author = "Kenny Shields"
loveframes.info.version = "0.9.4.5"
loveframes.info.version = "0.9.4.6"
loveframes.info.stage = "Alpha"
-- library configurations
@ -45,7 +45,11 @@ function loveframes.load()
require(dir .. ".templates")
require(dir .. ".debug")
-- create a list of gui objects and skins
-- replace all "." with "/" in the directory setting
dir = dir:gsub("%.", "/")
loveframes.config["DIRECTORY"] = dir
-- create a list of gui objects, skins and templates
local objects = loveframes.util.GetDirectoryContents(dir .. "/objects")
local skins = loveframes.util.GetDirectoryContents(dir .. "/skins")
local templates = loveframes.util.GetDirectoryContents(dir .. "/templates")
@ -72,7 +76,8 @@ function loveframes.load()
end
-- create the base gui object
loveframes.base = loveframes.objects["base"]:new()
local base = loveframes.objects["base"]
loveframes.base = base:new()
end

View File

@ -329,7 +329,7 @@ end
--[[---------------------------------------------------------
- func: RedoLayout()
- desc: used to redo the layour of the object
- desc: used to redo the layout of the object
--]]---------------------------------------------------------
function newobject:RedoLayout()

View File

@ -59,6 +59,8 @@ function newobject:initialize()
self.internal = false
self.OnEnter = nil
self.OnTextChanged = nil
self.OnFocusGained = nil
self.OnFocusLost = nil
end
@ -310,6 +312,9 @@ function newobject:mousepressed(x, y, button)
local vbar = self.vbar
local hbar = self.hbar
local scrollamount = self.mousewheelscrollamount
local focus = self.focus
local onfocusgained = self.OnFocusGained
local onfocuslost = self.OnFocusLost
local time = love.timer.getTime()
local inputobject = loveframes.inputobject
@ -333,6 +338,10 @@ function newobject:mousepressed(x, y, button)
self.lastclicktime = time
self:GetTextCollisions(x, y)
if onfocusgained and not focus then
onfocusgained(self)
end
local baseparent = self:GetBaseParent()
if baseparent and baseparent.type == "frame" then
@ -367,6 +376,9 @@ function newobject:mousepressed(x, y, button)
if inputobject == self then
loveframes.inputobject = false
if onfocuslost then
onfocuslost(self)
end
end
end
@ -542,15 +554,15 @@ function newobject:RunKey(key, unicode)
end
end
if not editable then
return
end
-- key input checking system
if key == "backspace" then
ckey = key
if not editable then
return
end
if alltextselected then
self:Clear()
self.alltextselected = false
@ -584,6 +596,10 @@ function newobject:RunKey(key, unicode)
elseif key == "delete" then
if not editable then
return
end
ckey = key
if alltextselected then
@ -652,10 +668,6 @@ function newobject:RunKey(key, unicode)
else
if unicode > 31 and unicode < 127 then
if not editable then
return
end
if alltextselected then
self.alltextselected = false
self:Clear()
@ -1044,9 +1056,21 @@ end
function newobject:SetFocus(focus)
local inputobject = loveframes.inputobject
local onfocusgained = self.OnFocusGained
local onfocuslost = self.OnFocusLost
self.focus = focus
if focus then
if onfocusgained then
onfocusgained(self)
end
else
if onfocuslost then
onfocuslost(self)
end
end
if inputobject == self then
loveframes.inputobject = false
end

View File

@ -2,7 +2,7 @@
## Information
Love Frames is a GUI library for [LOVE](https://love2d.org/). For information on installation and usage, please visit the wiki. A demo of the library can be found at: http://nikolairesokav.com/projects/loveframes/
Love Frames is a GUI library for [LOVE](https://love2d.org/). For information on installation and usage, please visit the [wiki](https://github.com/NikolaiResokav/LoveFrames/wiki). A demo of the library can be found at: http://nikolairesokav.com/projects/loveframes/
## License

View File

@ -229,18 +229,6 @@ function loveframes.util.SplitString(str, pat)
end
--[[---------------------------------------------------------
- func: TrimString(string)
- desc: trims spaces off of the beginning and end of
a string
- note: i take no credit for this function
--]]---------------------------------------------------------
function loveframes.util.TrimString(s)
return (s:gsub("^%s*(.-)%s*$", "%1"))
end
--[[---------------------------------------------------------
- func: RemoveAll()
- desc: removes all gui elements