vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | |
2 | AceGUIScrollFrame = AceGUIElement:new({offset=0}) |
||
3 | |||
4 | function AceGUIScrollFrame:Setup() |
||
5 | if( not self._def.elements ) then self._def.elements = {} end |
||
6 | local elements = self._def.elements |
||
7 | elements.ScrollBar = { |
||
8 | type = ACEGUI_SCROLLBAR, |
||
9 | elements = { |
||
10 | ScrollUpButton = {type = ACEGUI_BUTTON, disabled = TRUE}, |
||
11 | ScrollDownButton = {type = ACEGUI_BUTTON, disabled = TRUE}, |
||
12 | } |
||
13 | } |
||
14 | elements.ScrollChildFrame = {type = ACEGUI_SCROLL_CHILD} |
||
15 | elements.BarTop = {type = ACEGUI_TEXTURE} |
||
16 | elements.BarBottom = {type = ACEGUI_TEXTURE} |
||
17 | elements.BarCenter = {type = ACEGUI_TEXTURE} |
||
18 | end |
||
19 | |||
20 | function AceGUIScrollFrame:ShowBarTexture() |
||
21 | self.BarTop:Show() |
||
22 | self.BarBottom:Show() |
||
23 | self.BarCenter:Show() |
||
24 | end |
||
25 | |||
26 | function AceGUIScrollFrame:HideBarTexture() |
||
27 | self.BarTop:Hide() |
||
28 | self.BarBottom:Hide() |
||
29 | self.BarCenter:Hide() |
||
30 | end |
||
31 | |||
32 | function AceGUIScrollFrame:OnVerticalScroll() |
||
33 | self.ScrollBar:SetValue(arg1) |
||
34 | self.offset = floor((arg1 / (self.rowHeight or self._def.rowHeight)) + 0.5) |
||
35 | GameTooltip:Hide() |
||
36 | end |
||
37 | |||
38 | function AceGUIScrollFrame:OnMouseWheel() |
||
39 | if( arg1 > 0 ) then |
||
40 | self.ScrollBar:SetValue(self.ScrollBar:GetValue() - (self.ScrollBar:GetHeight() / 2)) |
||
41 | else |
||
42 | self.ScrollBar:SetValue(self.ScrollBar:GetValue() + (self.ScrollBar:GetHeight() / 2)) |
||
43 | end |
||
44 | end |
||
45 | |||
46 | function AceGUIScrollFrame:Clear() |
||
47 | self.offset = 0 |
||
48 | self.ScrollBar:SetValue(0) |
||
49 | end |