This site makes extensive use of JavaScript.
Please enable JavaScript in your browser.
Live
PTR
10.2.5
PTR
10.2.6
[Frame] Too small tabs
Post Reply
Return to board index
Post by
Wildhorn
I am trying to make tabs. My problem is that they
do not want to increase in size
.
The background/highlight you see is the default sized one. I can increase the size of the tab, but only the text seem to take the place, while background/highlight stick to default size. How do I make background/highlight to take all the space? (Also for weird reason, the highlight center while the background doesnt)
local TabOne = CreateFrame("Button", "fTabOne", fMain, "TabButtonTemplate")
TabOne:SetPoint("BOTTOMLEFT",fMain,"TOPLEFT", 0, 0)
TabOne:SetSize(100,100)
TabOne:SetText("ARRRRRRRRG")
local TabTwo = CreateFrame("Button", "fTabTwo", fMain, "TabButtonTemplate")
TabTwo:SetPoint("LEFT",TabOne,"RIGHT", 0, 0)
TabTwo:SetSize(100,100)
TabTwo:SetText("Stupid Text")
Post by
Toldu
I don't know how to fix it but it looks like you're setting a definitive area for the tab (SetSize(100,100)) but should be making it stretch to the size of the tab text. Again, idk what the commands are to fix it, but I believe that's your issue. You can either use trial & error to get the exact dimensions correct or find the command that will size it for you.
Post by
Sentrios
Try this after your code:
PanelTemplates_TabResize(TabOne, 0)
PanelTemplates_TabResize(TabTwo, 0)
Post by
Wildhorn
Thanks alot Sentrios.
Could I know where PanelTemplates_TabResize come from?
Post by
HighFive
/FrameXML/UIPanelTemplates.lua.
Post by
Wildhorn
/FrameXML/UIPanelTemplates.lua.
Ah damn silly me. I checked the .xml and I saw that script line, "mais j'ai pas allumer".
Btw, question like that. Is it possible to rotate a frame?
Post by
HighFive
Never really thought about it.
I guess it would boil down to rotating the text - the rest can be emulated if there's no implemented way to already do it.
Post by
Wildhorn
Well, I would like a tab, on the right side of the frame. But I looked throu texture files, but could not find any. I know it can be emulated, but I really dont feel to craft one by myself, because I am very not good at getting the right parts of texture (yippi for templates) >_<
EDIT: I think I found a texture that would fit, \Spellbook\SpellBook-SkillLineTab.blp
EDIT2: Also, why do I have to manually call PanelTemplates_TabResize when it is in the template?
Post by
Wildhorn
I finally made my own >_<
But I got
a problem
. The highlight is off the frame, same thing with text and I currently have no idea how to change those. There is no API :SetTextPosition or anything like that and I have no idea where these information are stored and how to modify them. So, it would be nice, if anybody would highlight me :P
EDIT: Oops, silly me forgot to add the code.
local TabFTW = CreateFrame("Button", "fTabFTW", fMain)
TabFTW:SetNormalTexture("Interface\\Spellbook\\SpellBook-SkillLineTab")
TabFTW:SetNormalFontObject("GameFontNormalSmall")
TabFTW:SetHighlightFontObject("GameFontHighlightSmall")
TabFTW:SetHighlightTexture("Interface\\PaperDollInfoFrame\\UI-Character-Tab-Highlight")
TabFTW:EnableMouse(true)
TabFTW:SetSize(50,120)
TabFTW:SetPoint("TOPLEFT",fMain,"TOPRIGHT", 0, 0)
TabFTW:SetText("F\n\rT\n\rW")
Post by
Wanderingfox
Well, I would like a tab, on the right side of the frame. But I looked throu texture files, but could not find any. I know it can be emulated, but I really dont feel to craft one by myself, because I am very not good at getting the right parts of texture (yippi for templates) >_<
EDIT: I think I found a texture that would fit, \Spellbook\SpellBook-SkillLineTab.blp
EDIT2: Also, why do I have to manually call PanelTemplates_TabResize when it is in the template?
My guess would be because the API has absolutely no clue when you want to refresh the tab size information, so you have to tell it to do it?
Post by
Wildhorn
@fox: Well, it is the first frame type that does that. Every other resized automatically when I set a new size.
Post by
Wanderingfox
They're not just frames though :P
Post by
Wildhorn
They're not just frames though :P
Yes they are. They are buttons and buttons inherit from frames ;P
Every other buttons I used scaled automatically when I resized em.
Post by
Wanderingfox
Perhaps, but I always thought there was something odd running in the backend on the tab template... Maybe i'm just imagining things >_<
Post by
Wildhorn
Anyway, any idea about my highlight problem?
Post by
Wanderingfox
Mess with the width (or height... might be swapped) of the tab? You set it to 100,100 but the tab texture itself isn't that big (ie. it's not square). The tab may be aligning the text to the size you gave it, rather than the displayed texture.
Post by
Wildhorn
If i change the tab size, it also change the size of the background (which is the size i want it). And it is 50,120 :P
Read
the right code :P
Post by
Wildhorn
Gah, fixed all that. I even found how to rotate frame (you dont rotate the frame, but the texture) >_<
Man, It is starting to get big. All that stuff is because I am improving one of my oldest addon I made. It is for both to learn more about widget and all that, but also to help other people who are learning, because I add alots of comment and so far, it seem I will be using every freaking type of
widgets
to improve this addon. So you better to enjoy it once I am done :P
Post by
pelf
Ah damn silly me. I checked the .xml and I saw that script line, "
mais j'ai pas allumer
".
", but a light didn't go on."
", but a light didn't turn on."
", but I didn't recognize it."
Any of those could work. Literally yours is, "but I didn't illuminate", so if you wanted to keep the light metaphor, you'd use one of the first. It's an idiom in English too.
Post by
Wildhorn
Yeah, I know that 90% of french idioms exist in a more or less word-to-word english version, but this one was just sounding very odd to my ears.
Post Reply
You are not logged in. Please
log in
to post a reply or
register
if you don't already have an account.