Thread Tools Display Modes
10-27-16, 12:52 PM   #1
Mayron
A Frostmaul Preserver
 
Mayron's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 275
Hidden ScrollChild elements Clickable

I've noticed that interactive elements attached to a frame being used as a scroll child for a ScrollFrame are still usable despite being scrolled out of view. I've noticed that Blizzard GUI panels don't have this problem and not sure why. I can't seem to figure it out.

I've tried "IsMouseOver" and "IsVisible" but anything on the scroll child frame, even if out of view, will return true.

Here is what I mean:



However, the bottom half of this Blizzard Button cannot be clicked on if it is out of view which is what I want to do with my frames:



Does anyone know why this might be?
Thank you
  Reply With Quote
10-27-16, 02:12 PM   #2
jeruku
A Cobalt Mageweaver
 
jeruku's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 223
This was solved over on this thread.
Originally Posted by MunkDev View Post
Not sure if I'm providing any new information here, but I encountered this as well. The issue was of course the change to scroll frames, as they will not clip their children automatically unless defined either in XML or lua. To solve this, I simply put this in my scroll frame wrapper:
Lua Code:
  1. frame:SetClipsChildren(true)

In XML, the tag is clipChildren="true". This causes any children outside the boundaries of the frame to be unclickable and frankly not drawn at all. Any scroll frame now also returns an object type of plain "Frame", suggesting that the specific "ScrollFrame" widget doesn't exist anymore and is now an intrinsic frame template that simply provides scrolling and child anchoring methods.
__________________
"I have not failed, I simply found 10,000 ways that did not work." - Thomas Edison
  Reply With Quote
10-27-16, 03:44 PM   #3
Mayron
A Frostmaul Preserver
 
Mayron's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 275
Excellent thank you! I reply on wowprogramming which always seems out dated and I never know how to find new API listings. It seems like such a stupid change as this should be enabled by default :/
  Reply With Quote
10-28-16, 05:45 PM   #4
Mayron
A Frostmaul Preserver
 
Mayron's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 275
The only problem with this is that it hides the scroll bar as the scroll bar is positioned outside of the scroll frame and needs to be a child for the OnVerticalScroll event to work. It also clips the border from showing. Very frustrating and restrictive :/
  Reply With Quote
01-24-18, 08:14 AM   #5
Zadrax
A Kobold Labourer
AddOn Author - Click to view addons
Join Date: Jan 2018
Posts: 1
Sorry for bumping an old thread. The solution is to use frame:SetToplevel(true) and avoid using scrollframe:SetClipsChildren(true). This has caused me quite a bit of trouble, so I'm noting it here for posterity.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Hidden ScrollChild elements Clickable


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