Mercurial > wow > reaction
comparison classes/Button.lua @ 218:e63aefb8a555
Demodularization of buttons
- register class instead of config
author | Flick <flickerstreak@gmail.com> |
---|---|
date | Fri, 19 Nov 2010 23:06:24 -0800 |
parents | 8ba8ab8bf6dd |
children | 158c9299185b |
comparison
equal
deleted
inserted
replaced
217:9c0691e91488 | 218:e63aefb8a555 |
---|---|
20 local function kb_onEnter( frame ) | 20 local function kb_onEnter( frame ) |
21 LKB:Set(frame) | 21 LKB:Set(frame) |
22 end | 22 end |
23 | 23 |
24 -- Button class | 24 -- Button class |
25 local Button = { } | 25 local buttonTypeID = "Button" |
26 local Button = { | |
27 defaultBarConfig = { | |
28 type = buttonTypeID, | |
29 btnWidth = 36, | |
30 btnHeight = 36, | |
31 btnRows = 1, | |
32 btnColumns = 12, | |
33 spacing = 3 | |
34 }, | |
35 barType = L["Button Bar"] | |
36 } | |
26 | 37 |
27 ReAction.Button = Button -- export to ReAction | 38 ReAction.Button = Button -- export to ReAction |
28 | 39 |
29 function Button:New( name, config, bar, idx, inherits, buttonType ) | 40 function Button:New( name, config, bar, idx, inherits, buttonType ) |
30 buttonType = buttonType or "CheckButton" | 41 buttonType = buttonType or "CheckButton" |
101 return self.frame | 112 return self.frame |
102 end | 113 end |
103 | 114 |
104 function Button:GetName() | 115 function Button:GetName() |
105 return self.name | 116 return self.name |
117 end | |
118 | |
119 function Button:GetDefaultBarConfig() | |
120 return self.defaultBarConfig | |
121 end | |
122 | |
123 function Button:GetBarType() | |
124 return self.barType | |
106 end | 125 end |
107 | 126 |
108 function Button:GetConfig() | 127 function Button:GetConfig() |
109 return self.config | 128 return self.config |
110 end | 129 end |