# HG changeset patch # User Flick # Date 1305245803 25200 # Node ID f2ed8a8e2320cf5f4fd227649214acad34fc6885 # Parent 7a9e82c0df15ede223ea1db419f23bb67f64f604 Add editor sliders for button grid and size diff -r 7a9e82c0df15 -r f2ed8a8e2320 Bar.lua --- a/Bar.lua Wed May 11 17:21:04 2011 -0700 +++ b/Bar.lua Thu May 12 17:16:43 2011 -0700 @@ -371,8 +371,11 @@ end function Bar:SetButtonGrid(r,c,s) + local cfg = self.config + r = r or cfg.btnRows + c = c or cfg.btnColumns + s = s or cfg.spacing if r > 0 and c > 0 and s > 0 then - local cfg = self.config cfg.btnRows = r cfg.btnColumns = c cfg.spacing = s diff -r 7a9e82c0df15 -r f2ed8a8e2320 Editor.lua --- a/Editor.lua Wed May 11 17:21:04 2011 -0700 +++ b/Editor.lua Thu May 12 17:16:43 2011 -0700 @@ -281,11 +281,63 @@ bigStep = 0.05, order = 5, }, + grid = { + type = "group", + name = L["Button Grid"], + inline = true, + order = 6, + args = { + rows = { + type = "range", + name = L["Rows"], + get = function() return select(1,bar:GetButtonGrid()) end, + set = function(info, val) bar:SetButtonGrid(val) end, + width = "double", + min = 1, + max = 32, + step = 1, + order = 2, + }, + cols = { + type = "range", + name = L["Columns"], + get = function() return select(2,bar:GetButtonGrid()) end, + set = function(info, val) bar:SetButtonGrid(nil,val) end, + width = "double", + min = 1, + max = 32, + step = 1, + order = 3, + }, + sz = { + type = "range", + name = L["Size"], + get = function() return select(1,bar:GetButtonSize()) end, + set = function(info, val) bar:SetButtonSize(val,val) end, + width = "double", + min = 10, + max = 72, + step = 1, + order = 4, + }, + spacing = { + type = "range", + name = L["Spacing"], + get = function() return select(3,bar:GetButtonGrid()) end, + set = function(info, val) bar:SetButtonGrid(nil,nil,val) end, + width = "double", + min = 0, + max = 24, + step = 1, + order = 5, + } + } + }, anchor = { type = "group", name = L["Anchor"], inline = true, - order = 6, + order = 7, args = { frame = { type = "input",