Mercurial > wow > reaction
comparison Bar.lua @ 50:c3c64e2def50
Assorted cleanup for hide/show grid, action ID labels, draggable resizing, etc
| author | Flick <flickerstreak@gmail.com> |
|---|---|
| date | Tue, 22 Apr 2008 20:37:44 +0000 |
| parents | c54c481ad0ed |
| children | c964fb84560c |
comparison
equal
deleted
inserted
replaced
| 49:dcf8116560a1 | 50:c3c64e2def50 |
|---|---|
| 212 end | 212 end |
| 213 | 213 |
| 214 ClampToButtons = function(bar) | 214 ClampToButtons = function(bar) |
| 215 local bw, bh = GetButtonSize(bar) | 215 local bw, bh = GetButtonSize(bar) |
| 216 local r, c, s = GetButtonGrid(bar) | 216 local r, c, s = GetButtonGrid(bar) |
| 217 SetSize(bar, (bw+s)*c, (bh+s)*r ) | 217 SetSize(bar, (bw+s)*c + 1, (bh+s)*r + 1) |
| 218 end | 218 end |
| 219 | 219 |
| 220 HideGameTooltip = function() | 220 HideGameTooltip = function() |
| 221 GameTooltip:Hide() | 221 GameTooltip:Hide() |
| 222 end | 222 end |
| 483 function Bar:ShowMenu() | 483 function Bar:ShowMenu() |
| 484 if not self.menuOpts then | 484 if not self.menuOpts then |
| 485 self.menuOpts = { | 485 self.menuOpts = { |
| 486 type = "group", | 486 type = "group", |
| 487 args = { | 487 args = { |
| 488 --[[ | |
| 489 openConfig = { | 488 openConfig = { |
| 490 type = "execute", | 489 type = "execute", |
| 491 name = L["Configure..."], | 490 name = L["Layout..."], |
| 492 desc = L["Open the configuration dialogue for this bar"], | 491 desc = L["Open the layout editor for this bar"], |
| 493 func = function() CloseMenu(self.controlFrame); module:OpenConfig(self) end, | 492 func = function() CloseMenu(self.controlFrame); ReAction:CallModuleMethod("ConfigUI","LaunchLayoutEditor",self) end, |
| 494 disabled = InCombatLockdown, | 493 disabled = InCombatLockdown, |
| 495 order = 1 | 494 order = 1 |
| 496 }, | 495 }, |
| 497 --]] | |
| 498 delete = { | 496 delete = { |
| 499 type = "execute", | 497 type = "execute", |
| 500 name = L["Delete Bar"], | 498 name = L["Delete Bar"], |
| 501 desc = L["Remove the bar from the current profile"], | 499 desc = L["Remove the bar from the current profile"], |
| 500 confirm = L["Are you sure you want to remove this bar?"], | |
| 502 func = function() ReAction:EraseBar(self) end, | 501 func = function() ReAction:EraseBar(self) end, |
| 503 order = 2 | 502 order = 2 |
| 504 }, | 503 }, |
| 505 } | 504 } |
| 506 } | 505 } |
| 507 end | 506 end |
| 508 if self.modMenuOpts == nil then | |
| 509 self.modMenuOpts = { } | |
| 510 end | |
| 511 OpenMenu(self.controlFrame, self.menuOpts) | 507 OpenMenu(self.controlFrame, self.menuOpts) |
| 512 end | 508 end |
| 513 | 509 |
| 514 | 510 |
| 515 | 511 |
| 516 ------ Export as a class-factory ------ | 512 ------ Export as a class-factory ------ |
| 517 ReAction.Bar = { | 513 ReAction.Bar = { |
| 518 prototype = Bar, | |
| 519 | |
| 520 IsInstance = function(self, x) | |
| 521 return type(x) == "table" and x._classID == Bar._classID | |
| 522 end, | |
| 523 | |
| 524 new = function(self, ...) | 514 new = function(self, ...) |
| 525 local x = { } | 515 local x = { } |
| 526 for k,v in pairs(Bar) do | 516 for k,v in pairs(Bar) do |
| 527 x[k] = v | 517 x[k] = v |
| 528 end | 518 end |
