diff --git a/changelog.txt b/changelog.txt index f6022dc..be56939 100644 --- a/changelog.txt +++ b/changelog.txt @@ -31,6 +31,8 @@ Version 0.10 - Alpha (Release Date TBD) [ADDED] a new frame method: SetMinSize(width, height) [ADDED] a new frame method: GetMinSize() [ADDED] a new textinput method: ClearLine(line) +[ADDED] a new textinput method: SetTrackingEnabled(bool) +[ADDED] a new textinput method: GetTrackingEnabled() [ADDED] a new list method: GetAutoScroll() [FIXED] bug that would cause tabbuttons to be positioned incorrectly when scrolling with the mouse wheel @@ -56,6 +58,7 @@ Version 0.10 - Alpha (Release Date TBD) [CHANGED] template files are now expected to return a template table instead of calling loveframes.templates.Register [CHANGED] textinput tries to scroll horizontally only if alt is pressed [CHANGED] project-wide utf8 support +[CHANGED] the textinput's indicator is now always visible when being moved ================================================ Version 0.9.8.1 - Alpha (May 17 - 2014) diff --git a/init.lua b/init.lua index 419c635..6ddfe0b 100644 --- a/init.lua +++ b/init.lua @@ -47,13 +47,8 @@ loveframes.collisions = {} -- install directory of the library local dir = loveframes.config["DIRECTORY"] or path --- require the internal base libraries +-- require middleclass loveframes.class = require(dir .. ".third-party.middleclass") -require(dir .. ".libraries.util") -require(dir .. ".libraries.skins") -require(dir .. ".libraries.templates") -require(dir .. ".libraries.debug") -require(dir .. ".libraries.utf8") -- replace all "." with "/" in the directory setting dir = dir:gsub("\\", "/"):gsub("(%a)%.(%a)", "%1/%2") diff --git a/libraries/common.lua b/libraries/common.lua index 3941af5..a564707 100644 --- a/libraries/common.lua +++ b/libraries/common.lua @@ -1 +1 @@ -return {} \ No newline at end of file +return {} diff --git a/libraries/templates.lua b/libraries/templates.lua index 02f59c9..3e698d6 100644 --- a/libraries/templates.lua +++ b/libraries/templates.lua @@ -176,4 +176,4 @@ function loveframes.templates.ApplyToObject(object) end end -end \ No newline at end of file +end diff --git a/libraries/util.lua b/libraries/util.lua index 275d25d..e11efa1 100644 --- a/libraries/util.lua +++ b/libraries/util.lua @@ -369,4 +369,4 @@ function loveframes.util.IsCtrlDown() love.keyboard.isDown("lgui") or love.keyboard.isDown("rgui") end return love.keyboard.isDown("lctrl") or love.keyboard.isDown("rctrl") -end \ No newline at end of file +end diff --git a/objects/base.lua b/objects/base.lua index ff8e4bd..f758945 100644 --- a/objects/base.lua +++ b/objects/base.lua @@ -1272,4 +1272,4 @@ function newobject:GetState() return self.state -end \ No newline at end of file +end diff --git a/objects/button.lua b/objects/button.lua index 6e03f5f..46b827f 100644 --- a/objects/button.lua +++ b/objects/button.lua @@ -292,4 +292,4 @@ function newobject:GetToggleable() return self.toggleable -end \ No newline at end of file +end diff --git a/objects/checkbox.lua b/objects/checkbox.lua index a6d2337..07a4cb6 100644 --- a/objects/checkbox.lua +++ b/objects/checkbox.lua @@ -454,4 +454,4 @@ function newobject:GetEnabled() return self.enabled -end \ No newline at end of file +end diff --git a/objects/collapsiblecategory.lua b/objects/collapsiblecategory.lua index 9977711..dd3c051 100644 --- a/objects/collapsiblecategory.lua +++ b/objects/collapsiblecategory.lua @@ -368,4 +368,4 @@ function newobject:GetOpen() return self.open -end \ No newline at end of file +end diff --git a/objects/columnlist.lua b/objects/columnlist.lua index 2aa2101..c54b663 100644 --- a/objects/columnlist.lua +++ b/objects/columnlist.lua @@ -984,4 +984,3 @@ function newobject:SetColumnOrder(curid, newid) return self end - \ No newline at end of file diff --git a/objects/form.lua b/objects/form.lua index cf05485..d49cc94 100644 --- a/objects/form.lua +++ b/objects/form.lua @@ -342,4 +342,4 @@ function newobject:GetName() return self.name -end \ No newline at end of file +end diff --git a/objects/grid.lua b/objects/grid.lua index 93a7928..d2afbb2 100644 --- a/objects/grid.lua +++ b/objects/grid.lua @@ -397,4 +397,4 @@ function newobject:GetCellPadding() return self.cellpadding -end \ No newline at end of file +end diff --git a/objects/image.lua b/objects/image.lua index 28847cb..a7fec6e 100644 --- a/objects/image.lua +++ b/objects/image.lua @@ -417,4 +417,4 @@ function newobject:GetImageHeight() return image:getHeight() end -end \ No newline at end of file +end diff --git a/objects/imagebutton.lua b/objects/imagebutton.lua index 58ca099..682c64f 100644 --- a/objects/imagebutton.lua +++ b/objects/imagebutton.lua @@ -337,4 +337,4 @@ function newobject:GetImageHeight() return image:getHeight() end -end \ No newline at end of file +end diff --git a/objects/internal/closebutton.lua b/objects/internal/closebutton.lua index f5516e0..67f3798 100644 --- a/objects/internal/closebutton.lua +++ b/objects/internal/closebutton.lua @@ -184,4 +184,4 @@ function newobject:GetAutoPosition() return self.autoposition -end \ No newline at end of file +end diff --git a/objects/internal/columnlist/columnlistarea.lua b/objects/internal/columnlist/columnlistarea.lua index 8314a3a..e208544 100644 --- a/objects/internal/columnlist/columnlistarea.lua +++ b/objects/internal/columnlist/columnlistarea.lua @@ -454,4 +454,4 @@ function newobject:GetHorizontalScrollBody() return false -end \ No newline at end of file +end diff --git a/objects/internal/columnlist/columnlistrow.lua b/objects/internal/columnlist/columnlistrow.lua index 2692da3..37d2a8b 100644 --- a/objects/internal/columnlist/columnlistrow.lua +++ b/objects/internal/columnlist/columnlistrow.lua @@ -243,4 +243,4 @@ function newobject:GetSelected() return self.selected -end \ No newline at end of file +end diff --git a/objects/internal/linenumberspanel.lua b/objects/internal/linenumberspanel.lua index 944bc84..019e793 100644 --- a/objects/internal/linenumberspanel.lua +++ b/objects/internal/linenumberspanel.lua @@ -165,4 +165,4 @@ function newobject:GetOffsetY() return self.offsety -end \ No newline at end of file +end diff --git a/objects/internal/menuoption.lua b/objects/internal/menuoption.lua index 9e427ed..ec1becd 100644 --- a/objects/internal/menuoption.lua +++ b/objects/internal/menuoption.lua @@ -252,4 +252,4 @@ function newobject:SetFunction(func) self.func = func -end \ No newline at end of file +end diff --git a/objects/internal/modalbackground.lua b/objects/internal/modalbackground.lua index b1a5c5b..5ccc012 100644 --- a/objects/internal/modalbackground.lua +++ b/objects/internal/modalbackground.lua @@ -104,4 +104,4 @@ function newobject:draw() drawfunc(self) end -end \ No newline at end of file +end diff --git a/objects/internal/multichoice/multichoicelist.lua b/objects/internal/multichoice/multichoicelist.lua index e787446..b68979f 100644 --- a/objects/internal/multichoice/multichoicelist.lua +++ b/objects/internal/multichoice/multichoicelist.lua @@ -429,4 +429,4 @@ function newobject:Close() self:Remove() self.list.haslist = false -end \ No newline at end of file +end diff --git a/objects/internal/multichoice/multichoicerow.lua b/objects/internal/multichoice/multichoicerow.lua index 73e4280..ccba225 100644 --- a/objects/internal/multichoice/multichoicerow.lua +++ b/objects/internal/multichoice/multichoicerow.lua @@ -183,4 +183,4 @@ function newobject:GetText() return self.text -end \ No newline at end of file +end diff --git a/objects/internal/scrollable/scrollarea.lua b/objects/internal/scrollable/scrollarea.lua index 2c28bfa..d263753 100644 --- a/objects/internal/scrollable/scrollarea.lua +++ b/objects/internal/scrollable/scrollarea.lua @@ -236,4 +236,4 @@ function newobject:GetBarType() return self.bartype -end \ No newline at end of file +end diff --git a/objects/internal/scrollable/scrollbar.lua b/objects/internal/scrollable/scrollbar.lua index 4bcb43e..272ac33 100644 --- a/objects/internal/scrollable/scrollbar.lua +++ b/objects/internal/scrollable/scrollbar.lua @@ -387,4 +387,4 @@ function newobject:GetBarType() return self.bartype -end \ No newline at end of file +end diff --git a/objects/internal/scrollable/scrollbody.lua b/objects/internal/scrollable/scrollbody.lua index 0e60d06..6232438 100644 --- a/objects/internal/scrollable/scrollbody.lua +++ b/objects/internal/scrollable/scrollbody.lua @@ -224,4 +224,4 @@ function newobject:GetScrollBar() return self.internals[1].internals[1] -end \ No newline at end of file +end diff --git a/objects/internal/scrollable/scrollbutton.lua b/objects/internal/scrollable/scrollbutton.lua index 92d96b2..3c877cf 100644 --- a/objects/internal/scrollable/scrollbutton.lua +++ b/objects/internal/scrollable/scrollbutton.lua @@ -166,4 +166,4 @@ function newobject:GetScrollType() return self.scrolltype -end \ No newline at end of file +end diff --git a/objects/internal/sliderbutton.lua b/objects/internal/sliderbutton.lua index 6425da5..8ad6163 100644 --- a/objects/internal/sliderbutton.lua +++ b/objects/internal/sliderbutton.lua @@ -255,4 +255,4 @@ function newobject:MoveToY(y) self.staticy = y -end \ No newline at end of file +end diff --git a/objects/internal/tabbutton.lua b/objects/internal/tabbutton.lua index e61e66d..2d7ef15 100644 --- a/objects/internal/tabbutton.lua +++ b/objects/internal/tabbutton.lua @@ -231,4 +231,4 @@ function newobject:GetTabNumber() return self.tabnumber -end \ No newline at end of file +end diff --git a/objects/internal/tooltip.lua b/objects/internal/tooltip.lua index 0732428..da1bd37 100644 --- a/objects/internal/tooltip.lua +++ b/objects/internal/tooltip.lua @@ -394,4 +394,4 @@ function newobject:GetFollowObject() return self.followobject -end \ No newline at end of file +end diff --git a/objects/internal/treenode.lua b/objects/internal/treenode.lua index 7c795e7..e41c839 100644 --- a/objects/internal/treenode.lua +++ b/objects/internal/treenode.lua @@ -303,4 +303,4 @@ function newobject:GetOpen() return self.open -end \ No newline at end of file +end diff --git a/objects/internal/treenodebutton.lua b/objects/internal/treenodebutton.lua index bbd465e..0a629e9 100644 --- a/objects/internal/treenodebutton.lua +++ b/objects/internal/treenodebutton.lua @@ -141,4 +141,4 @@ function newobject:mousepressed(x, y, button) print(self.parent.level) end -end \ No newline at end of file +end diff --git a/objects/list.lua b/objects/list.lua index 9d3ca87..a975f70 100644 --- a/objects/list.lua +++ b/objects/list.lua @@ -812,4 +812,4 @@ function newobject:GetDTScrolling() return self.dtscrolling -end \ No newline at end of file +end diff --git a/objects/menu.lua b/objects/menu.lua index 053ac76..9fcd9b5 100644 --- a/objects/menu.lua +++ b/objects/menu.lua @@ -329,4 +329,4 @@ function newobject:SetVisible(bool) return self -end \ No newline at end of file +end diff --git a/objects/multichoice.lua b/objects/multichoice.lua index bf78ac5..c8ed9df 100644 --- a/objects/multichoice.lua +++ b/objects/multichoice.lua @@ -451,4 +451,4 @@ function newobject:GetEnabled() return self.enabled -end \ No newline at end of file +end diff --git a/objects/numberbox.lua b/objects/numberbox.lua index 317ec87..8afd83d 100644 --- a/objects/numberbox.lua +++ b/objects/numberbox.lua @@ -524,4 +524,4 @@ function newobject:GetDecimals() return self.decimals -end \ No newline at end of file +end diff --git a/objects/panel.lua b/objects/panel.lua index 8487189..c9d14b6 100644 --- a/objects/panel.lua +++ b/objects/panel.lua @@ -173,4 +173,4 @@ function newobject:mousereleased(x, y, button) v:mousereleased(x, y, button) end -end \ No newline at end of file +end diff --git a/objects/progressbar.lua b/objects/progressbar.lua index 2acfc74..1bd98e0 100644 --- a/objects/progressbar.lua +++ b/objects/progressbar.lua @@ -351,4 +351,4 @@ function newobject:GetText() return self.text -end \ No newline at end of file +end diff --git a/objects/slider.lua b/objects/slider.lua index 4db6673..5737a28 100644 --- a/objects/slider.lua +++ b/objects/slider.lua @@ -553,4 +553,4 @@ function newobject:GetEnabled() return self.enabled -end \ No newline at end of file +end diff --git a/objects/tabs.lua b/objects/tabs.lua index d0589db..89b3431 100644 --- a/objects/tabs.lua +++ b/objects/tabs.lua @@ -763,4 +763,4 @@ function newobject:GetAutoButtonAreaWidth() return self.autobuttonareawidth -end \ No newline at end of file +end diff --git a/objects/textinput.lua b/objects/textinput.lua index b0e5ac5..dfb43a3 100644 --- a/objects/textinput.lua +++ b/objects/textinput.lua @@ -66,6 +66,7 @@ function newobject:initialize() self.internal = false self.autoscroll = false self.masked = false + self.trackindicator = true self.OnEnter = nil self.OnTextChanged = nil self.OnFocusGained = nil @@ -930,6 +931,10 @@ function newobject:UpdateIndicator() if alltextselected then self.showindicator = false + else + if love.keyboard.isDown("up", "down", "left", "right") then + self.showindicator = true + end end local width = 0 @@ -953,7 +958,7 @@ function newobject:UpdateIndicator() end -- indicator should be visible, so correcting scrolls - if self.focus then + if self.focus and self.trackindicator then local indicatorRelativeX = width + self.textoffsetx - self.offsetx local leftlimit, rightlimit = 1, self:GetWidth() - 1 if self.linenumberspanel then @@ -2106,4 +2111,29 @@ function newobject:ClearLine(line) return self -end \ No newline at end of file +end + +--[[--------------------------------------------------------- + - func: SetTrackingEnabled(bool) + - desc: sets whether or not the object should + automatically scroll to the position of its + indicator +--]]--------------------------------------------------------- +function newobject:SetTrackingEnabled(bool) + + self.trackindicator = bool + return self + +end + +--[[--------------------------------------------------------- + - func: GetTrackingEnabled() + - desc: gets whether or not the object should + automatically scroll to the position of its + indicator +--]]--------------------------------------------------------- +function newobject:GetTrackingEnabled() + + return self.trackindicator + +end diff --git a/objects/tree.lua b/objects/tree.lua index d145190..7bc32b3 100644 --- a/objects/tree.lua +++ b/objects/tree.lua @@ -345,4 +345,4 @@ function newobject:GetHorizontalScrollBody() return item -end \ No newline at end of file +end diff --git a/skins/Orange/skin.lua b/skins/Orange/skin.lua index 015fb3f..a3ad710 100644 --- a/skins/Orange/skin.lua +++ b/skins/Orange/skin.lua @@ -43,4 +43,4 @@ skin.controls.columnlistrow_body_hover_color = {255, 173, 51, 255} skin.controls.menuoption_body_hover_color = {255, 153, 0, 255} -- register the skin -loveframes.skins.Register(skin) \ No newline at end of file +loveframes.skins.Register(skin) diff --git a/templates/base.lua b/templates/base.lua index abd7ddb..f26190e 100644 --- a/templates/base.lua +++ b/templates/base.lua @@ -1 +1 @@ ---[[------------------------------------------------ -- Love Frames - A GUI library for LOVE -- -- Copyright (c) 2012-2014 Kenny Shields -- --]]------------------------------------------------ --[[------------------------------------------------ -- note: This is the base template for all Love Frames objects. You should not edit or delete this template unless you know what you are doing. --]]------------------------------------------------ -- template table local template = {} -- template name template.name = "Base" -- template properties template.properties = {} template.properties["*"] = { state = "none", x = 0, y = 0, width = 5, height = 5, staticx = 0, staticy = 0, draworder = 0, collide = true, internal = false, visible = true, hover = false, alwaysupdate = false, retainsize = false, calledmousefunc = false, skin = nil, clickbounds = nil, Draw = nil, Update = nil, OnMouseEnter = nil, OnMouseExit = nil } return template \ No newline at end of file +--[[------------------------------------------------ -- Love Frames - A GUI library for LOVE -- -- Copyright (c) 2012-2014 Kenny Shields -- --]]------------------------------------------------ --[[------------------------------------------------ -- note: This is the base template for all Love Frames objects. You should not edit or delete this template unless you know what you are doing. --]]------------------------------------------------ -- template table local template = {} -- template name template.name = "Base" -- template properties template.properties = {} template.properties["*"] = { state = "none", x = 0, y = 0, width = 5, height = 5, staticx = 0, staticy = 0, draworder = 0, collide = true, internal = false, visible = true, hover = false, alwaysupdate = false, retainsize = false, calledmousefunc = false, skin = nil, clickbounds = nil, Draw = nil, Update = nil, OnMouseEnter = nil, OnMouseExit = nil } return template \ No newline at end of file