Mercurial > wow > reaction
comparison Button.lua @ 277:4e325f1ea6e1
Construct the button name in the base class
| author | Flick |
|---|---|
| date | Wed, 11 May 2011 11:27:36 -0700 |
| parents | 36a29870bf34 |
| children | 5b9c0164a491 |
comparison
equal
deleted
inserted
replaced
| 276:36a29870bf34 | 277:4e325f1ea6e1 |
|---|---|
| 25 btnHeight = 36, | 25 btnHeight = 36, |
| 26 btnRows = 1, | 26 btnRows = 1, |
| 27 btnColumns = 12, | 27 btnColumns = 12, |
| 28 spacing = 3 | 28 spacing = 3 |
| 29 }, | 29 }, |
| 30 barType = L["Button Bar"] | 30 -- barType = L["Button Bar"], -- derived classes must declare |
| 31 -- buttonTypeID = "Button" -- derived classes must declare | |
| 31 } | 32 } |
| 32 | 33 |
| 33 ReAction.Button = Button -- export to ReAction | 34 ReAction.Button = Button -- export to ReAction |
| 34 | 35 |
| 35 function Button:New( name, config, bar, idx, inherits, buttonType ) | 36 function Button:New( config, bar, idx, inherits, buttonType ) |
| 36 buttonType = buttonType or "CheckButton" | 37 buttonType = buttonType or "CheckButton" |
| 38 | |
| 39 local name = format("ReAction_%s_%s_%d",bar:GetName(), self.buttonTypeID, idx) | |
| 37 | 40 |
| 38 -- create new self | 41 -- create new self |
| 39 self = setmetatable( | 42 self = setmetatable( |
| 40 { | 43 { |
| 41 bar = bar, | 44 bar = bar, |
