DesktopX: Auto-Hide with no animation
Friday, September 17, 2004 by wolfmah | Discussion: Skinning
I have begun something but now I'm stock with another problem. First, I have created an object with an empty 1px PNG. This object is use to activate the auto-hide feature. So, when you over it, I output some script code to make it disappear and to show the real thing. This new object that I am showing is actually a container for whatever control you want to use. Thisi container is not a rectangle shape and the "Activation" setting is at "Visible area". In this container, I have put script code in the OnLeave event so it can hide himself and re-show the invisible activator.
Code :
'Auto-hide activator
Sub Object_OnMouseEnter
DesktopX.ScriptObject("container").Object.Visible = True
Object.Visible = False
End Sub
'Container
Sub Object_OnMouseLeave
DesktopX.ScriptObject("containerActivator").Object.Visible = True
Object.Visible = False
End Sub
But, as I mentionned, there is a problem with this. When you start adding components on the container, the event Object_OnMouseLeave will be triggered when over those new components, thus resulting in the closing of the container. This really bug me, 'cause I can't find a way to overcome it. >
Well, in fact there is a way. This occur 'cause I'm using a non-rectangular PNG for the container. If I was using a rectangular one, there would be no problem 'cause I could set the property "Activation" to "Rectangular area", but that would ruin all the fun of skinning the desktop 'cause the reason why I wanted to skin my Windows was to get rid of this flat rectangle feeling.Anyone have any idea on this?
Reply #2 Saturday, September 18, 2004 10:18 AM
If that's what you mean, then how could I know I'm over a component while beign in the container script? I have check the doc and there is no mention of a way to know the child element of an object.
Reply #3 Saturday, September 18, 2004 1:20 PM
I'm not that familiar with VBscript yet or I'd try to write an example. The coding I've done has been in other languages.
This would be an example
If mouse is away from container AND mouse is over container component
Then container is visible
While container is visible
If component is triggered (mouse over, click, etc.)
Then Do something
Wend
Else container is not visible
End If
Don't know if this will work, but hopefully it will get you in the right direction until some better coders come along on this thread.

Reply #4 Saturday, September 18, 2004 10:52 PM
If mouse is away from container AND mouse is over container component |
The "mouse is away from container" is pretty easy to do, but knowing if the mouse is over a component while remaining in the container script (otherwise, I'll be leaving the script and thus resulting in the hidding of the container before I ever arrive to the component), that I don't know I to do. And if you think I'll enter each component's coordinates in the condition, you are really mistaking me.

Reply #5 Saturday, September 18, 2004 11:41 PM
Reply #7 Sunday, September 19, 2004 9:37 AM
| Oh well, maybe I gave you some ideas. |
You sure have pictoratus, but I still got some work to do on this.
| Could you have an invisible layer over the entire thing that doesnt intercept mouse clicks, but recognizes the mouse positioning? |
I don't see how having another layer would help me. I don't see how I would be able to know when I'm no longer over the image if I use a transparent layer. Check this to see what it looks like :

Since my shape is made out of a circle, I was starting to think that I could check if the mouse coordinate equals a coordinate of the circle's arc. But then again, I think my lack of advance math is rigging at the door.

Please login to comment and/or vote for this skin.
Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:
- Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
- Access to a great community, with a massive database of many, many areas of interest.
- Access to contests & subscription offers like exclusive emails.
- It's simple, and FREE!







Reply #1 Saturday, September 18, 2004 12:12 AM
What if you use a state change (mouse away) for your container and use a If And Else where mousing over the new components And mouse away on container left it visible but mouse away on container only made visible false.
Make sense?