Thread Tools Display Modes
01-18-14, 11:23 AM   #1
Wimpface
A Molten Giant
 
Wimpface's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 648
Hiding an unwanted border

I've been struggling with this for a few weeks now, and people are pressuring me to update my UI so I figured I'll have to deal with it once and for all.

There's an unwanted border in my editbox that takes it's color from the channel I'm sending to and I can't figure out how to get rid of it. I've searched for a texture name, I've tried using /framestack to see what it's called, but I come up empty every time. I'm not sure this is default, as I've stripped bits from multiple chat addons to get the functionality I want.



As you can see, it looks quite displaced with the round, blizzard-esque border in there.

Here's my code, hosted on github.
https://gist.github.com/anonymous/8493437

I thought...
Code:
for i = 1, NUM_CHAT_WINDOWS do
	local editBoxleft = _G[format("%s%d%s", "ChatFrame", i, "EditBoxLeft")]
	local editBoxright = _G[format("%s%d%s", "ChatFrame", i, "EditBoxRight")]
	local editBoxmid = _G[format("%s%d%s", "ChatFrame", i, "EditBoxMid")]
	editBoxleft:SetAlpha(0)
	editBoxright:SetAlpha(0)
	editBoxmid:SetAlpha(0)
end
... would deal with it but it "only" took care of everything else, not this one border.

Is this even default functionality? I noticed rChat has it aswell. I can't find anything in the code that would add it though, but I've made sillier mistakes before.

Does anyone know how to hide this?
__________________
All I see is strobe lights blinding me in my hindsight.
  Reply With Quote
01-18-14, 11:30 AM   #2
Clamsoda
A Frostmaul Preserver
Join Date: Nov 2011
Posts: 269
Change the global accordingly.

Lua Code:
  1. ChatFrame1EditBox.focusLeft:SetTexture(nil)
  2. ChatFrame1EditBox.focusMid:SetTexture(nil)
  3. ChatFrame1EditBox.focusRight:SetTexture(nil)

When you are searching for odd bits like this, it helps to see what GetRegions() returns.
  Reply With Quote
01-18-14, 11:43 AM   #3
Wimpface
A Molten Giant
 
Wimpface's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 648
Originally Posted by Clamsoda View Post
Change the global accordingly.

Lua Code:
  1. ChatFrame1EditBox.focusLeft:SetTexture(nil)
  2. ChatFrame1EditBox.focusMid:SetTexture(nil)
  3. ChatFrame1EditBox.focusRight:SetTexture(nil)

When you are searching for odd bits like this, it helps to see what GetRegions() returns.
Thanks a lot, that worked!

I tried seeing what GetRegions() returned, but I just got this and I've no idea how to decipher those.
__________________
All I see is strobe lights blinding me in my hindsight.
  Reply With Quote
01-18-14, 01:25 PM   #4
Clamsoda
A Frostmaul Preserver
Join Date: Nov 2011
Posts: 269
Lua Code:
  1. -- Let's assume there are 15 regions.  There may be more, there may be less.
  2. for i = 1, 15 do
  3.     print(select(i, ChatFrame1EditBox:GetRegions()):GetName())
  4. end

What does that do? A lot of Blizzard's objects have a name, that may make things easier to decipher.

The tough part, I have found, is that some regions without names are the ones you want to modify, so it takes some trial and error.

Last edited by Clamsoda : 01-18-14 at 01:33 PM.
  Reply With Quote
01-18-14, 02:56 PM   #5
Wimpface
A Molten Giant
 
Wimpface's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 648
Originally Posted by Clamsoda View Post
Lua Code:
  1. -- Let's assume there are 15 regions.  There may be more, there may be less.
  2. for i = 1, 15 do
  3.     print(select(i, ChatFrame1EditBox:GetRegions()):GetName())
  4. end

What does that do? A lot of Blizzard's objects have a name, that may make things easier to decipher.

The tough part, I have found, is that some regions without names are the ones you want to modify, so it takes some trial and error.


EDIT: Posted too soon, this method would've worked. What you can't see in the picture is a bunch of nils before the top one, probably things I've hidden already. I ran the code from ingame, instead of via an addon.
__________________
All I see is strobe lights blinding me in my hindsight.
  Reply With Quote
01-18-14, 02:58 PM   #6
Clamsoda
A Frostmaul Preserver
Join Date: Nov 2011
Posts: 269
The nils are regions without names, perhaps. I believe GetName() returns the global name of the object. If it hasn't got one, there's nothing to return.
  Reply With Quote
01-19-14, 05:49 AM   #7
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Most backgrounds and borders in the default UI have neither global names nor keys on their parents, since the default UI never does anything with them after creating them.

I use the following debugging function for region-exploring in my "sandbox" addon; it will print a full list of the given object's regions:

Code:
function DumpRegions(frame)
	if type(frame) == "string" then
		frame = _G[frame]
	end
	if type(frame) ~= "table" or not frame.GetRegions then
		return print("Usage: DumpRegions(frame) - frame must be a valid frame reference or name!")
	end
	local regions = { frame:GetRegions() }
	print(format("%s has %d regions:", frame:GetName() or "<frame>", #regions))
	for i = 1, #regions do
		local region, parentKey = regions[i]
		for k, v in pairs(frame) do
			if v == region then
				parentKey = k
				break
			end
		end
		print(format("%d. %s (%s) %s", i, region:GetName() or "<unnamed>", region:GetObjectType(), parentKey or ""))
	end
end
Usage: /run DumpRegions(ChatFrame1EditBox)

(Yes, that's a global function name, and yes, that's a single-use table creation inside a function, and no, that's not permission to use global function names and create tables in functions in your production code. )
__________________
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
01-19-14, 09:24 AM   #8
Clamsoda
A Frostmaul Preserver
Join Date: Nov 2011
Posts: 269
Ooh, that's pretty slick Phanx. I am sure I'll be putting that to good use ^o^.
  Reply With Quote
01-19-14, 12:18 PM   #9
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
Lua Code:
  1. /run ChatFrame1EditBox:DisableDrawLayer("BORDER")

Should do the trick, you can also do this with MoveAnything, to disable all frames on a given layer. I'm not sure if it's hides local or unnamed frames too, but i think it should.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Hiding an unwanted border

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