Thread Tools Display Modes
08-05-13, 10:18 PM   #41
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,871
Originally Posted by Akatosh View Post
When I click in the panel I want that this panel conserve the white color, now when I leave the clicked panel instantly be class colored, ¿how can I do for When I click the Panel That panel conserve the white text color?.
Works ok but, only for 1 time (1 mouseover), If I mouseover 2 times the text come one more time to original color. ¿You kwon how can I fix that?.
I guess I don't have all the conditions:
Does the frame start out white or class coloured?

When you click you want it to go from the class colour to white.
Then when your mouse leaves the frame you want it to go back to the class colour until the next time it is clicked? Is that right?

BTW, you're not testing on a priest I hope
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
08-06-13, 12:15 AM   #42
Akatosh
A Black Drake
AddOn Compiler - Click to view compilations
Join Date: Jun 2013
Posts: 84
Originally Posted by Fizzlemizz View Post
I guess I don't have all the conditions:
Does the frame start out white or class coloured?

When you click you want it to go from the class colour to white.
Then when your mouse leaves the frame you want it to go back to the class colour until the next time it is clicked? Is that right?

BTW, you're not testing on a priest I hope
Start at red (DK).

When I mouseover turns to white.

When I mouse leave turn to class colored.

When I click turn to white.

But:

If the panel its clicked, the color turns white, and continues white when I mouseover (and mouseleave).

There are 3 panels for the chat (the picture I mouseover the tab General Aka "("PanelGene").



With that codes:

Onclick:
Code:
self.clicked = true

ChatFrame3:Show()
ChatFrame1:Hide()
ChatFrame2:Hide()

self.text:SetTextColor(1, 1, 1)

local tab1 = kgPanels:FetchFrame("PanelGene")
local tab2 = kgPanels:FetchFrame("PanelLog")

local _, Class = UnitClass("player")
local Color = RAID_CLASS_COLORS[Class]
tab1.text:SetTextColor(Color.r,Color.g,Color.b)
tab2.text:SetTextColor(Color.r,Color.g,Color.b)
OnLeave:
Code:
if not self.clicked then

local _, Class = UnitClass("player")
local Color = RAID_CLASS_COLORS[Class]
self.text:SetTextColor(Color.r,Color.g,Color.b)

else
  self.clicked = false
end
OnEnter:
Code:
self.text:SetTextColor(1, 1, 1)
OnLoad:

Code:
local font, size, flags = self.text:GetFont()
self.text:SetFont(font, size, "OUTLINE," .. flags)

local _, Class = UnitClass("player")
local Color = RAID_CLASS_COLORS[Class]
self.text:SetTextColor(Color.r,Color.g,Color.b)
But they work as I described.

I mouseover, OK put the white color.

I mouseleave, OK Red again.

I click, OK turns white.

I mouseleave (when the panel be clicked) and OK, continue white.

But, when I mouseleave one more time the panel turn Red again.

Its extrange.... but the panel do that.

I think something like:

When I push one tab the other in theory hide Aka:

ChatFrame3:Show()
ChatFrame1:Hide()
ChatFrame2:Hide()

Maybe that can be use for do that.

Something like:

If ChatFrame3:Show() or ChatFrame1:Hide() and ChatFrame2:Hide()

Put the text on white (and hold it).

Becouse If I press ChatFrame3, 1 and 2 hide for sure, and 3 show.

Thanks for the support.

PD: I need sleep a bit.... all the night with Lua ZzzzzZzzz

Last edited by Akatosh : 08-06-13 at 12:21 AM.
  Reply With Quote
08-06-13, 01:31 PM   #43
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,871
I mouseover, OK put the white color.

I mouseleave, OK Red again.

I click, OK turns white.

I mouseleave (when the panel be clicked) and OK, continue white.

But, when I mouseleave one more time the panel turn Red again.
OnLeave
Code:
if not self.clicked then
    local _, Class = UnitClass("player")
    local Color = RAID_CLASS_COLORS[Class]
    self.text:SetTextColor(Color.r,Color.g,Color.b)
else
    self.clicked = false
end
Because you "self.clicked = false" on the first OnLeave the condition "if not self.clicked then" becomes active on the second OnLeave. You need to find some mechanism (maybe a second click) to reset "self.clicked", in which case,

OnClick becomes:
Code:
if not self.clicked then
	self.clicked = true
	
	ChatFrame3:Show()
	ChatFrame1:Hide()
	ChatFrame2:Hide()
	
	self.text:SetTextColor(1, 1, 1)
	
	local tab1 = kgPanels:FetchFrame("PanelGene")
	local tab2 = kgPanels:FetchFrame("PanelLog")
	
	local _, Class = UnitClass("player")
	local Color = RAID_CLASS_COLORS[Class]
	tab1.text:SetTextColor(Color.r,Color.g,Color.b)
	tab2.text:SetTextColor(Color.r,Color.g,Color.b)
else
	self.clicked = false
ens
And OnLeave becomes:
Code:
if not self.clicked then
	local _, Class = UnitClass("player")
	local Color = RAID_CLASS_COLORS[Class]
	self.text:SetTextColor(Color.r,Color.g,Color.b)
end
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
08-06-13, 09:17 PM   #44
Akatosh
A Black Drake
AddOn Compiler - Click to view compilations
Join Date: Jun 2013
Posts: 84
Hi again, Thanks for the help but now the panels do completely different,

I explain.

OnEnter 1st time, first time OK they turn to white.

Click, dont work as intended, the panels dont hold the text white color.

Onleave, the panels turn the text to class colored again, they dont hold the white color.

I put all the codes of the 3 panels for give you all info as I can, I hope that help you.

I do not understand where I'm failing.

Thanks!!

---------

Panel "PanelGene" (1)

OnLoad

Code:
local font,size = self.text:GetFont()
self.text:SetFont(font,size,"OUTLINE")
self.text:SetJustifyH("CENTER")
self.text:SetJustifyV("CENTER")

local _, class = UnitClass("player")
local color = (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[class]
self.text:SetTextColor(color.r, color.g, color.b)
OnEnter

Code:
self.text:SetTextColor(1, 1, 1)
OnLeave

Code:
if not self.clicked then
    local _, Class = UnitClass("player")
    local Color = RAID_CLASS_COLORS[Class]
    self.text:SetTextColor(Color.r,Color.g,Color.b)
end
OnClick

Code:
if not self.clicked then
    self.clicked = true
    
    ChatFrame1:Show()
    ChatFrame2:Hide()
    ChatFrame3:Hide()
    
    self.text:SetTextColor(1, 1, 1)
    
    local tab2 = kgPanels:FetchFrame("PanelLog")
    local tab3 = kgPanels:FetchFrame("PanelTrash")
    
    local _, Class = UnitClass("player")
    local Color = RAID_CLASS_COLORS[Class]
    tab2.text:SetTextColor(Color.r,Color.g,Color.b)
    tab3.text:SetTextColor(Color.r,Color.g,Color.b)
else
    self.clicked = false
end
-----------

Panel PanelLog (2)


OnLoad

Code:
local font,size = self.text:GetFont()
self.text:SetFont(font,size,"OUTLINE")
self.text:SetJustifyH("CENTER")
self.text:SetJustifyV("CENTER")

local _, class = UnitClass("player")
local color = (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[class]
self.text:SetTextColor(color.r, color.g, color.b)
OnEnter

Code:
self.text:SetTextColor(1, 1, 1)
OnLeave

Code:
if not self.clicked then
    local _, Class = UnitClass("player")
    local Color = RAID_CLASS_COLORS[Class]
    self.text:SetTextColor(Color.r,Color.g,Color.b)
end
OnClick

Code:
if not self.clicked then
    self.clicked = true
    
    ChatFrame2:Show()
    ChatFrame3:Hide()
    ChatFrame1:Hide()
    
    self.text:SetTextColor(1, 1, 1)
    
    local tab1 = kgPanels:FetchFrame("PanelGene")
    local tab3 = kgPanels:FetchFrame("PanelTrash")
    
    local _, Class = UnitClass("player")
    local Color = RAID_CLASS_COLORS[Class]
    tab1.text:SetTextColor(Color.r,Color.g,Color.b)
    tab3.text:SetTextColor(Color.r,Color.g,Color.b)
else
    self.clicked = false
end
-----------

Panel "PanelTrash" (3)

OnLoad

Code:
local font,size = self.text:GetFont()
self.text:SetFont(font,size,"OUTLINE")
self.text:SetJustifyH("CENTER")
self.text:SetJustifyV("CENTER")

local _, class = UnitClass("player")
local color = (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[class]
self.text:SetTextColor(color.r, color.g, color.b)
OnEnter

Code:
self.text:SetTextColor(1, 1, 1)
OnLeave

Code:
if not self.clicked then
    local _, Class = UnitClass("player")
    local Color = RAID_CLASS_COLORS[Class]
    self.text:SetTextColor(Color.r,Color.g,Color.b)
end
Onclick

Code:
if not self.clicked then
    self.clicked = true
    
    ChatFrame3:Show()
    ChatFrame1:Hide()
    ChatFrame2:Hide()
    
    self.text:SetTextColor(1, 1, 1)
    
    local tab1 = kgPanels:FetchFrame("PanelGene")
    local tab2 = kgPanels:FetchFrame("PanelLog")
    
    local _, Class = UnitClass("player")
    local Color = RAID_CLASS_COLORS[Class]
    tab1.text:SetTextColor(Color.r,Color.g,Color.b)
    tab2.text:SetTextColor(Color.r,Color.g,Color.b)
else
    self.clicked = false
end
Thanks.
  Reply With Quote
08-06-13, 10:07 PM   #45
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,871
OnClick
Code:
if not self.clicked then
    self.clicked = true
    
    ChatFrame1:Show()
    ChatFrame2:Hide()
    ChatFrame3:Hide()
    
    self.text:SetTextColor(1, 1, 1)
    
    local tab2 = kgPanels:FetchFrame("PanelLog")
    local tab3 = kgPanels:FetchFrame("PanelTrash")
    
    local _, Class = UnitClass("player")
    local Color = RAID_CLASS_COLORS[Class]
    tab2.text:SetTextColor(Color.r,Color.g,Color.b)
    tab3.text:SetTextColor(Color.r,Color.g,Color.b)
else
    self.clicked = false
end
When you are clicking you are re-setting the colours for the other two panels but you also need to re-set their "clicked" status.

So I think OnClick
Code:
if not self.clicked then
    self.clicked = true
    
    ChatFrame1:Show()
    ChatFrame2:Hide()
    ChatFrame3:Hide()
    
    self.text:SetTextColor(1, 1, 1)
    
    local tab2 = kgPanels:FetchFrame("PanelLog")
    local tab3 = kgPanels:FetchFrame("PanelTrash")
    
    local _, Class = UnitClass("player")
    local Color = RAID_CLASS_COLORS[Class]
    tab2.text:SetTextColor(Color.r,Color.g,Color.b)
    tab2.clicked = false
    tab3.text:SetTextColor(Color.r,Color.g,Color.b)
    tab3.clicked = false
else
    self.clicked = false
end
While it shouldn't be needed you could also:
OnLeave
Code:
if not self.clicked then
    local _, Class = UnitClass("player")
    local Color = RAID_CLASS_COLORS[Class]
    self.text:SetTextColor(Color.r,Color.g,Color.b)
else
    self.text:SetTextColor(1,1,1)
end
You might want to define things differently as here, once "unclicked" the button doesn't change from white to class colour until OnLeave.

The code here allows all buttons to be "unclicked" at the same time. If you want one button to always be "hot" you can remove the

else
self.clicked = false
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 08-06-13 at 10:19 PM.
  Reply With Quote
08-06-13, 10:10 PM   #46
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
You need to add this to the very beginning of all your OnClick scripts:

Code:
if pressed then
    return
end
What kgPanels labels "OnClick" actually gets run for both OnMouseDown and OnMouseUp, with a special variable passed to tell your script which event it's running for. If you want it to work like a real OnClick script, you need to ignore the OnMouseDown event, and only respond to the OnMouseUp event, by checking the "pressed" variable. Otherwise, your "OnClick" script gets run twice every time you click -- once when you press the mouse button, and again when you release it.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
08-06-13, 10:35 PM   #47
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,871
Wow, that would mess things up. Good insight Phanx.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
08-06-13, 11:25 PM   #48
Akatosh
A Black Drake
AddOn Compiler - Click to view compilations
Join Date: Jun 2013
Posts: 84
I hate maintenances

Thanks for the assistance.

As I undertand finaly for example the code may be (for example):

OnLoad:

Code:
local font,size = self.text:GetFont()
self.text:SetFont(font,size,"OUTLINE")
self.text:SetJustifyH("CENTER")
self.text:SetJustifyV("CENTER")

local _, class = UnitClass("player")
local color = (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[class]
self.text:SetTextColor(color.r, color.g, color.b)

OnClick:

Code:
if pressed then
    return
end

if not self.clicked then
    self.clicked = true
    
    ChatFrame1:Show()
    ChatFrame2:Hide()
    ChatFrame3:Hide()
    
    self.text:SetTextColor(1, 1, 1)
    
    local tab2 = kgPanels:FetchFrame("PanelLog")
    local tab3 = kgPanels:FetchFrame("PanelTrash")
    
    local _, Class = UnitClass("player")
    local Color = RAID_CLASS_COLORS[Class]
    tab2.text:SetTextColor(Color.r,Color.g,Color.b)
    tab2.clicked = false
    tab3.text:SetTextColor(Color.r,Color.g,Color.b)
    tab3.clicked = false
else
    self.clicked = false
end
OnEnter

Code:
self.text:SetTextColor(1, 1, 1)
OnLeave

Code:
if not self.clicked then
    local _, Class = UnitClass("player")
    local Color = RAID_CLASS_COLORS[Class]
    self.text:SetTextColor(Color.r,Color.g,Color.b)
else
    self.text:SetTextColor(1,1,1)
end
Is that right?

Thanks!!
  Reply With Quote
08-06-13, 11:34 PM   #49
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,871
So that the colour changes to default immediately when a button is "unclicked" (self.clicked = false) you might want to make OnClick
Code:
if pressed then
    return
end

local _, Class = UnitClass("player")
local Color = RAID_CLASS_COLORS[Class]
if not self.clicked then
    self.clicked = true
    
    ChatFrame1:Show()
    ChatFrame2:Hide()
    ChatFrame3:Hide()
    
    self.text:SetTextColor(1, 1, 1)
    
    local tab2 = kgPanels:FetchFrame("PanelLog")
    local tab3 = kgPanels:FetchFrame("PanelTrash")
    
    tab2.text:SetTextColor(Color.r,Color.g,Color.b)
    tab2.clicked = false
    tab3.text:SetTextColor(Color.r,Color.g,Color.b)
    tab3.clicked = false
end
Also I'm unsure what you want to do about ChatFrame Hide/Show when buttons are "unclicked".

With the code presented here it is possiible to have one button "clicked" and two buttons "unclicked" or none of the buttons "clicked":

General Log Trash
or
General Log Trash
or
General Log Trash
or
General Log Trash
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 08-07-13 at 12:47 AM.
  Reply With Quote
08-07-13, 12:09 AM   #50
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
I know I've written scripts for someone before to manage a collection of related panels like this (eg. when clicking on one, turn it white, turn all the others gray) but I don't remember when or where, or even whether it was on these forums or on Wowace. Maybe you can find it with some creative use of the advanced search.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
08-07-13, 12:33 AM   #51
Akatosh
A Black Drake
AddOn Compiler - Click to view compilations
Join Date: Jun 2013
Posts: 84
Originally Posted by Fizzlemizz View Post
So that the colour changes to default immediately when a button is "unclicked" (self.clicked = false) you might want to make OnClick
Code:
if pressed then
    return
end

local _, Class = UnitClass("player")
local Color = RAID_CLASS_COLORS[Class]
if not self.clicked then
    self.clicked = true
    
    ChatFrame1:Show()
    ChatFrame2:Hide()
    ChatFrame3:Hide()
    
    self.text:SetTextColor(1, 1, 1)
    
    local tab2 = kgPanels:FetchFrame("PanelLog")
    local tab3 = kgPanels:FetchFrame("PanelTrash")
    
    tab2.text:SetTextColor(Color.r,Color.g,Color.b)
    tab2.clicked = false
    tab3.text:SetTextColor(Color.r,Color.g,Color.b)
    tab3.clicked = false
else
    self.clicked = false
    self:SetTextColor(Color.r,Color.g,Color.b)
end
Also I'm unsure what you want to do about ChatFrame Hide/Show when buttons are "unclicked".

With the code presented here it is possiible to have one button "clicked" and two buttons "unclicked" or none of the buttons "clicked":

General Log Trash
or
General Log Trash
or
General Log Trash
or
General Log Trash
I Explain.

At inicial the text is class colored.

General Log Trash


1 -When I OnEnter, the text comes white. (for expample I put the cursor over the panel general)

1 -General Log Trash

2 -When I OnLeave, the text comes class colored. (for example I leave the panel general and I put the cursor in another place of the screen out of the panels of tabs).

2 -General Log Trash

3 -But If I click the panel, the text hold the white color, and dont change at mouseleave. (for example I clicked the general panel, and I leave the cursor in another place of the screen out of the panel of tabs).

3 -General Log Trash

If I OnEnter on "Log" or "Trash" panel, (when "general" is clicked), but dont click they, OnEnter and Onleave work as the 2 first points), for example general is clicked and at this moment I mouseover the panel "Log".

3 -General LogTrash

3 -General Log Trash (And now I mouseleave).

4 -When I click another panel the Last clicked panel take class colored color again.

4 -General Log Trash (Inicial state).

4 -General Log Trash (Inicial state) (Mouseover over "Log").

4 -General Log Trash (log at this moment its clicked).


I want exactly the some efects like the standart tabs of the basic chat of wow.

I dont know how can I explain It better, in general term I want a panels of 3 buttons with identical efects of basic wow chat.

Thanks!!.

PD: I hate sleep (is a loss of time, how many things I can do In 5 or 6 ours...), but I need it again... and one more time a long lua text night, can be a perfect tittle for a film to sleep.

I try to find that post Phanx, thanks, but in a little while, now I have to rest.

Last edited by Akatosh : 08-07-13 at 12:44 AM.
  Reply With Quote
08-07-13, 01:02 AM   #52
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,871
OnLoad -- Everything class coloured
Code:
local font,size = self.text:GetFont()
self.text:SetFont(font,size,"OUTLINE")
self.text:SetJustifyH("CENTER")
self.text:SetJustifyV("CENTER")

local _, class = UnitClass("player")
local color = (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[class]
self.text:SetTextColor(color.r, color.g, color.b)end
OnClick -- Set self to white, set other tabs class coloured, show/hide chat frames:
Code:
if pressed then
    return
end

local _, Class = UnitClass("player")
local Color = RAID_CLASS_COLORS[Class]
if not self.clicked then
    self.clicked = true
    self.text:SetTextColor(1, 1, 1)
    
--Change per tab/button
    ChatFrame1:Show()
    ChatFrame2:Hide()
    ChatFrame3:Hide()
    local tab2 = kgPanels:FetchFrame("PanelLog")
    local tab3 = kgPanels:FetchFrame("PanelTrash")
    tab2.text:SetTextColor(Color.r,Color.g,Color.b)
    tab2.clicked = false
    tab3.text:SetTextColor(Color.r,Color.g,Color.b)
    tab3.clicked = false
end
OnEnter -- set white no matter what
Code:
self.text:SetTextColor(1, 1, 1)
OnLeave -- if clicked set to white else class coloured (changed for clarity)
Code:
if self.clicked then
    self.text:SetTextColor(1,1,1)
else -- condition set in OnClick of other tabs
    local _, Class = UnitClass("player")
    local Color = RAID_CLASS_COLORS[Class]
    self.text:SetTextColor(Color.r,Color.g,Color.b)
end
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 08-07-13 at 01:50 AM.
  Reply With Quote
08-07-13, 04:05 AM   #53
suicidalkatt
A Rage Talon Dragon Guard
 
suicidalkatt's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 331
Why do all this work when you can just check to see if a ChatFrame is showing?

Use the OnUpdate field and do a

Lua Code:
  1. if ChatFrame1:IsShown() then
  2. -- color method here
  3. else
  4. -- not shown method here
  5. end

Not too difficult to add additional checks to see if its being entered by the mouse to disable the updating color.

Edit: Here's my version and a rather simplified attempt to make things more straightforward and more 'universal' on all the buttons minus a simple string change.

OnLoad:
Lua Code:
  1. local font,size = self.text:GetFont()
  2. self.text:SetFont(font,size,"OUTLINE")
  3. self.text:SetJustifyH("CENTER")
  4. self.text:SetJustifyV("CENTER")
  5.  
  6. self.color = (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[select(2,UnitClass("player"))]
  7. self.frame = "ChatFrame1"

OnEnter:
Lua Code:
  1. self.entered = true

OnLeave:
Lua Code:
  1. self.entered = false

OnClick:
Lua Code:
  1. FCF_Tab_OnClick(_G[self.frame.."Tab"],button) -- This uses a method provided by blizzard to toggle the chat frames, this may also reshow the default chat tabs, although it's a nice shortcut for the button onclick.

OnUpdate:
Lua Code:
  1. if _G[self.frame]:IsShown() or self.entered then
  2.     self.text:SetTextColor(1,1,1)
  3. else
  4.     self.text:SetTextColor(self.color.r,self.color.g,self.color.b)
  5. end

Another nifty side effect to this is that it should also update the class color should you change it with CUSTOM_CLASS_COLORS.

Layout Export:
Code:
^1^T^SGeneral^T^Sborder_advanced^T^Senable^b^Sshow^T^SBOT^B^STOPRIGHTCORNER^B^SLEFT^B^STOPLEFTCORNER^B^SRIGHT^B^SBOTLEFTCORNER^B^STOP^B^SBOTRIGHTCORNER^B^t^t^Sparent^SUIParent^Ssub_level^N0^SanchorFrom^SCENTER^Shflip^b^Svflip^b^StileSize^N0^Sbg_texture^SSolid^Sanchor^SUIParent^Slevel^N0^Suse_absolute_bg^b^Sbg_blend^SBLEND^Stext^T^Sy^N0^Sfont^SBlizzard^SjustifyH^SCENTER^Sx^N0^Scolor^T^Sa^N1^Sr^N1^Sg^N1^Sb^N1^t^Stext^SGeneral^SjustifyV^SMIDDLE^Ssize^N12^t^Sy^S0^Sx^S-100^Sbg_alpha^N1^Sborder_edgeSize^N16^Sheight^S25^Stiling^b^Sstrata^SBACKGROUND^SanchorTo^SCENTER^Sabsolute_bg^T^SLLy^N1^SLLx^N0^SLRy^N1^SLRx^N1^SURx^N1^SURy^N0^SULy^N0^SULx^N0^t^Sbg_insets^T^Sb^N4^St^N-4^Sl^N4^Sr^N-4^t^Sscripts^T^SENTER^Sself.entered~`=~`true^SLOAD^Slocal~`font,size~`=~`self.text:GetFont()~Jself.text:SetFont(font,size,"OUTLINE")~Jself.text:SetJustifyH("CENTER")~Jself.text:SetJustifyV("CENTER")~J~`~Jself.color~`=~`(CUSTOM_CLASS_COLORS~`or~`RAID_CLASS_COLORS)[select(2,UnitClass("player"))]~Jself.frame~`=~`"ChatFrame1"^SCLICK^SFCF_Tab_OnClick(_G[self.frame.."Tab"],button)^SUPDATE^Sif~`_G[self.frame]:IsShown()~`or~`self.entered~`then~Jself.text:SetTextColor(1,1,1)~Jelse~Jself.text:SetTextColor(self.color.r,self.color.g,self.color.b)~Jend^SLEAVE^Sself.entered~`=~`false^t^Sbg_style^SSOLID^Sgradient_color^T^Sa^N1^Sr^N1^Sg^N1^Sb^N1^t^Sborder_color^T^Sa^N1^Sr^N1^Sg^N1^Sb^N1^t^Sborder_texture^SBlizzard~`Tooltip^Swidth^S100^Sbg_orientation^SHORIZONTAL^Srotation^N0^Smouse^B^Sbg_color^T^Sa^N0.6^Sr^N0.3^Sg^N0.3^Sb^N0.3^t^Scrop^b^t^SCombat^T^Sborder_advanced^T^Senable^b^Sshow^T^SBOTRIGHTCORNER^B^STOPRIGHTCORNER^B^STOPLEFTCORNER^B^SBOTLEFTCORNER^B^SRIGHT^B^SLEFT^B^STOP^B^SBOT^B^t^t^Sparent^SUIParent^Ssub_level^N0^SanchorFrom^SCENTER^Shflip^b^Svflip^b^StileSize^N0^Sbg_texture^SSolid^Sanchor^SUIParent^Slevel^N0^Suse_absolute_bg^b^Sbg_blend^SBLEND^Stext^T^Sy^N0^Sx^N0^SjustifyH^SCENTER^Sfont^SBlizzard^Scolor^T^Sa^N1^Sb^N1^Sg^N1^Sr^N1^t^Stext^SCombat^SjustifyV^SMIDDLE^Ssize^N12^t^Sy^S0^Sx^S0^Sbg_alpha^N1^Sborder_edgeSize^N16^Sheight^S25^Stiling^b^Sstrata^SBACKGROUND^SanchorTo^SCENTER^Sabsolute_bg^T^SLRy^N1^SLRx^N1^SULx^N0^SULy^N0^SURy^N0^SURx^N1^SLLx^N0^SLLy^N1^t^Scrop^b^Sscripts^T^SENTER^Sself.entered~`=~`true^SLOAD^Slocal~`font,size~`=~`self.text:GetFont()~Jself.text:SetFont(font,size,"OUTLINE")~Jself.text:SetJustifyH("CENTER")~Jself.text:SetJustifyV("CENTER")~J~`~Jself.color~`=~`(CUSTOM_CLASS_COLORS~`or~`RAID_CLASS_COLORS)[select(2,UnitClass("player"))]~Jself.frame~`=~`"ChatFrame2"^SCLICK^SFCF_Tab_OnClick(_G[self.frame.."Tab"],button)^SUPDATE^Sif~`_G[self.frame]:IsShown()~`or~`self.entered~`then~Jself.text:SetTextColor(1,1,1)~Jelse~Jself.text:SetTextColor(self.color.r,self.color.g,self.color.b)~Jend^SLEAVE^Sself.entered~`=~`false^t^Sbg_style^SSOLID^Sgradient_color^T^Sa^N1^Sb^N1^Sg^N1^Sr^N1^t^Sborder_color^T^Sa^N1^Sb^N1^Sg^N1^Sr^N1^t^Sborder_texture^SBlizzard~`Tooltip^Swidth^S100^Sbg_insets^T^Sr^N-4^St^N-4^Sl^N4^Sb^N4^t^Sbg_color^T^Sa^N0.6^Sb^N0.3^Sg^N0.3^Sr^N0.3^t^Smouse^B^Srotation^N0^Sbg_orientation^SHORIZONTAL^t^SLoot^T^Sborder_advanced^T^Senable^b^Sshow^T^SBOT^B^STOPRIGHTCORNER^B^SLEFT^B^SBOTLEFTCORNER^B^SRIGHT^B^STOPLEFTCORNER^B^STOP^B^SBOTRIGHTCORNER^B^t^t^Sparent^SUIParent^Sbg_orientation^SHORIZONTAL^SanchorFrom^SCENTER^Shflip^b^Svflip^b^StileSize^N0^Sbg_texture^SSolid^Sanchor^SUIParent^Slevel^N0^Suse_absolute_bg^b^Sbg_blend^SBLEND^Stext^T^Sy^N0^Sx^N0^SjustifyH^SCENTER^Sfont^SBlizzard^Scolor^T^Sa^N1^Sr^N1^Sg^N1^Sb^N1^t^Stext^SLoot^SjustifyV^SMIDDLE^Ssize^N12^t^Sy^S0^Sx^S100^Sbg_alpha^N1^Sborder_edgeSize^N16^Sheight^S25^Stiling^b^Sstrata^SBACKGROUND^SanchorTo^SCENTER^Sabsolute_bg^T^SULx^N0^SULy^N0^SLLy^N1^SLLx^N0^SURx^N1^SURy^N0^SLRx^N1^SLRy^N1^t^Sbg_insets^T^Sb^N4^St^N-4^Sl^N4^Sr^N-4^t^Sscripts^T^SENTER^Sself.entered~`=~`true^SLOAD^Slocal~`font,size~`=~`self.text:GetFont()~Jself.text:SetFont(font,size,"OUTLINE")~Jself.text:SetJustifyH("CENTER")~Jself.text:SetJustifyV("CENTER")~J~`~Jself.color~`=~`(CUSTOM_CLASS_COLORS~`or~`RAID_CLASS_COLORS)[select(2,UnitClass("player"))]~Jself.frame~`=~`"ChatFrame4"^SCLICK^SFCF_Tab_OnClick(_G[self.frame.."Tab"],button)^SUPDATE^Sif~`_G[self.frame]:IsShown()~`or~`self.entered~`then~Jself.text:SetTextColor(1,1,1)~Jelse~Jself.text:SetTextColor(self.color.r,self.color.g,self.color.b)~Jend^SLEAVE^Sself.entered~`=~`false^t^Sbg_style^SSOLID^Sgradient_color^T^Sa^N1^Sr^N1^Sg^N1^Sb^N1^t^Sborder_color^T^Sa^N1^Sr^N1^Sg^N1^Sb^N1^t^Sborder_texture^SBlizzard~`Tooltip^Swidth^S100^Ssub_level^N0^Srotation^N0^Smouse^b^Sbg_color^T^Sa^N0.6^Sr^N0.3^Sg^N0.3^Sb^N0.3^t^Scrop^b^t^t^^ayer"))])~Jself.frame~`=~`"ChatFrame1"^SCLICK^SFCF_Tab_OnClick(_G[self.frame.."Tab"],button)^SUPDATE^Sif~`_G[self.frame]:IsShown()~`or~`self.entered~`then~Jself.text:SetTextColor(1,1,1)~Jelse~Jself.text:SetTextColor(self.color.r,self.color.g,self.color.b)~Jend^SLEAVE^Sself.entered~`=~`false^t^Sbg_style^SSOLID^Sgradient_color^T^Sa^N1^Sb^N1^Sg^N1^Sr^N1^t^Sborder_color^T^Sa^N1^Sb^N1^Sg^N1^Sr^N1^t^Sborder_texture^SBlizzard~`Tooltip^Swidth^S100^Sbg_insets^T^Sr^N-4^St^N-4^Sl^N4^Sb^N4^t^Sbg_color^T^Sa^N0.6^Sb^N0.3^Sg^N0.3^Sr^N0.3^t^Smouse^B^Srotation^N0^Sbg_orientation^SHORIZONTAL^t^t^^

Last edited by suicidalkatt : 08-07-13 at 05:26 AM.
  Reply With Quote
08-07-13, 10:01 AM   #54
Akatosh
A Black Drake
AddOn Compiler - Click to view compilations
Join Date: Jun 2013
Posts: 84
Hi all.

1st: Fizzlemizz, Phanx thanks for all the support that give me, the code that leave me Fizz the part of "Onleave dont work as intended, when I Onleave (and the panel is clicked, the loss the white color and be class colored again.)

2nd: suicidalkatt, Works perfetly, exactly as I need, I cant imagine how, with that few lines, all work as I need, really I'm in shock.
  Reply With Quote
08-07-13, 10:17 AM   #55
suicidalkatt
A Rage Talon Dragon Guard
 
suicidalkatt's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 331
Originally Posted by Akatosh View Post
Hi all.

suicidalkatt, Works perfetly, exactly as I need, I cant imagine how, with that few lines, all work as I need, really I'm in shock.
FCF_Tab_OnClick is exactly the same function that's run when you click on the default chat frame tabs, so it make sense to simple reuse that function for the OnClick.

Glad it's working how you'd like
  Reply With Quote
08-07-13, 12:01 PM   #56
ravagernl
Proceritate Corporis
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 1,176
Also, there is no need to have OnEnter/OnLeave handlers for the frame, you can use self:IsMousOver()
  Reply With Quote
08-07-13, 12:19 PM   #57
Akatosh
A Black Drake
AddOn Compiler - Click to view compilations
Join Date: Jun 2013
Posts: 84
Originally Posted by ravagernl View Post
Also, there is no need to have OnEnter/OnLeave handlers for the frame, you can use self:IsMousOver()
At this point the panels work perfectly with the code of suicidalkatt, thanks for the tip ravagernl.

One more question.

¿Can be posible OnClick, remove the top border of the panel?.

For example



I click the panel General, and the top border remove, taking the apareance of "mix", can be posible do that?¿

.........

I find a posible way using the alpha color of the borders, I explain.

I put 2 panels Just one over the other.

The principal panel have the 4 borders.

And the panel of back have 3 borders (all, without top).

When I click the principal panel, alpha border of the principal panel get alfa 0, and they show the back panel with the 3 borders.

I try that this night leave me a time and I post the results.

......

At this moment it works on a test panels that I just created for test that way to do it, now I try to apply to the panels of chat tabs.

Thanks.

Last edited by Akatosh : 08-07-13 at 03:09 PM.
  Reply With Quote
08-07-13, 03:07 PM   #58
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Akatosh View Post
¿Can be posible OnClick, remove the top border of the panel?.
If the border is actually a border, then no. You would need to remove the actual border from your panel, and create additional textures attached to each edge to look like a border -- then you could hide just one side of it.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
08-07-13, 03:08 PM   #59
suicidalkatt
A Rage Talon Dragon Guard
 
suicidalkatt's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 331
Originally Posted by Akatosh View Post


The principal panel have the 4 borders.

And the panel of back have 3 borders (all, without top).

When I click the principal panel, alpha border of the principal panel get alfa 0, and they show the back panel with the 3 borders.

I try that this night leave me a time and I post the results.

Thanks.
That's not doable due to the way that the border is created here. The border here is a being placed with the :SetBackdrop property.

You'd have to set all the texture for the button and it'd take a bit more effort.
  Reply With Quote
08-07-13, 05:39 PM   #60
Akatosh
A Black Drake
AddOn Compiler - Click to view compilations
Join Date: Jun 2013
Posts: 84
Results:

Pictures:

General



Log



Trash




All Codes:

General:

OnLoad

Code:
local font,size = self.text:GetFont()
    self.text:SetFont(font,size,"OUTLINE")
    self.text:SetJustifyH("CENTER")
    self.text:SetJustifyV("CENTER")
     
    self.color = (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[select(2,UnitClass("player"))]
    self.frame = "ChatFrame1"

self:SetBackdropBorderColor(0, 0 , 0, 0)
self.bg:SetGradientAlpha("VERTICAL", 0, 0, 0, 1,0.18, 0.18, 0.18, 1)
OnUpdate:

Code:
if _G[self.frame]:IsShown() or self.entered then
        self.text:SetTextColor(1,1,1)
    else
        self.text:SetTextColor(self.color.r,self.color.g,self.color.b)
    end
OnEnter

Code:
self.entered = true
OnLeave

Code:
self.entered = false
OnClick

Code:
FCF_Tab_OnClick(_G[self.frame.."Tab"],button)

local tab2 = kgPanels:FetchFrame("Log")  
local tab3 = kgPanels:FetchFrame("Trash") 

self:SetBackdropBorderColor(0, 0 , 0, 0)
tab2:SetBackdropBorderColor(0, 0 , 0, 1)
tab3:SetBackdropBorderColor(0, 0 , 0, 1)
-------------

Log:

OnLoad

Code:
local font,size = self.text:GetFont()
    self.text:SetFont(font,size,"OUTLINE")
    self.text:SetJustifyH("CENTER")
    self.text:SetJustifyV("CENTER")
     
    self.color = (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[select(2,UnitClass("player"))]
    self.frame = "ChatFrame2"
OnUpdate

Code:
    if _G[self.frame]:IsShown() or self.entered then
        self.text:SetTextColor(1,1,1)
    else
        self.text:SetTextColor(self.color.r,self.color.g,self.color.b)
    end
OnEnter

Code:
self.entered = true
OnLeave

Code:
self.entered = false
OnClick

Code:
FCF_Tab_OnClick(_G[self.frame.."Tab"],button)

local tab1 = kgPanels:FetchFrame("General")  
local tab3 = kgPanels:FetchFrame("Trash") 

self:SetBackdropBorderColor(0, 0 , 0, 0)
tab1:SetBackdropBorderColor(0, 0 , 0, 1)
tab3:SetBackdropBorderColor(0, 0 , 0, 1)
self.bg:SetGradientAlpha("VERTICAL", 0, 0, 0, 1,0.18, 0.18, 0.18, 1)
tab1.bg:SetVertexColor(0.18, 0.18, 0.18)
tab3.bg:SetVertexColor(0.18, 0.18, 0.18)
---------------

Trash:

OnLoad

Code:
    local font,size = self.text:GetFont()
    self.text:SetFont(font,size,"OUTLINE")
    self.text:SetJustifyH("CENTER")
    self.text:SetJustifyV("CENTER")
     
    self.color = (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[select(2,UnitClass("player"))]
    self.frame = "ChatFrame3"
OnUpdate

Code:
    if _G[self.frame]:IsShown() or self.entered then
        self.text:SetTextColor(1,1,1)
    else
        self.text:SetTextColor(self.color.r,self.color.g,self.color.b)
    end
OnEnter

Code:
self.entered = true
OnLeave

Code:
self.entered = false
OnClick

Code:
FCF_Tab_OnClick(_G[self.frame.."Tab"],button)

local tab1 = kgPanels:FetchFrame("General")  
local tab2 = kgPanels:FetchFrame("Log") 

self:SetBackdropBorderColor(0, 0 , 0, 0)
tab1:SetBackdropBorderColor(0, 0 , 0, 1)
tab2:SetBackdropBorderColor(0, 0 , 0, 1)
self.bg:SetGradientAlpha("VERTICAL", 0, 0, 0, 1,0.18, 0.18, 0.18, 1)
tab1.bg:SetVertexColor(0.18, 0.18, 0.18)
tab2.bg:SetVertexColor(0.18, 0.18, 0.18)

Code for kgpanels:

Code:
^1^T^SLog^T^Sborder_advanced^T^Senable^B^Sshow^T^SBOT^B^STOPRIGHTCORNER^B^SLEFT^B^SBOTLEFTCORNER^B^SRIGHT^B^STOPLEFTCORNER^B^STOP^B^SBOTRIGHTCORNER^B^t^t^Sparent^SUIParent^Sbg_orientation^SHORIZONTAL^SanchorFrom^SCENTER^Shflip^b^Svflip^b^StileSize^N0^Sbg_texture^SBlizzard~`Tooltip^Sanchor^SUIParent^Slevel^N0^Svert_tile^b^Suse_absolute_bg^b^Sbg_blend^SBLEND^Stext^T^Sy^N0^Sx^S1^SjustifyH^SCENTER^Sfont^SContinuum_Medium^Scolor^T^Sa^N1^Sr^F6887858253625464^f-53^Sg^F8759942804610848^f-56^Sb^F8336074604387744^f-55^t^Stext^SLog^SjustifyV^SMIDDLE^Ssize^N12^t^Sy^S-130^Sx^S-267^Sbg_alpha^N1^Sborder_edgeSize^N4^Sheight^S22^Stiling^b^Sstrata^SBACKGROUND^Shorz_tile^b^SanchorTo^SCENTER^Sabsolute_bg^T^SULx^N0^SULy^N0^SLLy^N1^SLLx^N0^SURx^N1^SURy^N0^SLRx^N1^SLRy^N1^t^Sbg_insets^T^Sb^S0^St^S0^Sl^S0^Sr^S0^t^Sscripts^T^SENTER^Sself.entered~`=~`true^SLOAD^S~`~`~`~`local~`font,size~`=~`self.text:GetFont()~J~`~`~`~`self.text:SetFont(font,size,"OUTLINE")~J~`~`~`~`self.text:SetJustifyH("CENTER")~J~`~`~`~`self.text:SetJustifyV("CENTER")~J~`~`~`~`~`~J~`~`~`~`self.color~`=~`(CUSTOM_CLASS_COLORS~`or~`RAID_CLASS_COLORS)[select(2,UnitClass("player"))]~J~`~`~`~`self.frame~`=~`"ChatFrame2"^SCLICK^SFCF_Tab_OnClick(_G[self.frame.."Tab"],button)~J~Jlocal~`tab1~`=~`kgPanels:FetchFrame("General")~`~`~Jlocal~`tab3~`=~`kgPanels:FetchFrame("Trash")~`~J~Jself:SetBackdropBorderColor(0,~`0~`,~`0,~`0)~Jtab1:SetBackdropBorderColor(0,~`0~`,~`0,~`1)~Jtab3:SetBackdropBorderColor(0,~`0~`,~`0,~`1)~Jself.bg:SetGradientAlpha("VERTICAL",~`0,~`0,~`0,~`1,0.18,~`0.18,~`0.18,~`1)~Jtab1.bg:SetVertexColor(0.18,~`0.18,~`0.18)~Jtab3.bg:SetVertexColor(0.18,~`0.18,~`0.18)^SUPDATE^S~`~`~`~`if~`_G[self.frame]:IsShown()~`or~`self.entered~`then~J~`~`~`~`~`~`~`~`self.text:SetTextColor(1,1,1)~J~`~`~`~`else~J~`~`~`~`~`~`~`~`self.text:SetTextColor(self.color.r,self.color.g,self.color.b)~J~`~`~`~`end^SLEAVE^Sself.entered~`=~`false^t^Sbg_style^SSOLID^Sgradient_color^T^Sa^N1^Sr^N1^Sg^N1^Sb^N1^t^Sborder_color^T^Sa^N1^Sr^N0^Sg^N0^Sb^N0^t^Sborder_texture^SCaith^Swidth^S46^Srotation^N0^Sbg_color^T^Sa^N1^Sr^F6499312403420951^f-55^Sg^F6499312403420951^f-55^Sb^F6499312403420951^f-55^t^Smouse^B^Scrop^b^Ssub_level^N0^t^SGeneral^T^Sborder_advanced^T^Senable^B^Sshow^T^SBOTRIGHTCORNER^B^STOPRIGHTCORNER^B^SBOTLEFTCORNER^B^STOPLEFTCORNER^B^SRIGHT^B^SLEFT^B^STOP^B^SBOT^B^t^t^Sparent^SUIParent^Sbg_orientation^SHORIZONTAL^SanchorFrom^SCENTER^Shflip^b^Svflip^b^StileSize^N0^Sbg_texture^SBlizzard~`Tooltip^Sanchor^SUIParent^Slevel^N0^Svert_tile^b^Suse_absolute_bg^b^Sbg_blend^SBLEND^Stext^T^Sy^N0^Sfont^SContinuum_Medium^SjustifyH^SCENTER^Sx^S2^Scolor^T^Sa^N1^Sb^F8336074604387744^f-55^Sg^F8759942804610848^f-56^Sr^F6887858253625464^f-53^t^Stext^SGeneral^SjustifyV^SMIDDLE^Ssize^N12^t^Sy^S-130^Sx^S-323^Sbg_alpha^N1^Sborder_edgeSize^N4^Sheight^S22^Stiling^b^Sstrata^SBACKGROUND^Shorz_tile^b^SanchorTo^SCENTER^Sabsolute_bg^T^SLLy^N1^SLLx^N0^SLRy^N1^SLRx^N1^SURy^N0^SURx^N1^SULy^N0^SULx^N0^t^Sbg_insets^T^Sr^S0^St^S0^Sl^S0^Sb^S0^t^Sscripts^T^SENTER^Sself.entered~`=~`true^SLOAD^S~`~`~`~`local~`font,size~`=~`self.text:GetFont()~J~`~`~`~`self.text:SetFont(font,size,"OUTLINE")~J~`~`~`~`self.text:SetJustifyH("CENTER")~J~`~`~`~`self.text:SetJustifyV("CENTER")~J~`~`~`~`~`~J~`~`~`~`self.color~`=~`(CUSTOM_CLASS_COLORS~`or~`RAID_CLASS_COLORS)[select(2,UnitClass("player"))]~J~`~`~`~`self.frame~`=~`"ChatFrame1"~J~Jself:SetBackdropBorderColor(0,~`0~`,~`0,~`0)~Jself.bg:SetGradientAlpha("VERTICAL",~`0,~`0,~`0,~`1,0.18,~`0.18,~`0.18,~`1)^SCLICK^SFCF_Tab_OnClick(_G[self.frame.."Tab"],button)~J~Jlocal~`tab2~`=~`kgPanels:FetchFrame("Log")~`~`~Jlocal~`tab3~`=~`kgPanels:FetchFrame("Trash")~`~J~Jself:SetBackdropBorderColor(0,~`0~`,~`0,~`0)~Jtab2:SetBackdropBorderColor(0,~`0~`,~`0,~`1)~Jtab3:SetBackdropBorderColor(0,~`0~`,~`0,~`1)~Jself.bg:SetGradientAlpha("VERTICAL",~`0,~`0,~`0,~`1,0.18,~`0.18,~`0.18,~`1)~Jtab2.bg:SetVertexColor(0.18,~`0.18,~`0.18)~Jtab3.bg:SetVertexColor(0.18,~`0.18,~`0.18)^SUPDATE^S~`~`~`~`if~`_G[self.frame]:IsShown()~`or~`self.entered~`then~J~`~`~`~`~`~`~`~`self.text:SetTextColor(1,1,1)~J~`~`~`~`else~J~`~`~`~`~`~`~`~`self.text:SetTextColor(self.color.r,self.color.g,self.color.b)~J~`~`~`~`end^SLEAVE^Sself.entered~`=~`false^t^Sbg_style^SSOLID^Sgradient_color^T^Sa^N0^Sb^N1^Sg^N1^Sr^N1^t^Sborder_color^T^Sa^N1^Sb^N0^Sg^N0^Sr^N0^t^Sborder_texture^SCaith^Swidth^S68^Ssub_level^N0^Scrop^b^Smouse^B^Sbg_color^T^Sa^N1^Sb^F4945129002602899^f-54^Sg^F4945129002602899^f-54^Sr^F4945129002602899^f-54^t^Srotation^N0^t^SChatB^T^Sborder_advanced^T^Senable^B^Sshow^T^SBOTRIGHTCORNER^b^STOPRIGHTCORNER^b^SBOTLEFTCORNER^b^STOPLEFTCORNER^b^SRIGHT^B^SLEFT^B^STOP^b^SBOT^b^t^t^Sparent^SUIParent^Ssub_level^N0^SanchorFrom^SCENTER^Shflip^b^Svflip^b^StileSize^N0^Sbg_texture^SNone^Sanchor^SUIParent^Slevel^N0^Suse_absolute_bg^b^Sbg_blend^SBLEND^Stext^T^Sy^N0^Sfont^SBlizzard^SjustifyH^SCENTER^Sx^N0^Scolor^T^Sa^N1^Sb^N1^Sg^N1^Sr^N1^t^Stext^S^SjustifyV^SMIDDLE^Ssize^N12^t^Srotation^N0^Sx^S-375^Sbg_alpha^N1^Sborder_edgeSize^N4^Sheight^S182^Stiling^b^Sstrata^SBACKGROUND^SanchorTo^SCENTER^Sabsolute_bg^T^SULx^N0^SULy^N0^SLLy^N1^SLLx^N0^SURy^N0^SURx^N1^SLRx^N1^SLRy^N1^t^Sbg_insets^T^Sr^S^St^S^Sl^S^Sb^S^t^Sscripts^T^t^Sbg_style^SNONE^Sgradient_color^T^Sa^N1^Sb^N1^Sg^N1^Sr^N1^t^Sborder_color^T^Sa^N1^Sb^N0^Sg^N0^Sr^N0^t^Sborder_texture^SCaith^Swidth^S368^Sy^S-50^Sbg_color^T^Sa^N1^Sb^F6499312403420951^f-55^Sg^F6499312403420951^f-55^Sr^F6499312403420951^f-55^t^Smouse^b^Scrop^b^Sbg_orientation^SHORIZONTAL^t^SLogB^T^Sborder_advanced^T^Senable^B^Sshow^T^SBOTRIGHTCORNER^B^STOPRIGHTCORNER^b^STOPLEFTCORNER^b^SBOTLEFTCORNER^B^SRIGHT^B^SLEFT^B^STOP^b^SBOT^B^t^t^Sparent^SUIParent^Sbg_orientation^SHORIZONTAL^SanchorFrom^SCENTER^Shflip^b^Svflip^b^StileSize^N0^Sbg_texture^SNone^Sanchor^SUIParent^Slevel^N0^Svert_tile^b^Suse_absolute_bg^b^Sbg_blend^SBLEND^Stext^T^Sy^N0^Sfont^SContinuum_Medium^SjustifyH^SCENTER^Sx^S1^Scolor^T^Sa^N1^Sb^F8336074604387744^f-55^Sg^F8759942804610848^f-56^Sr^F6887858253625464^f-53^t^Stext^S^SjustifyV^SMIDDLE^Ssize^N12^t^Sy^S-130^Sx^S-267^Sbg_alpha^N1^Sborder_edgeSize^N4^Sheight^S22^Stiling^b^Sstrata^SBACKGROUND^Shorz_tile^b^SanchorTo^SCENTER^Sabsolute_bg^T^SLRy^N1^SLRx^N1^SULx^N0^SULy^N0^SURy^N0^SURx^N1^SLLx^N0^SLLy^N1^t^Sbg_insets^T^Sr^S0^St^S0^Sl^S0^Sb^S0^t^Sscripts^T^SENTER^S^SLOAD^S"^SCLICK^S^SUPDATE^S^SLEAVE^S^t^Sbg_style^SNONE^Sgradient_color^T^Sa^N0^Sb^N1^Sg^N1^Sr^N1^t^Sborder_color^T^Sa^N1^Sb^N0^Sg^N0^Sr^N0^t^Sborder_texture^SCaith^Swidth^S46^Ssub_level^N0^Scrop^b^Smouse^b^Sbg_color^T^Sa^N1^Sb^F6499312403420951^f-55^Sg^F6499312403420951^f-55^Sr^F6499312403420951^f-55^t^Srotation^N0^t^SGeneralB^T^Sborder_advanced^T^Senable^B^Sshow^T^SBOTRIGHTCORNER^B^STOPRIGHTCORNER^b^SBOTLEFTCORNER^B^STOPLEFTCORNER^b^SRIGHT^B^SLEFT^B^STOP^b^SBOT^B^t^t^Sparent^SUIParent^Sbg_orientation^SHORIZONTAL^SanchorFrom^SCENTER^Shflip^b^Svflip^b^StileSize^N0^Sbg_texture^SNone^Sanchor^SUIParent^Slevel^N0^Svert_tile^b^Suse_absolute_bg^b^Sbg_blend^SBLEND^Stext^T^Sy^N0^Sfont^SContinuum_Medium^SjustifyH^SCENTER^Sx^S2^Scolor^T^Sa^N1^Sb^F8336074604387744^f-55^Sg^F8759942804610848^f-56^Sr^F6887858253625464^f-53^t^Stext^S^SjustifyV^SMIDDLE^Ssize^N12^t^Sy^S-130^Sx^S-323^Sbg_alpha^N1^Sborder_edgeSize^N4^Sheight^S22^Stiling^b^Sstrata^SBACKGROUND^Shorz_tile^b^SanchorTo^SCENTER^Sabsolute_bg^T^SLLy^N1^SLLx^N0^SLRy^N1^SLRx^N1^SURy^N0^SURx^N1^SULy^N0^SULx^N0^t^Sbg_insets^T^Sr^S0^St^S0^Sl^S0^Sb^S0^t^Sscripts^T^SENTER^S^SLOAD^S^SCLICK^S^SUPDATE^S^SLEAVE^S^t^Sbg_style^SNONE^Sgradient_color^T^Sa^N0^Sb^N1^Sg^N1^Sr^N1^t^Sborder_color^T^Sa^N1^Sb^N0^Sg^N0^Sr^N0^t^Sborder_texture^SCaith^Swidth^S68^Ssub_level^N0^Scrop^b^Smouse^b^Sbg_color^T^Sa^N1^Sb^F6499312403420951^f-55^Sg^F6499312403420951^f-55^Sr^F6499312403420951^f-55^t^Srotation^N0^t^STrash^T^Sborder_advanced^T^Senable^b^Sshow^T^SBOT^B^STOPRIGHTCORNER^B^SLEFT^B^SBOTLEFTCORNER^B^SRIGHT^B^STOPLEFTCORNER^B^STOP^B^SBOTRIGHTCORNER^B^t^t^Sparent^SUIParent^Ssub_level^N0^SanchorFrom^SCENTER^Shflip^b^Svflip^b^StileSize^N0^Sbg_texture^SBlizzard~`Tooltip^Sanchor^SUIParent^Slevel^N0^Suse_absolute_bg^b^Sbg_blend^SBLEND^Stext^T^Sy^S0^Sfont^SContinuum_Medium^SjustifyH^SCENTER^Sx^S0^Scolor^T^Sa^N1^Sr^N1^Sg^N1^Sb^N1^t^Stext^STrash^SjustifyV^SMIDDLE^Ssize^N12^t^Srotation^N0^Sx^S-218^Sbg_alpha^N1^Sborder_edgeSize^N4^Sheight^S22^Stiling^b^Sstrata^SBACKGROUND^SanchorTo^SCENTER^Sabsolute_bg^T^SLRy^N1^SLRx^N1^SULx^N0^SULy^N0^SURx^N1^SURy^N0^SLLx^N0^SLLy^N1^t^Sbg_insets^T^Sb^S^St^S^Sl^S^Sr^S^t^Sscripts^T^SENTER^Sself.entered~`=~`true^SLOAD^S~`~`~`~`local~`font,size~`=~`self.text:GetFont()~J~`~`~`~`self.text:SetFont(font,size,"OUTLINE")~J~`~`~`~`self.text:SetJustifyH("CENTER")~J~`~`~`~`self.text:SetJustifyV("CENTER")~J~`~`~`~`~`~J~`~`~`~`self.color~`=~`(CUSTOM_CLASS_COLORS~`or~`RAID_CLASS_COLORS)[select(2,UnitClass("player"))]~J~`~`~`~`self.frame~`=~`"ChatFrame3"~J^SLEAVE^Sself.entered~`=~`false^SCLICK^SFCF_Tab_OnClick(_G[self.frame.."Tab"],button)~J~Jlocal~`tab1~`=~`kgPanels:FetchFrame("General")~`~`~Jlocal~`tab2~`=~`kgPanels:FetchFrame("Log")~`~J~Jself:SetBackdropBorderColor(0,~`0~`,~`0,~`0)~Jtab1:SetBackdropBorderColor(0,~`0~`,~`0,~`1)~Jtab2:SetBackdropBorderColor(0,~`0~`,~`0,~`1)~Jself.bg:SetGradientAlpha("VERTICAL",~`0,~`0,~`0,~`1,0.18,~`0.18,~`0.18,~`1)~Jtab1.bg:SetVertexColor(0.18,~`0.18,~`0.18)~Jtab2.bg:SetVertexColor(0.18,~`0.18,~`0.18)^SUPDATE^S~`~`~`~`if~`_G[self.frame]:IsShown()~`or~`self.entered~`then~J~`~`~`~`~`~`~`~`self.text:SetTextColor(1,1,1)~J~`~`~`~`else~J~`~`~`~`~`~`~`~`self.text:SetTextColor(self.color.r,self.color.g,self.color.b)~J~`~`~`~`end^SEVENT^S^t^Sbg_style^SSOLID^Sgradient_color^T^Sa^N1^Sr^N1^Sg^N1^Sb^N1^t^Sborder_color^T^Sa^N1^Sr^N0^Sg^N0^Sb^N0^t^Sborder_texture^SCaith^Swidth^S54^Sbg_orientation^SHORIZONTAL^Scrop^b^Smouse^B^Sbg_color^T^Sa^N1^Sr^F6499312403420951^f-55^Sg^F6499312403420951^f-55^Sb^F6499312403420951^f-55^t^Sy^S-130^t^SChat^T^Sborder_advanced^T^Senable^B^Sshow^T^SBOT^b^STOPRIGHTCORNER^b^SLEFT^B^STOPLEFTCORNER^b^SRIGHT^B^SBOTLEFTCORNER^b^STOP^b^SBOTRIGHTCORNER^b^t^t^Sparent^SUIParent^Sbg_orientation^SHORIZONTAL^SanchorFrom^SCENTER^Shflip^b^Svflip^b^StileSize^N0^Sbg_texture^SBlizzard~`Tooltip^Sanchor^SUIParent^Slevel^N0^Suse_absolute_bg^b^Sbg_blend^SBLEND^Stext^T^Sy^N0^Sx^N0^SjustifyH^SCENTER^Sfont^SBlizzard^Scolor^T^Sa^N1^Sr^N1^Sg^N1^Sb^N1^t^Stext^S^SjustifyV^SMIDDLE^Ssize^N12^t^Srotation^N0^Sx^S-375^Sbg_alpha^N1^Sborder_edgeSize^N4^Sheight^S158^Stiling^b^Sstrata^SBACKGROUND^SanchorTo^SCENTER^Sabsolute_bg^T^SLLy^N1^SLLx^N0^SLRy^N1^SLRx^N1^SURx^N1^SURy^N0^SULy^N0^SULx^N0^t^Sbg_insets^T^Sb^S^St^S^Sl^S^Sr^S^t^Sscripts^T^t^Sbg_style^SSOLID^Sgradient_color^T^Sa^N1^Sr^N1^Sg^N1^Sb^N1^t^Sborder_color^T^Sa^N1^Sr^N0^Sg^N0^Sb^N0^t^Sborder_texture^SCaith^Swidth^S368^Ssub_level^N0^Scrop^b^Smouse^b^Sbg_color^T^Sa^N1^Sr^F6499312403420951^f-55^Sg^F6499312403420951^f-55^Sb^F6499312403420951^f-55^t^Sy^S-40^t^STrashB^T^Sborder_advanced^T^Senable^B^Sshow^T^SBOTRIGHTCORNER^B^STOPRIGHTCORNER^b^STOPLEFTCORNER^b^SBOTLEFTCORNER^B^SRIGHT^B^SLEFT^B^STOP^b^SBOT^B^t^t^Sparent^SUIParent^Ssub_level^N0^SanchorFrom^SCENTER^Shflip^b^Svflip^b^StileSize^N0^Sbg_texture^SNone^Sanchor^SUIParent^Slevel^N0^Suse_absolute_bg^b^Sbg_blend^SBLEND^Stext^T^Sy^S0^Sx^S0^SjustifyH^SCENTER^Sfont^SContinuum_Medium^Scolor^T^Sa^N1^Sb^N1^Sg^N1^Sr^N1^t^Stext^S^SjustifyV^SMIDDLE^Ssize^N12^t^Srotation^N0^Sx^S-218^Sbg_alpha^N1^Sborder_edgeSize^N4^Sheight^S22^Stiling^b^Sstrata^SBACKGROUND^SanchorTo^SCENTER^Sabsolute_bg^T^SLLy^N1^SLLx^N0^SLRy^N1^SLRx^N1^SURy^N0^SURx^N1^SULy^N0^SULx^N0^t^Sbg_insets^T^Sr^S^St^S^Sl^S^Sb^S^t^Sscripts^T^SENTER^S^SLOAD^S^SEVENT^S^SCLICK^S^SUPDATE^S^SLEAVE^S^t^Sbg_style^SNONE^Sgradient_color^T^Sa^N1^Sb^N1^Sg^N1^Sr^N1^t^Sborder_color^T^Sa^N1^Sb^N0^Sg^N0^Sr^N0^t^Sborder_texture^SCaith^Swidth^S54^Sy^S-130^Sbg_color^T^Sa^N1^Sb^F6499312403420951^f-55^Sg^F6499312403420951^f-55^Sr^F6499312403420951^f-55^t^Smouse^b^Scrop^b^Sbg_orientation^SHORIZONTAL^t^t^^
What I do:

The part of borders:

two panels of every Tab with that:
1) A back panel of each tab with 3 borders (Right, Left, and bot), background transparent and the corners of top are hidden. Example: |_|
2) A Front panel of each tab with all the borders corner and background. Example: []

When I click the panel, Alpha of the Front panel (2), set to 0, so the borders of the panel with 4 borders dissapear, and now the back panel with 3 borders are visible, that make the efect of we remove the border of top.

Now appear a new problem, cause of corners of back panel (1), are hidden, appear 2 blank spaces, equivalent of top right and top left corners, so... I create 2 panels to fix that.

3) 1 panel with the background and only the borders of right and left. Example : | |
4) 1 panel with all borders and no background (transparent). Example: []

When I join it, the panel (3) cover that blank spaces of the corner tabs, and the panel (4) cover the background and the rest of corners.

So at this point the part of borders its OK.


Now the part of Gradients and colors:

I find a few of Lua codes of gradients I think that understand the next (can be wrong but i think that its ok), I explain:

self.bg:SetGradientAlpha("VERTICAL", 0, 0, 0, 1,0.18, 0.18, 0.18, 1)
____________[Tipe of gradient]_|___[First color][Second color]___

In parits of 4 numbers, the first 3 numbers are the code of color, the 4 number is the alpha of the color (transparency).

I learn to, that with a division of the rgb color per 255, I can give the number what I need.

So When I click each tab, Itselfs take a gradient color (Black / Grey), and the rest of tabs get a solid color of Grey (0.18, 0.18, 0.18), the division of 46, 46, 46 per 255.

Another long day with Lua , for today its enought for me... I need sleep again

Plans for tomorrow Xdd Xdd (today) : try to fix the filter of combat log.

Cause of I hide the tabs with an option of chatter, the filter of CombatLog dissapear too, dont be intended that... I need that filter.


Thanks for all !!

Last edited by Akatosh : 08-08-13 at 12:12 AM.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Helps with Kgpanels!

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off