It is currently April 25th, 2024, 9:29 am

Cycling through Mouse Actions

Get help with creating, editing & fixing problems with skins
User avatar
BlackChadhar
Posts: 35
Joined: March 4th, 2023, 8:16 am

Re: Cycling through Mouse Actions

Post by BlackChadhar »

balala wrote: March 8th, 2023, 11:07 am There are some other solutions as well, for instance by using the !SetVariableGroup bang, which can dynamically set value for the variable into all skins belonging to a group. This also could avoid the need of refreshes. If you are interested please let me know.
Oh yeah! The group is another feature I was looking forward to understanding. What does group mean in Rainmeter? Like what exactly can it group and what can be its use? I have seen skin files using group but didn't know much about it so never messed with it.
User avatar
balala
Rainmeter Sage
Posts: 16168
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Cycling through Mouse Actions

Post by balala »

BlackChadhar wrote: March 8th, 2023, 5:06 pm Created an extra reply by mistake. Ignore this lol. Couldn't delete or figure out how to.
Plain users can't delete, not even their own posts. I removed it for you.
BlackChadhar wrote: March 8th, 2023, 5:05 pm Oh yeah! The group is another feature I was looking forward to understanding. What does group mean in Rainmeter? Like what exactly can it group and what can be its use? I have seen skin files using group but didn't know much about it so never messed with it.
There are more possibilities to define groups:
  • A group of meters or measures can be defined by adding a Group=MyGroup option to each of the meters or measures which you want to include into the group. Note that it's a good idea to use different names for a group of meters and a group of measures. Even if not forbidden, it proved to be a not too good idea, to use the same name for these groups. However this time not this is our goal...
  • A group of skins can be defined by adding a Group=MySkinGroup option to the [Rainmeter] section of all skins you want to belong to the group. Alternatively you can add this option to the appropriate Skin sections of the Rainmeter.ini file (however in my opinion it's much easier to add those options to the [Rainmeter] section of the skins). This is what we need for this time.
If you created such a group, including all skins which should have to use the Colour variable (which is set by the !SetVariable bang), you can now extend the options setting a dynamic value for the Colour variable, to set this value for all skins belonging to the group. For this you have to replace the !SetVariable bangs, by !SetVariableGroup: for instance the [!SetVariable Colour "#Hover#"] bang should be rewritten as [!SetVariableGroup Colour "#Hover#" "MySkinGroup"]. You also can update and redraw all skins belonging to the group (by using the [!UpdateGroup "MySkinGroup"] and [!RedrawGroup "MySkinGroup"] bangs). You have to modify this way all !SetVariable bangs of your skin, but if you do this, there will be no needed anymore to:
  • Write the value of the variable by a !WriteKeyValue bang.
  • Refresh the skin(s).
User avatar
BlackChadhar
Posts: 35
Joined: March 4th, 2023, 8:16 am

Re: Cycling through Mouse Actions

Post by BlackChadhar »

balala wrote: March 8th, 2023, 7:20 pm Plain users can't delete, not even their own posts. I removed it for you.
I see. Ty <3
balala wrote: March 8th, 2023, 7:20 pm There are more possibilities to define groups:
There are more possibilities to define groups:
  • A group of meters or measures can be defined by adding a Group=MyGroup option to each of the meters or measures which you want to include into the group. Note that it's a good idea to use different names for a group of meters and a group of measures. Even if not forbidden, it proved to be a not too good idea, to use the same name for these groups. However this time not this is our goal...
  • A group of skins can be defined by adding a Group=MySkinGroup option to the [Rainmeter] section of all skins you want to belong to the group. Alternatively you can add this option to the appropriate Skin sections of the Rainmeter.ini file (however in my opinion it's much easier to add those options to the [Rainmeter] section of the skins). This is what we need for this time.
Can I have a group of meters and measures from different skins ? Group=MyGroup is used to create a group of different meters and measures from a skin whereas Group=MySkinGroup is used to create groups of entire skins and not a part of it right ?
Lets say for these 2 skins listed below(none of these skins are mine, M just editing them for myself) :

Code: Select all

[Variables]
@include=#@#Setting.inc

[SPOTIFY]
Meter=Image
ImageName=#@#Images\spotify.png
ImageTint=#Colour#
H=#Dimensions#
LeftMouseUpAction=["%AppData%\Spotify\Spotify.exe"]
MouseOverAction=[!SetOption #CURRENTSECTION# ImageTint "#Hover#"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# ImageTint "#Colour#"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
DynamicVariables=1

[Rainmeter]
Update=1000

[Metadata]
Name=Spotify
Author=Budif
Information=
License=
Version=

Code: Select all

[Variables]
@include=#@#Setting.inc

[Recycle_Bin]
Meter=Image
ImageName=#@#Images\Recycle Bin.png
ImageTint=#Colour#
H=#Dimensions#
LeftMouseUpAction=["shell:RecycleBinFolder"]
MouseOverAction=[!SetOption #CURRENTSECTION# ImageTint "#Hover#"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# ImageTint "#Colour#"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
DynamicVariables=1

[Rainmeter]
Update=1000

[Metadata]
Name=Recycle bin
Author=Budif
Information=
License=
Version=
How do I make a group of meters [SPOTIFY][Recycle_Bin] from the 1st and 2nd skins respectively ?
User avatar
balala
Rainmeter Sage
Posts: 16168
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Cycling through Mouse Actions

Post by balala »

BlackChadhar wrote: March 9th, 2023, 1:28 pm Can I have a group of meters and measures from different skins ?
You can have group of meters or measures on different skins, they can even have the same name, but these groups have nothing to do with each other. This means that if you want to apply a meter group bang to both groups into the both skins, you have to add two bangs.
For instance: let's say you add a Group=Spotify option to both meters of the two skins ([SPOTIFY] from first code and [Recycle_Bin] from the second one). If you want to update both these groups and redraw both skins from a third skin, you have to use the following bangs: [!UpdateMeterGroup "Spotify" "FirstConfig"][!UpdateMeterGroup "Spotify" "SecondConfig"][!Redraw "FirstConfig"][!Redraw "SecondConfig"]. As you probably figured this out:
  • The first bang [!UpdateMeterGroup "Spotify" "FirstConfig"] updates the meters of Spotify group, from the first skin.
  • [!UpdateMeterGroup "Spotify" "SecondConfig"] does the same for the meters of Spotify group, of the second skin.
  • [!Redraw "FirstConfig"] redraws the first skin.
  • Obviously [!Redraw "SecondConfig"] redraws the second skin.
If you add a Group=MyGroupOfSkins option to the [Rainmeter] section of both codes, you can easier redraw the skins, because this time the two skins are included into a group of skins (MyGroupOfSkins) and as such, they can be redrawn by one. This way you can replace the two !Redraw bangs by a single !RedrawGroup: [!UpdateMeterGroup "Spotify" "FirstConfig"][!UpdateMeterGroup "Spotify" "SecondConfig"][!RedrawGroup "MyGroupOfSkins"]. This time you won't redraw the skins one by one, but will redraw the group, which means you are redrawing the skins belonging to the group, by one.
Besides others, there are bangs to work with: If you have to set the same value for the same variable into all skins belonging to the MyGroupOfSkins group, this can easily be done by the !SetVariableGroup bang. By the [!SetVariableGroup Colour "255,240,0" "MyGroupOfSkins"] bang, you're setting the 255,240,0 value for all Colour variables, in all skins belonging to the MyGroupOfSkins group (obviously only the activated skins will get this value for the variable).
User avatar
BlackChadhar
Posts: 35
Joined: March 4th, 2023, 8:16 am

Re: Cycling through Mouse Actions

Post by BlackChadhar »

balala wrote: March 9th, 2023, 4:53 pm You can have group of meters or measures on different skins, they can even have the same name, but these groups have nothing to do with each other. This means that if you want to apply a meter group bang to both groups into the both skins, you have to add two bangs.
For instance: let's say you add a Group=Spotify option to both meters of the two skins ([SPOTIFY] from first code and [Recycle_Bin] from the second one). If you want to update both these groups and redraw both skins from a third skin, you have to use the following bangs: [!UpdateMeterGroup "Spotify" "FirstConfig"][!UpdateMeterGroup "Spotify" "SecondConfig"][!Redraw "FirstConfig"][!Redraw "SecondConfig"].
I see. This is exactly what I was confused about. You can have similar groups in different skins but not one group for meters from different skins, right? Like I cannot have a meter from 1st skin and another meter from 2nd skin in one single group. The skins that I currently have only 1 meter in them so MeterGroup won't be of much help. SkinGroup can optimize stuff though. Will definitely work around with the group feature. Thanks for the info <3
User avatar
balala
Rainmeter Sage
Posts: 16168
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Cycling through Mouse Actions

Post by balala »

BlackChadhar wrote: March 9th, 2023, 6:09 pm I see. This is exactly what I was confused about. You can have similar groups in different skins but not one group for meters from different skins, right? Like I cannot have a meter from 1st skin and another meter from 2nd skin in one single group.
You are right.
BlackChadhar wrote: March 9th, 2023, 6:09 pm The skins that I currently have only 1 meter in them so MeterGroup won't be of much help.
Well, in fact in some cases the group can be extremely useful. The greatest difference between working with the name of the meter (or measure) and including it / them to a group and working with the group, is that if you're working with the name of the meter (or measure) and that meter / measure doesn't exist (has other name than the used one), you immediately get an error in the log. However if you're working with groups, whatever you do with a group, get no error in log, not even if the group doesn't exist / there are no meters / measures belonging to the group.
BlackChadhar wrote: March 9th, 2023, 6:09 pm SkinGroup can optimize stuff though.
Definitely right, again.
User avatar
BlackChadhar
Posts: 35
Joined: March 4th, 2023, 8:16 am

Re: Cycling through Mouse Actions

Post by BlackChadhar »

balala wrote: March 9th, 2023, 6:58 pm Well, in fact in some cases the group can be extremely useful. The greatest difference between working with the name of the meter (or measure) and including it / them to a group and working with the group, is that if you're working with the name of the meter (or measure) and that meter / measure doesn't exist (has other name than the used one), you immediately get an error in the log. However if you're working with groups, whatever you do with a group, get no error in log, not even if the group doesn't exist / there are no meters / measures belonging to the group.
I see. There is a log thing in Rainmeter ? That's news to me. Where do I find it ? Having logs will make finding errors way more easier.
User avatar
balala
Rainmeter Sage
Posts: 16168
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Cycling through Mouse Actions

Post by balala »

BlackChadhar wrote: March 10th, 2023, 8:11 am I see. There is a log thing in Rainmeter ? That's news to me. Where do I find it ?
Yep, there is. It's on the About Rainmeter dialog (which can be opened by clicking About, in the context menu of the Rainmeter icon in the Notification Area).
BlackChadhar wrote: March 10th, 2023, 8:11 am Having logs will make finding errors way more easier.
Definitely. When you write a skin, it's always a good idea to get a look to the log, because it can reveal lot of errors, which you couldn't even realize they are present.
User avatar
BlackChadhar
Posts: 35
Joined: March 4th, 2023, 8:16 am

Re: Cycling through Mouse Actions

Post by BlackChadhar »

balala wrote: March 10th, 2023, 4:19 pm Yep, there is. It's on the About Rainmeter dialog (which can be opened by clicking About, in the context menu of the Rainmeter icon in the Notification Area).
I see. Thank you so much for all the help <3
User avatar
balala
Rainmeter Sage
Posts: 16168
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Cycling through Mouse Actions

Post by balala »

BlackChadhar wrote: March 11th, 2023, 5:06 am I see. Thank you so much for all the help <3
You're welcome. Feel free to came back anytime further questions arise.