It is currently May 4th, 2024, 6:55 pm

IF Action

Get help with creating, editing & fixing problems with skins
bazsi44
Posts: 12
Joined: May 2nd, 2011, 2:50 pm

IF Action

Post by bazsi44 »

Hy.
I want to use if action that's way:

I have two button, and three image
two images are hidden.
Example:
(Hidden image) (Button1) (Visible Image) (Button2) (Hidden image2)

1.
If I click the (Button2), the (Visible Image) becomes hidden, and the (Hidden image2) becomes visible.
When (Hidden image2) visible, and I click the (Button1), the (Hidden image2) becomes hidden, and (Visible Image) becomes visible.
2.
If I click the (Button1), the (Visible Image) becomes hidden, and (Hidden image) becomes visible.
When (Hidden image) visible, and I click the (Button2), the (Hidden image) becomes hidden, and (Visible Image) becomes visible

I hope it's understandable. :bow:
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: IF Action

Post by jsmorley »

Something like this, using !ToggleMeter, should work:

[Image1]
Meter=Image
SolidColor=255,0,0,255
W=50
H=50
X=0
Y=0
Hidden=1

[Button1]
Meter=Image
SolidColor=150,150,150,255
W=50
H=50
X=R
Y=0
LeftMouseUpAction=!Execute [!ToggleMeter Image1][!ToggleMeter Image2]

[Image2]
Meter=Image
SolidColor=0,255,0,255
W=50
H=50
X=R
Y=0

[Button2]
Meter=Image
SolidColor=150,150,150,255
W=50
H=50
X=R
Y=0
LeftMouseUpAction=!Execute [!ToggleMeter Image3][!ToggleMeter Image2]

[Image3]
Meter=Image
SolidColor=0,0,255,255
W=50
H=50
X=R
Y=0
Hidden=1
bazsi44
Posts: 12
Joined: May 2nd, 2011, 2:50 pm

Re: IF Action

Post by bazsi44 »

Image


so this is the situtation. when i click the ">" sign, the six icon on desktop becomes hidden, and another six become visible (same position, like these six).

and if i click the "<" sign, the currently six icon becomes hidden again, and the first six icons become visible again.

but. the other way, when i click the "<" the six visible icon becomes hidden, and another six icon become visible.
and in this situation, when i click the ">" the currently icons becomes hidden, and the original six becomes visible.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: IF Action

Post by jsmorley »

My previous reply should do the trick, just use specific X and Y settings for all the meters instead of using "R" to make them "relative".

In general though, I think !ToggleMeter should be the tool for this. It saves a lot of setting variables with "MeterxVisibleState=" and such, then Calc measures to do IfxxxxAction to figure out what to show and hide.

This will become exponentially harder if it is more than two "sets" of icons though.
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: IF Action

Post by Kaelri »

You might also want to use !ToggleMeterGroup to simplify your bangs a little.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: IF Action

Post by jsmorley »

Kaelri wrote:You might also want to use !ToggleMeterGroup to simplify your bangs a little.
Agreed. My original response was based on the simple example given. Kaelri is right that using groups is going to make for much shorter and cleaner action statements in your real world skin.
bazsi44
Posts: 12
Joined: May 2nd, 2011, 2:50 pm

Re: IF Action

Post by bazsi44 »

I don't really understand... :oops:

please write me the full code!
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: IF Action

Post by jsmorley »

What part don't you understand? I'll be glad to explain anything you don't get, but I sure am not going to write your entire skin for you.
bazsi44
Posts: 12
Joined: May 2nd, 2011, 2:50 pm

Re: IF Action

Post by bazsi44 »

I am a beginner. sorry. and my english also very bad. now i have to go. :\ i still write later, and thanks for your time!
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: IF Action

Post by jsmorley »

Here is a working example that is more like what you have in mind:

Code: Select all

[Rainmeter]
Update=500
DynamicWindowSize=1

[Metadata]
Name=
Config=
Description=
Instructions=
Version=
License=

[App1]
Group=Group1
Meter=Image
ImageName=Images\App1.png
W=64
H=64
X=60
Y=30
LeftMouseUpAction=!Execute ["C:\Program Files\Apps\App1.exe"]

[App2]
Group=Group1
Meter=Image
ImageName=Images\App2.png
W=64
H=64
X=80
Y=80
LeftMouseUpAction=!Execute ["C:\Program Files\Apps\App2.exe"]

[App3]
Group=Group2
Meter=Image
ImageName=Images\App3.png
W=64
H=64
X=60
Y=30
LeftMouseUpAction=!Execute ["C:\Program Files\Apps\App3.exe"]
Hidden=1

[App4]
Group=Group2
Meter=Image
ImageName=Images\App4.png
W=64
H=64
X=80
Y=80
LeftMouseUpAction=!Execute ["C:\Program Files\Apps\App4.exe"]
Hidden=1

[LeftButton]
Meter=String
X=0
Y=60
FontSize=15
FontColor=255,255,255,255
SolidColor=0,0,0,1
StringStyle=Bold
AntiAlias=1
Text=<<
LeftMouseUpAction=!Execute [!ToggleMeterGroup Group1][!ToggleMeterGroup Group2]

[RightButton]
Meter=String
X=170
Y=60
FontSize=15
FontColor=255,255,255,255
SolidColor=0,0,0,1
StringStyle=Bold
AntiAlias=1
Text=>>
LeftMouseUpAction=!Execute [!ToggleMeterGroup Group2][!ToggleMeterGroup Group1]
TestToggle.rmskin
TestToggle.png
You do not have the required permissions to view the files attached to this post.