CapsAdmin

Untitled

Sep 12th, 2011
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.74 KB | None | 0 0
  1. local PANEL = {}
  2.  
  3. PANEL.Base = "draggable"
  4. class.GetSet(PANEL, "Title", "DEAD")
  5.  
  6. function PANEL:SetTitle(str)
  7.     self.title:SetText(str)
  8. end
  9.  
  10. function PANEL:CanDrag(button, press, pos)
  11.     return
  12.         button == "mouse1" and
  13.         self:SkinHook(nil, "FrameCanDrag", pos)
  14. end
  15.  
  16. --
  17.  
  18. function PANEL:Initialize()
  19.     -- close button
  20.     self.close = aahh.Create("button", self)
  21.         self.close.OnPress = function()
  22.             self:SetDraggingAllowed(false)
  23.         end
  24.         self.close.OnRelease = function()
  25.             self:Remove()
  26.         end
  27.  
  28.     -- title
  29.     self.title = aahh.Create("label", self)
  30. end
  31.  
  32. function PANEL:OnDraw()
  33.     self:SkinHook("draw", "FrameDraw")
  34. end
  35.  
  36. function PANEL:OnPerformLayout()
  37.     self:SkinHook("layout", "FrameLayout")
  38. end
  39.  
  40. aahh.RegisterPanel(PANEL, "frame")
Advertisement
Add Comment
Please, Sign In to add comment