It is currently May 4th, 2024, 5:18 pm

Shortcuts binded to Buttons

Get help with creating, editing & fixing problems with skins
Lawliet72
Posts: 5
Joined: August 13th, 2012, 11:12 am

Shortcuts binded to Buttons

Post by Lawliet72 »

Hi there, I've created a skin Metro-Style with Photoshop, and Following the tecnique told in the Buttons guide, I've done my .ini files.

The problem is that the Icons appear, but if I want to include the Buttons wich bring me to a selected shortcut located in the Links Folder, the Icons will duplicate in a buggy way and I won't be able to click them. Here I got some screenshots and the entire skin, so you can try it out, modify it and see what's wrong.

By the way: I think the problem is the Y and X position of the button.

So:
Image
Image
The whole project is this:
http://www.mediafire.com/?nbv5b1xkmgz53fm
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Shortcuts binded to Buttons

Post by jsmorley »

The trouble is that those images are not 'buttons' in that they are not bitmap images. Not .bmp, but bitmap in the sense of an image with equally sized 'frames' that can be used for the 'states' of a button.

An image you want to use in a Button meter needs to be a single image with 3 frames. What Rainmeter does is divide the image into three, and use the appropriate frame for each of the off/over/down states of the button.

http://rainmeter.net/cms/Tips-ButtonImage

If you don't want or need the visible "states" on the images when you mouse over / mouse leave / mouse down on them, just don't use Meter=Button. Stay with Meter=Image, and put the LeftMouseUpAction= right on that. There is no need to use a button meter just to turn them into a clickable action.
Lawliet72
Posts: 5
Joined: August 13th, 2012, 11:12 am

Re: Shortcuts binded to Buttons

Post by Lawliet72 »

jsmorley wrote:The trouble is that those images are not 'buttons' in that they are not bitmap images. Not .bmp, but bitmap in the sense of an image with equally sized 'frames' that can be used for the 'states' of a button.

An image you want to use in a Button meter needs to be a single image with 3 frames. What Rainmeter does is divide the image into three, and use the appropriate frame for each of the off/over/down states of the button.

http://rainmeter.net/cms/Tips-ButtonImage

If you don't want or need the visible "states" on the images when you mouse over / mouse leave / mouse down on them, just don't use Meter=Button. Stay with Meter=Image, and put the LeftMouseUpAction= right on that. There is no need to use a button meter just to turn them into a clickable action.
Okay, thanks, so yeah I didn't want to have the button thingy, I just needed the shortcut. I'll try it out and see what happens - please keep the tread open if I need more help.

Thanks a bunch
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Shortcuts binded to Buttons

Post by jsmorley »

Lawliet72 wrote: Okay, thanks, so yeah I didn't want to have the button thingy, I just needed the shortcut. I'll try it out and see what happens - please keep the tread open if I need more help.

Thanks a bunch
We'll keep a light on for you.
Lawliet72
Posts: 5
Joined: August 13th, 2012, 11:12 am

Re: Shortcuts binded to Buttons

Post by Lawliet72 »

jsmorley wrote: We'll keep a light on for you.

Code: Select all

[MeterPHOTOSHOP_ICON]
Meter=IMAGE
W:1920
H:1080
ImageName=Images\photoshop.png
LeftMouseUpAction=!Execute ["#LINKS#photoshop.lnk"]

[MeterLEAGUE_ICON]
Meter=IMAGE
W:1920
H:1080
ImageName=Images\league.png
LeftMouseUpAction=!Execute ["#LINKS#league.lnk"]

[MeterISAAC_ICON]
Meter=IMAGE
W:1920
H:1080
ImageName=Images\isaac.png
LeftMouseUpAction=!Execute ["#LINKS#isaac.lnk"]

[MeterSTEAM_ICON]
Meter=IMAGE
W:1920
H:1080
ImageName=Images\steam.png
LeftMouseUpAction=!Execute ["#LINKS#steam.lnk"]

[MeterFACEBOOK_ICON]
Meter=IMAGE
W:1920
H:1080
ImageName=Images\facebook.png
LeftMouseUpAction=!Execute ["#LINKS#facebook.lnk"]

[MeterYOUTUBE_ICON]
Meter=IMAGE
W:1920
H:1080
ImageName=Images\youtube.png
LeftMouseUpAction=!Execute ["#LINKS#youtube.lnk"]


[MeterWOW_ICON]
Meter=IMAGE
W:1920
H:1080
ImageName=Images\wow.png
LeftMouseUpAction=!Execute ["#LINKS#wow.lnk"]
So now you can see that I put the execute command to all the images, but there's still a problem: whatever Icon I click, it always will run World of Warcraft (wow.lnk).
Should I make an .ini file for each image with its own folder?
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Shortcuts binded to Buttons

Post by jsmorley »

Lawliet72 wrote:

Code: Select all

[MeterPHOTOSHOP_ICON]
Meter=IMAGE
W:1920
H:1080
ImageName=Images\photoshop.png
LeftMouseUpAction=!Execute ["#LINKS#photoshop.lnk"]

[MeterLEAGUE_ICON]
Meter=IMAGE
W:1920
H:1080
ImageName=Images\league.png
LeftMouseUpAction=!Execute ["#LINKS#league.lnk"]

[MeterISAAC_ICON]
Meter=IMAGE
W:1920
H:1080
ImageName=Images\isaac.png
LeftMouseUpAction=!Execute ["#LINKS#isaac.lnk"]

[MeterSTEAM_ICON]
Meter=IMAGE
W:1920
H:1080
ImageName=Images\steam.png
LeftMouseUpAction=!Execute ["#LINKS#steam.lnk"]

[MeterFACEBOOK_ICON]
Meter=IMAGE
W:1920
H:1080
ImageName=Images\facebook.png
LeftMouseUpAction=!Execute ["#LINKS#facebook.lnk"]

[MeterYOUTUBE_ICON]
Meter=IMAGE
W:1920
H:1080
ImageName=Images\youtube.png
LeftMouseUpAction=!Execute ["#LINKS#youtube.lnk"]


[MeterWOW_ICON]
Meter=IMAGE
W:1920
H:1080
ImageName=Images\wow.png
LeftMouseUpAction=!Execute ["#LINKS#wow.lnk"]
So now you can see that I put the execute command to all the images, but there's still a problem: whatever Icon I click, it always will run World of Warcraft (wow.lnk).
Should I make an .ini file for each image with its own folder?
Well, first, the W:1920 and H:1080 are completely ignored, as all statements in Rainmeter .ini files (without exception) are Option=Value, so if you want to set the width and height of an image (which I suspect in this case you actually don't) you would use W=1920 and H=1080.

Second, you don't have any X= or Y= set on the meters, so they are all going to be positioned in exactly the same spot. Since wow.png is last in the .ini, that one will be on "top" and will be the one to get the mouse action.
Lawliet72
Posts: 5
Joined: August 13th, 2012, 11:12 am

Re: Shortcuts binded to Buttons

Post by Lawliet72 »

jsmorley wrote: Well, first, the W:1920 and H:1080 are completely ignored, as all statements in Rainmeter .ini files (without exception) are Option=Value, so if you want to set the width and height of an image (which I suspect in this case you actually don't) you would use W=1920 and H=1080.

Second, you don't have any X= or Y= set on the meters, so they are all going to be positioned in exactly the same spot. Since wow.png is last in the .ini, that one will be on "top" and will be the one to get the mouse action.
Okay, and one more last tip: how can I count the pixels of Y and X to place the exact action in the exact place? I mean, if I have to place the "action" (the execution of the shortcut) in a certain place of the screen, how can I know it? Is there a tutorial about it? I can't find it.

Sorry for my noobyness. Thanks for the help :)
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Shortcuts binded to Buttons

Post by jsmorley »

Lawliet72 wrote:Okay, and one more last tip: how can I count the pixels of Y and X to place the exact action in the exact place? I mean, if I have to place the "action" (the execution of the shortcut) in a certain place of the screen, how can I know it? Is there a tutorial about it? I can't find it.

Sorry for my noobyness. Thanks for the help :)
The last problem is that you are treating these images / actions as if they are "hotspots" on a large image. That isn't how Rainmeter works. All of your images are just huge, the full size of your entire screen, with tons of transparent space around them. Then the approach you are thinking of is that you will just layer these one on top of the other, and set the "action" on some specific part. Won't work.

What you need to do is edit these images. Crop them down to just the size of the part you want clickable. So for instance that facebook.png will go from 1920x1080 to 708x247 when you crop it down to just the logo. Do that for all of them.

Now you can arrange the images in the skin using Image meters with an appropriate X= and Y= on them.

[MeterFaceBook]
Meter=Image
ImageName=Images\facebook.png
X=200
Y=0
LeftMouseUpAction=["http://facebook.com"]

[MeterYoutube]
Meter=Image
ImageName=Images\youtube.png
X=2R
Y=0
LeftMouseUpAction=["http://youtube.com"]

So what we are doing there us putting the first image in some appropriate spot. (note I am putting it out to the right at X=200, since in the sample image you posted of how you want the skin to look it was offset to the right from the ones on the next row) Then the next one, the Youtube image, I am putting 2 pixels to the right of the Facebook one, by using X=2R, which means 2 pixels "relative" to the end of the previous meter. ("R" means relative to the end, and "r" means relative to the beginning)

Then we can start on that second row...

[MeterIsaac]
Meter=Image
ImageName=Images\isaac.png
X=0
Y=2R
LeftMouseUpAction=["#CURRENTPATH#Links\isaac.lnk"]

Notice that I am setting the position of isaac.png all the way to the left, but 2 pixels below the previous meter (youtube.png)

That will give us:
8-13-2012 9-26-30 AM.jpg
You should be able to carry on from there following the same pattern. Let me know if you have questions.

======================
A few side notes:

Using Windows shortcut / lnk files for your actions is perfectly ok, but probably not needed in many cases. Opening a web site with Rainmeter is as simple as LeftMouseUpAction=["http://SomeSite.com"] and running an application is as simple as LeftMouseUpAction=["C:\Program Files\Steam\steam.exe"]. Up to you, but it might be more work than you need to create shortcuts for everything you want to run, and it makes it a bit more work to change things later.

Don't use spaces or punctuation characters in your folder names in Rainmeter. \Lawliet's Gear I would change to \LawlietsGear or something. Spaces and things like single quotes in folder names in Rainmeter is just a recipe for trouble later on.

There is no reason to set the Update= in the [Rainmeter] section of the skin to anything lower than the default Update=1000. Having the skin update those images every 100 milliseconds instead of 1000 milliseconds won't buy you anything, and will just cause the skin to use a little more CPU than it needs to.

Entirely up to you, but you might consider using the @Resources folder to store your images and links. It will eliminate having to set a variable for the images folder, and make Rainmeter load just a hair faster as Rainmeter doesn't scan any @Resources folders for skins when it loads.

http://rainmeter.net/cms/Skins-Resources_beta
You do not have the required permissions to view the files attached to this post.
Lawliet72
Posts: 5
Joined: August 13th, 2012, 11:12 am

Re: Shortcuts binded to Buttons

Post by Lawliet72 »

Best support ever! Thank you, really helpful!
Now I'm a professional skin producer :D
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Shortcuts binded to Buttons

Post by jsmorley »

Lawliet72 wrote:Best support ever! Thank you, really helpful!
Now I'm a professional skin producer :D
Time to join the union!

Glad to help.