Recycle bin icon image
Sunday, May 8, 2011 by aceuk | Discussion: Tutorials
Hi
I am using a DX theme called H2so4 by chadamus.
The icons in this theme change when you mouse-over.
I have made some icons for the recycle bin (empty & full)
So I have:-
Recycle bin empty & recycle bin empty over
Recycle bin full & recycle bin full over
The way I have it setup at the moment is:-
Empty - recycle bin empty
Full - recycle bin full
Mouse over - recycle bin full over
As the only time I’ll click on the icon is when it is full.
But is it possible to show the empty bin with mouse over as well.
Because if the mouse goes over the icon when it is empty I end up with a full over image.
Thanx
Reply #2 Sunday, May 8, 2011 6:06 PM
Easiest way I know is to include the four images (fullover, fullaway, emptyover, emptyaway) in Properties > Summary > Custom Files, set the full and empty states to their respective 'away' images (remove any other states.) Then add this script:
- 'Called on mouse over object
- Sub Object_OnMouseEnter
- If object.state = "Full" Then
- object.Picture = "binfullover.jpg"
- ElseIf object.state = "Empty" Then
- object.Picture = "binemptyover.jpg"
- End If
- End Sub
- 'Called when mouse leaves object
- Sub Object_OnMouseLeave
- If object.state = "Full" Then
- object.Picture = "binfullaway.jpg"
- ElseIf object.state = "Empty" Then
- object.Picture = "binemptyaway.jpg"
- End If
- End Sub
Reply #4 Monday, May 9, 2011 7:47 AM
RedneckDude - Thanx for pointing sViz to this.
sViz - I'll try this when I get home. I thought it would be a scripted issue.
Reply #5 Monday, May 9, 2011 2:48 PM
sViz - when I open custom files it sats they should be saved into "object data dir" .
I can not find this .
Also do I copy what you have writtern onto notepad and save it then put this into the object data dir . Then click add .
Do I have to put the numbers in and I take it that instead of "binemptyover.jpg" I would put "recyclebinEover.bmp" as that is what mine is.
Thanx
I found your DX script helper .
I got the script into it but do not know how to apply it to the icon.
When I click on add (in custom files) i get DX script helper.exe.
How do you tell it what script to look for.
Reply #6 Monday, May 9, 2011 10:55 PM
When you include a file, it is copied to the object data directory. This is found in the Current Theme folder. But once it's saved there, you can refer to it in script as shown above (after applying, you should also find it in the dropdown for images in States > Appearance.) Yes, you'll need to put the name of your images, instead.
Blech, I forgot the vbscript code thingy on this forum includes numbers (someone should fix that.) Here it is again. Go to Properties > General > Script > New, and copy and paste the code in DX Script Editor window:
'Called on mouse over object
Sub Object_OnMouseEnter
If object.state = "Full" Then
object.Picture = "binfullover.jpg"
ElseIf object.state = "Empty" Then
object.Picture = "binemptyover.jpg"
End If
End Sub
'Called when mouse leaves object
Sub Object_OnMouseLeave
If object.state = "Full" Then
object.Picture = "binfullaway.jpg"
ElseIf object.state = "Empty" Then
object.Picture = "binemptyaway.jpg"
End If
End Sub
The DX Script Helper only stores codes for easy copy and pasting. By clicking on the code title, it copies the code to the system clipboard, so you can paste it wherever. (See the skin's instructions/description.)
Reply #7 Monday, May 9, 2011 11:35 PM
sViz - I'll try this when I get home. I thought it would be a scripted issue.
You betcha!!!
Reply #8 Tuesday, May 10, 2011 1:20 AM
Went to Properties > General > Script > Edit (there is no New) and deleted what was there,
then copy and paste the code in DX Script Editor window. then applied
Now the bin dissappears when i mouseover.
I also tried using the option External script but same effect
This is what I copied
'Called on mouse over object
Sub Object_OnMouseEnter
If object.state = "Full" Then
object.Picture = "recyclebinFover.bmp"
ElseIf object.state = "Empty" Then
object.Picture = "recyclebinEover.bmp"
End If
End Sub
'Called when mouse leaves object
Sub Object_OnMouseLeave
If object.state = "Full" Then
object.Picture = "recyclebinF.bmp"
ElseIf object.state = "Empty" Then
object.Picture = "recyclebinE.bmp"
End If
End Sub
Reply #9 Tuesday, May 10, 2011 11:21 AM
You included all four images, yes? And there are no other states but Full and Empty? If so, feel free to email me the object so i can have a look at it (check your PMs.)
Reply #10 Thursday, May 12, 2011 7:55 AM
sViz - Got your email this morning and as soon as I read it I understood where I went wrong.
Just looking back at your reply #2 - don't know how I did not manage to follow those instructions.
I will check out what you did when I get home from work.
Thanx
Paul
Reply #11 Thursday, May 12, 2011 3:42 PM
sViz
Thanx for your time & effort .
Once again you've solved my problem.
Cheers
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 Sunday, May 8, 2011 11:05 AM
You can only have one mouse over state. Unless maybe it can be scripted otherwise.
I'll point sviz to this thread for you.