diff classes/ReAction.lua @ 21:90bf38d48efd

committing changes to obsolete 0.4 series
author Flick <flickerstreak@gmail.com>
date Fri, 07 Mar 2008 21:54:26 +0000
parents f3a7bfebc283
children
line wrap: on
line diff
--- a/classes/ReAction.lua	Tue May 22 16:39:02 2007 +0000
+++ b/classes/ReAction.lua	Fri Mar 07 21:54:26 2008 +0000
@@ -22,7 +22,10 @@
 -- config = {
 --   type = "ReAction", -- static string (used by ReBar)
 --   subtype = "string", -- ReAction implementation identifier (index into ReAction.buttonTypes)
---   ids = { {paged list}, {paged list}, ... } -- indexed by self.barIdx
+--   buttons = {
+--     id = n, -- global button ID number
+--     actions = { {paged list}, {paged list}, ... } -- indexed by self.barIdx
+--   }
 -- }
 --
 
@@ -168,7 +171,7 @@
   local primary = nil
 
   for i = 1, pages do
-    local hint = config.ids[barIdx] and config.ids[barIdx][i]
+    local hint = config.buttons and config.buttons.actions[barIdx]
     if hint == nil and i > 1 and ids[i-1] then
       hint = ids[i-1] + (buttonsPerPage or 0)
     end
@@ -187,7 +190,7 @@
       primary.button = btnType:new(ids[1])
     end
     if primary.button then
-      config.ids[barIdx] = ids
+      config.buttons.actions[barIdx] = ids
       primary.button:Configure(config,barIdx)
     end
   end
@@ -197,7 +200,7 @@
 
 function ReAction:Release( b )
   if b then
-    for i = 1, #b.config.ids[b.barIdx] do
+    for i = 1, #b.config.buttons.actions[b.barIdx] do
       local id = b:GetID(i)
       if id then
         b.class._idTbl[id].inUse = false
@@ -267,12 +270,12 @@
 
 function ReAction.prototype:SetPages( n )
   n = tonumber(n)
-  local ids = self.config.ids[self.barIdx]
+  local ids = self.config.buttons.actions[self.barIdx]
   if n and n >= 1 then
     -- note that as long as n >= 1 then id[1] will never be modified, which is what we want
     -- because then the button frame ID would be out of sync with the static button name
     while #ids < n do
-      local id = ReAction:GetAvailableID(self.config.subtype, ids[#ids] + #self.config.ids)
+      local id = ReAction:GetAvailableID(self.config.subtype, ids[#ids] + #self.config.buttons.actions)
       if id == nil then
         break
       end
@@ -312,7 +315,7 @@
   self.config   = config
   self.barIdx   = barIdx
 
-  local ids = config.ids[barIdx]
+  local ids = config.buttons.actions[barIdx]
   self:SetID(ids[1]) -- default id
   for i = 1, #ids do
     self:SetID(ids[i], i) -- paged ids