vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | |
2 | AceGUIEditBox = AceGUIElement:new() |
||
3 | |||
4 | function AceGUIEditBox:Enable() |
||
5 | self.disabled = nil |
||
6 | self:SetTextColor(unpack(self.highlightFontColor)) |
||
7 | end |
||
8 | |||
9 | function AceGUIEditBox:Disable() |
||
10 | self.disabled = true |
||
11 | self:SetTextColor(unpack(self.disabledFontColor)) |
||
12 | self:SetText("") |
||
13 | self:ClearFocus() |
||
14 | end |
||
15 | |||
16 | |||
17 | function AceGUIEditBox:OnEnterPressed() |
||
18 | self:ClearFocus() |
||
19 | end |
||
20 | |||
21 | function AceGUIEditBox:OnEscapePressed() |
||
22 | this:ClearFocus() |
||
23 | end |
||
24 | |||
25 | function AceGUIEditBox:OnEditFocusGained() |
||
26 | -- Part of the enable/disable hack. If the edit box is disabled, then disallow |
||
27 | -- focus by immediately clearing it when gained. |
||
28 | if( self.disabled ) then self:ClearFocus() end |
||
29 | if( self._def.highlight ) then self:HighlightText() end |
||
30 | end |
||
31 | |||
32 | function AceGUIEditBox:OnEditFocusLost() |
||
33 | self:HighlightText(0, 0) |
||
34 | end |
||
35 | |||
36 | |||
37 | AceGUIInputBox = AceGUIEditBox:new({labelHorzAdjust=-7, labelVertAdjust=-1}) |
||
38 | |||
39 | function AceGUIInputBox:Setup() |
||
40 | if( not self._def.elements ) then self._def.elements = {} end |
||
41 | local elements = self._def.elements |
||
42 | elements.Label = {type = ACEGUI_FONTSTRING} |
||
43 | end |
||
44 | |||
45 | function AceGUIInputBox:Configure() |
||
46 | self:SetLabel() |
||
47 | end |
||
48 | |||
49 | function AceGUIInputBox:Enable() |
||
50 | AceGUIEditBox.Enable(self) |
||
51 | self.Label:SetTextColor(unpack(self.normalFontColor)) |
||
52 | end |
||
53 | |||
54 | function AceGUIInputBox:Disable() |
||
55 | AceGUIEditBox.Disable(self) |
||
56 | self.Label:SetTextColor(unpack(self.disabledFontColor)) |
||
57 | end |