View Single Post
10-09-23, 07:53 AM   #6
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,953
It should be just the case of changing "Button" to "Frame". But I haven't seen this frame personally to see how it works and looks out of the box. Code wise it already handles Minimize and Maximize functionality for the parent frame it is on.

I'll see if I can rig up an addon to see what it is like to make sure this is the case.


Okay, this is a really rough addon that shows how those buttons work with minimal coding.

This is the one and only lua file for a very simple addon. The issue is that where the minmax button is linked to the frame, once you hide it you can never show it again. But, you can resize the frame to suit. Which is what I did here. However, you can't resize to smaller than the minmax button or it will disappear anyway. The X close button in my example works straight out of the box and closes the frame automatically, never to be open again until the game is restarted.

I used a different trick with my portals addon by having a *header* frame that is always displayed and had it control whether the bigger portals frame *content* was displayed or not.

Lua Code:
  1. local displayFrame = CreateFrame("Frame",nil,nil,"BasicFrameTemplate")
  2. displayFrame:SetSize(200,100)
  3. displayFrame:SetPoint("CENTER")
  4.  
  5. local function OnMaximize()
  6.     displayFrame:SetSize(200,100)
  7. end
  8.  
  9. local function OnMinimize()
  10.     displayFrame:SetSize(30,30)
  11. end
  12.  
  13. displayFrame.MinMax = CreateFrame("Frame",nil,displayFrame, "MaximizeMinimizeButtonFrameTemplate")
  14. displayFrame.MinMax:SetPoint("TOPRIGHT",displayFrame,0,30)
  15.  
  16. displayFrame.MinMax:SetOnMaximizedCallback(OnMaximize)
  17. displayFrame.MinMax:SetOnMinimizedCallback(OnMinimize)
  18.  
  19. displayFrame:Show()
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818

Last edited by Xrystal : 10-09-23 at 08:26 AM.
  Reply With Quote