It is currently April 19th, 2024, 6:57 am

[SOLVED] Help: Honeycomb Recycle Bin Switching Images(empty to full)

Get help with creating, editing & fixing problems with skins
User avatar
AlienLP
Posts: 5
Joined: December 19th, 2019, 7:21 pm

[SOLVED] Help: Honeycomb Recycle Bin Switching Images(empty to full)

Post by AlienLP »

Hello,
I'm new to Rainmeter and I'm trying to find a way to switch my recycle bin honeycomb skin icon between the full and empty images. I tried to look up as many options in the forum already but nothing worked. I'm using this code I found online for my bin and it works just fine but simply wouldn't alternated between empty and full. Both my images are in the resources. Here's my code:

Code: Select all

[Rainmeter]
Update = 1000
[MetaData]
Author = Dunno
Version =
-------------------Bin measure---------------------
[MeasureBin]
Measure=plugin
Plugin=RecycleManager.dll
RecycleType=Count

IfCondition=Count = 0
IfActionTrue = [!SetOption MeterImage ImageName "#@#Images\BinE.png"][!SetOption MeterBinSize FontSize 0][!Redraw][!SetOption MeterImage RightMouseUpAction !Log]

IfActionFalse = [!SetOption MeterImage ImageName "#@#Images\BinF.png"][!SetOption MeterBinSize FontSize 0][!Redraw][!SetOption MeterImage RightMouseUpAction [!CommandMeasure MeasureBin EmptyBin]]
-------------------Button meter--------------------
[MeterImage]
Meter=Image
ImageName=#@#Images\BinE.png

H=90
LeftMouseUpAction=!CommandMeasure MeasureBin OpenBin
RightMouseUpAction=!CommandMeasure MeasureBin EmptyBin
Last edited by AlienLP on December 19th, 2019, 10:24 pm, edited 1 time in total.
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help: Honeycomb Recycle Bin Switching Images(empty to full)

Post by balala »

AlienLP wrote: December 19th, 2019, 7:54 pm I'm using this code I found online for my bin and it works just fine but simply wouldn't alternated between empty and full.
First replace the IfCondition option of the [MeasureBin] measure with IfCondition=(MeasureBin=0) because you can't use the Count function (parameter, whatever) into IfCondition, just in RecycleType option. In an IfCondition you have to use the measure or variable which you wanna check.
Beside this:
  • An IfActionTrue and IfActionFalse options don't exist. They are IfTrueAction, respectively IfFalseAction. Replace them accordingly. If using IfActionTrue and IfActionFalse no wonder they don't work, because Rainmeter doesn't recognize them.
  • More of the bangs used into the above two options are not correctly used. For instance not sure what was your intention with the last bangs of both options ([!SetOption MeterImage RightMouseUpAction !Log] and [!SetOption MeterImage RightMouseUpAction [!CommandMeasure MeasureBin EmptyBin]]), but I suppose you want to set some actions for the RightMouseUpAction option of the [MeterImage] meter, right? If so, an important thing you have to take into account is that especially if the parameter you wanna set contains spaces, quotations are absolutely needed, otherwise the parameter won't be properly set. So the above two bangs should be: [!SetOption MeterImage RightMouseUpAction "!Log"] and [!SetOption MeterImage RightMouseUpAction "[!CommandMeasure MeasureBin EmptyBin]"] (however still can't say what is your intention with [!SetOption MeterImage RightMouseUpAction "!Log"], because the !Log bang requires at least one parameter, the string you want to show in log).
  • Don't set the font size of a string meter to 0. Doesn't make sense. You have to use a "normal" size. Bellow I set 10 in both options, but I'm not sure what value do you want to set, so modify the values accordingly.
  • Although not absolutely necessary, is it a very good idea to update the meters which you modify through some !SetOption bangs, so you should add a [!UpdateMeter "MeterImage"] and a [!UpdateMeter "MeterBinSize"] bangs to both options, besides the existing [!Redraw].
Taking into account the above, the two options should be:

Code: Select all

[MeasureBin]
...
IfCondition=(MeasureBin=0)
IfActionTrue = [!SetOption MeterImage ImageName "#@#Images\BinE.png"][!SetOption MeterImage RightMouseUpAction "!Log Something"]
[!SetOption MeterBinSize FontSize "10"][!UpdateMeter "MeterImage"][!UpdateMeter "MeterBinSize"][!Redraw]
IfActionFalse = [!SetOption MeterImage ImageName "#@#Images\BinF.png"][!SetOption MeterImage RightMouseUpAction "[!CommandMeasure MeasureBin EmptyBin]"][!SetOption MeterBinSize FontSize "10"][!UpdateMeter "MeterImage"][!UpdateMeter "MeterBinSize"][!Redraw]
User avatar
AlienLP
Posts: 5
Joined: December 19th, 2019, 7:21 pm

Re: Help: Honeycomb Recycle Bin Switching Images(empty to full)

Post by AlienLP »

balala wrote: December 19th, 2019, 8:48 pm First replace the IfCondition option of the [MeasureBin] measure with IfCondition=(MeasureBin=0) because you can't use the Count function (parameter, whatever) into IfCondition, just in RecycleType option. In an IfCondition you have to use the measure or variable which you wanna check.
Beside this:
  • An IfActionTrue and IfActionFalse options don't exist. They are IfTrueAction, respectively IfFalseAction. Replace them accordingly. If using IfActionTrue and IfActionFalse no wonder they don't work, because Rainmeter doesn't recognize them.
  • More of the bangs used into the above two options are not correctly used. For instance not sure what was your intention with the last bangs of both options ([!SetOption MeterImage RightMouseUpAction !Log] and [!SetOption MeterImage RightMouseUpAction [!CommandMeasure MeasureBin EmptyBin]]), but I suppose you want to set some actions for the RightMouseUpAction option of the [MeterImage] meter, right? If so, an important thing you have to take into account is that especially if the parameter you wanna set contains spaces, quotations are absolutely needed, otherwise the parameter won't be properly set. So the above two bangs should be: [!SetOption MeterImage RightMouseUpAction "!Log"] and [!SetOption MeterImage RightMouseUpAction "[!CommandMeasure MeasureBin EmptyBin]"] (however still can't say what is your intention with [!SetOption MeterImage RightMouseUpAction "!Log"], because the !Log bang requires at least one parameter, the string you want to show in log).
  • Don't set the font size of a string meter to 0. Doesn't make sense. You have to use a "normal" size. Bellow I set 10 in both options, but I'm not sure what value do you want to set, so modify the values accordingly.
  • Although not absolutely necessary, is it a very good idea to update the meters which you modify through some !SetOption bangs, so you should add a [!UpdateMeter "MeterImage"] and a [!UpdateMeter "MeterBinSize"] bangs to both options, besides the existing [!Redraw].
Taking into account the above, the two options should be:

Code: Select all

[MeasureBin]
...
IfCondition=(MeasureBin=0)
IfActionTrue = [!SetOption MeterImage ImageName "#@#Images\BinE.png"][!SetOption MeterImage RightMouseUpAction "!Log Something"]
[!SetOption MeterBinSize FontSize "10"][!UpdateMeter "MeterImage"][!UpdateMeter "MeterBinSize"][!Redraw]
IfActionFalse = [!SetOption MeterImage ImageName "#@#Images\BinF.png"][!SetOption MeterImage RightMouseUpAction "[!CommandMeasure MeasureBin EmptyBin]"][!SetOption MeterBinSize FontSize "10"][!UpdateMeter "MeterImage"][!UpdateMeter "MeterBinSize"][!Redraw]
Thank you so much for helping! I honestly don't know much about coding. I have no idea what the !Log is for and why it is included there by the author. I just simply wanted a functional bin with Honeycomb. I tried replacing it with your guidance and your code but it still won't alternated between empty and full image unfortunately. I want my to be able to OpenBin on left click and EmptyBin on right click and also be able to see a full bin image when there's a file in it. That's it. Sorry, if i'm repeating myself . If you could come up with a code that I can just copy and paste and make all of that work that would be super!
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help: Honeycomb Recycle Bin Switching Images(empty to full)

Post by balala »

AlienLP wrote: December 19th, 2019, 9:16 pm Sorry, if i'm repeating myself . If you could come up with a code that I can just copy and paste and make all of that work that would be super!
Don't worry, you're not repeating yourself at all. The following code works only if in the @Resources\Images folder the BinE.png and BinF.png images exist:

Code: Select all

[Rainmeter]
Update=1000

[MetaData]
Author=Dunno

[MeasureBin]
Measure=Plugin
Plugin=RecycleManager
RecycleType=Count
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!SetOption MeterImage ImageName "#@#Images\BinE.png"][!SetOption MeterImage RightMouseUpAction """[!Log "Empty Bin"]"""][!UpdateMeter "MeterImage"][!Redraw]
IfFalseAction=[!SetOption MeterImage ImageName "#@#Images\BinF.png"][!SetOption MeterImage RightMouseUpAction "[!CommandMeasure MeasureBin EmptyBin]"][!Redraw]

[MeterImage]
Meter=Image
H=90
LeftMouseUpAction=[!CommandMeasure MeasureBin OpenBin]
Does this work?
User avatar
AlienLP
Posts: 5
Joined: December 19th, 2019, 7:21 pm

Re: Help: Honeycomb Recycle Bin Switching Images(empty to full)

Post by AlienLP »

balala wrote: December 19th, 2019, 9:41 pm Don't worry, you're not repeating yourself at all. The following code works only if in the @Resources\Images folder the BinE.png and BinF.png images exist:

Code: Select all

[Rainmeter]
Update=1000

[MetaData]
Author=Dunno

[MeasureBin]
Measure=Plugin
Plugin=RecycleManager
RecycleType=Count
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!SetOption MeterImage ImageName "#@#Images\BinE.png"][!SetOption MeterImage RightMouseUpAction """[!Log "Empty Bin"]"""][!UpdateMeter "MeterImage"][!Redraw]
IfFalseAction=[!SetOption MeterImage ImageName "#@#Images\BinF.png"][!SetOption MeterImage RightMouseUpAction "[!CommandMeasure MeasureBin EmptyBin]"][!Redraw]

[MeterImage]
Meter=Image
H=90
LeftMouseUpAction=[!CommandMeasure MeasureBin OpenBin]
Does this work?
Oh it worked! I just needed to add ImageName=#@#Images\BinE.png to your code! Omg! Thank you so much! :thumbup:
Last edited by AlienLP on December 19th, 2019, 10:00 pm, edited 2 times in total.
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help: Honeycomb Recycle Bin Switching Images(empty to full)

Post by balala »

AlienLP wrote: December 19th, 2019, 9:47 pm I just needed to add ImageName=#@#Images\BinE.png to your code!
You mean to the [MeterImage] meter? Not needed, because the name of the image is set by the !SetOption bangs of the IftrueAction and IfFalseAction options of the [MeasureBin] measure.
I'm glad if you got it working as wanted.
User avatar
AlienLP
Posts: 5
Joined: December 19th, 2019, 7:21 pm

Re: Help: Honeycomb Recycle Bin Switching Images(empty to full)

Post by AlienLP »

balala wrote: December 19th, 2019, 9:56 pm You mean to the [MeterImage] meter? Not needed, because the name of the image is set by the !SetOption bangs of the IftrueAction and IfFalseAction options of the [MeasureBin] measure.
I'm glad if you got it working as wanted.
Yep, I don't know why but the icon won't appeared unless I added that :confused: . Oh I'm also curious if there's a coding line that can possibly allowed me to drag and drop a file on the bin icon like the normal Recycle Bin?
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help: Honeycomb Recycle Bin Switching Images(empty to full)

Post by balala »

AlienLP wrote: December 19th, 2019, 10:00 pm Oh I'm also curious if there's a coding line that can possibly allowed me to drag and drop a file on the bin icon like the normal Recycle Bin?
Not simply. Don't recommend, especially if you're a beginner.
User avatar
AlienLP
Posts: 5
Joined: December 19th, 2019, 7:21 pm

Re: Help: Honeycomb Recycle Bin Switching Images(empty to full)

Post by AlienLP »

balala wrote: December 19th, 2019, 10:20 pm Not simply. Don't recommend, especially if you're a beginner.
Alright then, thanks for your help anyways :) Have a great day!
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help: Honeycomb Recycle Bin Switching Images(empty to full)

Post by balala »

AlienLP wrote: December 19th, 2019, 10:22 pm Alright then, thanks for your help anyways :) Have a great day!
Well, in fact it's not completely impossible, a while ago a plugin having such purposes has been posted, being developed by theAzack9.
I'm not currently using this plugin, so even if I tried it out once, I'm not sure I can help you with this. But if interested, for sure here on the forum someone will help you to get it properly working.