It is currently March 28th, 2024, 8:08 pm

How to open a measure from a diff config

Get help with creating, editing & fixing problems with skins
peteneedshelp69
Posts: 4
Joined: April 5th, 2019, 11:18 am

How to open a measure from a diff config

Post by peteneedshelp69 »

Yow guys Im new here at this forum so if there is any easy way to present you my problem please help me.

What I want to do is have a button on my config1 that will open a config2 (while config1 is still active) and hide that button. then on config 2 there will be another button that will hide the config2 then the button will showup from config1.

What I have is this:

config1:
bla bla bla stuff here and there..,
[Button]
Meter=Image
ImageName=button
x=60
y=(#workareaheight#-90)
DynamicVariables=1

LeftMouseDownAction=[!ActivateConfig "folder\subfolder1" "config2.ini"]


==Then config2 will show up without making the cofig1 disappear but only the button from config1==

config2:
bla bla bla..,
[Button]
Meter=Image
ImageName=button2
x=85
y=(#workareaheight#-90)
DynamicVariables=1

LeftMouseDownAction=[!DeactivateConfig "Folder\subfolder2" "config2.ini"]

==config2 disappears then the button from config1 reappears==


I was thinking of writing a command next to the Leftmousedownaction like, LeftMouseDownAction=[!DeactivateConfig "Folder\subfolder2" "config2.ini"][!show measure from config1] but I dont know if that will work and I dont know what commands to use.

I kinda want this to happen or if there is any alternative to make this happen. I am struggling to make toggle work coz I really dont know what the commands are. and also, what I want to achieve here is a good fade in fade out transition and button image change. so I try to make it in 2 different configs so the transition is smooth.

I hope you get what I mean by those and thanks in advance for the help.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to open a measure from a diff config

Post by balala »

peteneedshelp69 wrote: April 5th, 2019, 11:36 am What I want to do is have a button on my config1 that will open a config2 (while config1 is still active) and hide that button. then on config 2 there will be another button that will hide the config2 then the button will showup from config1.
Activating config2.ini is ok, but this won't hide the button. To do this, add a !HideMeter bang to the LeftMouseDownAction option of the [Button] meter, contained into config1:

Code: Select all

[Button]
...
LeftMouseDownAction=[!ActivateConfig "folder\subfolder1" "config2.ini"][!HideMeter "#CURRENTSECTION#"][!Redraw]
With the LeftMouseDownAction option of config2, beside deactivating the skin, you also have to show up the button. but this button is into another skin, so it's a bit tricky to show it up, but not impossible. Modify the LeftMouseDownAction option of the [Button] meter of config2, as it follows:

Code: Select all

[Button]
...
LeftMouseDownAction=[!DeactivateConfig "Folder\subfolder2" "config2.ini"][!HideMeter "Button" "folder\subfolder1"]
Note the last parameter of the above !HideMeter bang, which indicates what skin is placed the meter you have hide, when you click the button.
peteneedshelp69
Posts: 4
Joined: April 5th, 2019, 11:18 am

Re: How to open a measure from a diff config

Post by peteneedshelp69 »

Thanks for the response

balala wrote: April 5th, 2019, 12:01 pm

Code: Select all

[Button]
...
LeftMouseDownAction=[!DeactivateConfig "Folder\subfolder2" "config2.ini"][!HideMeter "Button" "folder\subfolder1"]
Note the last parameter of the above !HideMeter bang, which indicates what skin is placed the meter you have hide, when you click the button.
I cant seem to make this last code work as I dont get the "what skin is placed the meter you have hide"
What is the skin, is it the png image?
so this is my code for config 1 button

Code: Select all

[Button]
Meter=Image
ImageName=#@#button
x=60
y=(#workareaheight#-90)
DynamicVariables=1

LeftMouseDownAction=[!ActivateConfig "Appdrawer\apps" "apps.ini"][!HideMeter "#CURRENTSECTION#"][!Redraw]
I didnt change the text currentsection coz im not sure if im suppose to change it or thats the actual code haha.

and this is my code for config2 button

Code: Select all

[Button2]
Meter=Image
ImageName=#@#button2
x=85
y=(#workareaheight#-90)
DynamicVariables=1
 
LeftMouseDownAction=[!DeactivateConfig "Appdrawer\apps" "apps.ini"][!HideMeter "button" "Appdrawer\SideBar" "SideBar.ini"]
So, config 1 is contain inside the SideBar subfolder
and config2 is contain inside the apps subfolder

Images of the buttons are both in @resources folder. note that there are 2 different pictures of buttons named button and button2.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to open a measure from a diff config

Post by balala »

peteneedshelp69 wrote: April 6th, 2019, 1:55 am What is the skin, is it the png image?
No. The skin is practically the .ini file, which has to be loaded into Rainmeter, to get it to work (to get it to show the time, for example if it's a clock - this is an example, obviously). Details: https://docs.rainmeter.net/manual/getting-started/#WhatIsASkin
peteneedshelp69 wrote: April 6th, 2019, 1:55 am

Code: Select all

[Button2]
...
LeftMouseDownAction=[!DeactivateConfig "Appdrawer\apps" "apps.ini"][!HideMeter "button" "Appdrawer\SideBar" "SideBar.ini"]
Three problems here:
  • The !DeactivateConfig bang (unlike !ActivateConfig) doesn't need two parameters. It needs only the config name (in this case "Appdrawer\apps"). The File name isn't required (needed) (in this case "apps.ini" is not needed), because since from a config (from a folder) only one skin (.ini file) can be loaded, when you're deactivating the config (unloading the skin), Rainmeter knows what it has to unload. When activating (loading) a skin, the file name is required, because in the config can be more skins, so Rainmeter can't decide which one you would like to load. So, correctly the above !DecativateConfig bangs would be [!DeactivateConfig "Appdrawer\apps"].
  • If you want to hide a meter contained into another skin that the current one, you have to say which config that meter is located into, but not the file name, too. So, the "SideBar.ini" filename is again not needed into the !HideMeter bang, which correctly is [!HideMeter "button" "Appdrawer\SideBar"].
  • Instead of LeftMouseDownAction, is much more indicated to use LeftMouseUpAction. Here you can find out why.
All this being said, please pack the whole config you have (Appdrawer) and upload it. It is much more simpler to help if I have the whole needed files and resources.
peteneedshelp69
Posts: 4
Joined: April 5th, 2019, 11:18 am

Re: How to open a measure from a diff config

Post by peteneedshelp69 »

I have uploaded the appdrawer skin.

I tried to fix the three problems but still aint working. or im just doing it wrong.
You do not have the required permissions to view the files attached to this post.
peteneedshelp69
Posts: 4
Joined: April 5th, 2019, 11:18 am

Re: How to open a measure from a diff config

Post by peteneedshelp69 »

balala wrote: April 6th, 2019, 10:17 am [/Snippet] filename is again not needed into the !HideMeter bang, which correctly is [!HideMeter "button" "Appdrawer\SideBar"].
Now I see the problem why it doesnt work. Its supposed to be ShowMeter hahahahaha. Got it fixed man. thanks alot for your help
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to open a measure from a diff config

Post by balala »

peteneedshelp69 wrote: April 6th, 2019, 2:38 pm Now I see the problem why it doesnt work. Its supposed to be ShowMeter hahahahaha. Got it fixed man.
So, have you got it working now as intended? If you have, here are a few more tips:
  • Instead of using the exact config name, if you want to deactivate the current config, you can use the #CURRENTCONFIG# variable into the LeftMouseUpAction option of the [Button2] meter of the apps.ini skin. Replace the LeftMouseUpAction=[!DeactivateConfig "Appdrawer\apps"][!HideMeter "button" "Appdrawer\SideBar"] option with LeftMouseUpAction=[!DeactivateConfig "#CURRENTCONFIG#"][!HideMeter "button" "Appdrawer\SideBar"].
  • !Execute is a deprecated bang. Don't use it, simply remove all its occurrences (for example in the LeftMouseDownAction options of [Text1] - [Text10] meters of apps.ini).
  • As i previously said, it's better to use LeftMouseUpAction instead of LeftMouseDownAction (see above).
  • When you're setting new values for variables (with !SetVariable bangs) or options (with !SetOption bangs), it's always a good idea to include those values you have to set into quotations. Especially if they are strings. For example into the MouseOverAction and MouseLeaveAction options of the [Text1] meter of apps.ini, use the quotations as indicated below:

    Code: Select all

    [Text1]
    ...
    MouseOverAction=[!SetOption Text1 FontColor "#Color3#"][!SetOption Bar1 Hidden "0"][!Update]
    MouseLeaveAction=[!SetOption Text1 FontColor "#Color#"][!SetOption Bar1 Hidden "1"][!Update]
    Details: https://forum.rainmeter.net/viewtopic.php?f=5&t=26350&p=137628&hilit=quote+enclose+option#p137628
  • The path separator character in Windows is backslash (\), not slash (/). You've used slashes into a lot of options, like ImageName of [Bar1] - [Bar10]. Replace ImageName=#@#Images/Background/Bar.png with ImageName=#@#Images\Background\Bar.png.
  • Although once the Author option belonged to the [Rainmeter] section, a while ago it was moved to [Metadata]. You also should have to move it.