Mercurial > wow > ouroloot
comparison AceGUIWidget-lib-st.lua @ 47:1070a14cfee4
Updated lib-st widget from WRDW. Properly notice new generating tabs. Updated help text.
| author | Farmbuyer of US-Kilrogg <farmbuyer@gmail.com> |
|---|---|
| date | Sat, 28 Jan 2012 18:24:22 +0000 |
| parents | 822b6ca3ef89 |
| children | fd3dd12f96ce |
comparison
equal
deleted
inserted
replaced
| 46:0b1e703a6954 | 47:1070a14cfee4 |
|---|---|
| 20 | 20 |
| 21 | 21 |
| 22 Version 1 initial functioning implementation | 22 Version 1 initial functioning implementation |
| 23 Version 2 reshuffle to follow new AceGUI widget coding style | 23 Version 2 reshuffle to follow new AceGUI widget coding style |
| 24 Version 3 add .tail_offset, defaulting to same absolute value as .head_offset | 24 Version 3 add .tail_offset, defaulting to same absolute value as .head_offset |
| 25 Version 4 restore original frame methods, as fortold by ancient prophecy | |
| 25 -farmbuyer | 26 -farmbuyer |
| 26 -------------------------------------------------------------------------------]] | 27 -------------------------------------------------------------------------------]] |
| 27 local Type, Version = "lib-st", 3 | 28 local Type, Version = "lib-st", 4 |
| 28 local AceGUI = LibStub and LibStub("AceGUI-3.0", true) | 29 local AceGUI = LibStub and LibStub("AceGUI-3.0", true) |
| 29 if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end | 30 if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end |
| 30 | 31 |
| 31 -- Lua APIs | 32 -- Lua APIs |
| 32 local ipairs, error = ipairs, error | 33 local ipairs, error = ipairs, error |
| 84 end | 85 end |
| 85 self.frame = st.frame -- gutsy, but looks doable | 86 self.frame = st.frame -- gutsy, but looks doable |
| 86 | 87 |
| 87 -- Possibly have already wrapped this ST in a previous widget, careful. | 88 -- Possibly have already wrapped this ST in a previous widget, careful. |
| 88 if st.frame.obj ~= self then | 89 if st.frame.obj ~= self then |
| 90 self.frame.customSetPoint = rawget(self.frame,"SetPoint") | |
| 89 self.frame.realSetPoint = self.frame.SetPoint | 91 self.frame.realSetPoint = self.frame.SetPoint |
| 90 self.frame.SetPoint = ShiftingSetPoint | 92 self.frame.SetPoint = ShiftingSetPoint |
| 91 self.frame.SetAllPoints = ShiftingSetAllPoints | 93 self.frame.SetAllPoints = ShiftingSetAllPoints |
| 92 end | 94 end |
| 93 | 95 |
| 94 -- This needs the .frame field. This also creates .obj inside that | 96 -- This needs the .frame field. This also unconditionally creates .obj |
| 95 -- field and calls a SetScript as well. | 97 -- inside that field and calls a SetScript on it as well. |
| 96 return AceGUI:RegisterAsWidget(self) | 98 return AceGUI:RegisterAsWidget(self) |
| 97 end | 99 end |
| 98 | 100 |
| 99 | 101 |
| 100 --[[----------------------------------------------------------------------------- | 102 --[[----------------------------------------------------------------------------- |
| 148 if self.st then | 150 if self.st then |
| 149 self.st.frame:ClearAllPoints() | 151 self.st.frame:ClearAllPoints() |
| 150 self.st:Hide() | 152 self.st:Hide() |
| 151 end | 153 end |
| 152 self.st = nil | 154 self.st = nil |
| 153 -- XXX should also undo the frame hooks. would most likely be wasted | 155 self.frame.realSetPoint = nil |
| 154 -- cycles. if somebody actually wants to make an ST, include it inside | 156 self.frame.SetAllPoints = nil |
| 155 -- an ace container, then hide the container and continue displaying | 157 self.frame.SetPoint = self.frame.customSetPoint |
| 156 -- the ST by other means, they can file a ticket | 158 self.frame.customSetPoint = nil |
| 157 end, | 159 end, |
| 158 | 160 |
| 159 --[[ | 161 --[[ |
| 160 STs don't use a "normal" SetWidth, if we define "normal" to be the | 162 STs don't use a "normal" SetWidth, if we define "normal" to be the |
| 161 behavior of the blizzard :SetWidth. Column width is passed in during | 163 behavior of the blizzard :SetWidth. Column width is passed in during |
