It is currently September 19th, 2021, 1:45 am

Recycle Bin

Help with creating, editing & fixing problems with skins
User avatar
sl23
Posts: 806
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Recycle Bin

Post by sl23 »

I have a couple of issues trying to get it to work how I want. The first is about ToolTips, the second is different and dependant on the first.

Ok, I have an Image Meter for the RB with a ToolTip. But I prefer to remove the Text for items and size of RB and have it as part of the Tooltip as well. Hover over RB icon to get:
Recycle Bin
L-click = Open
R-click = Empty


I'd like to display this:
Recycle Bin
30 items
974.3 MB

L-click = Open
R-click = Empty


My problem is that I'm using a Substitute command that doesn't work in the ToolTip. Is it possible to somehow make it work? I have tried several things, using IfCommands instead but it won't work. I assume it's not possible. However if someone knows different any advice would be great :thumbup:

If I add MeasureName= to the Image Meter it causes the image to disappear. But they're needed to display the Meter info???

Onto problem number two.

As I can't get the Tooltip to work, yet, I have a Meter showing the required info. The original code had Text=%1 items for the Meter. I used a Substitute= command to change "0 items" to "Empty", Which worked fine, or so I thought until the number reached 30 items! Now I get "3Empty" due to the substitute removing the 0 items text and replacing it with Empty. Is there a way around this problem? Again, I've tried IfCommands, which doesn't work at all no matter where I aim it at. I've also tried looking at the manual extensively to try and glean some info about text, strings, measures, meters, ifcommands, regexp's, and a ton of other stuff just to try and solve this!!!

But alas, I'm stumped and need the help of an expert :oops: if one is available and kind enough to help please :rosegift:

Here's my current code:

Code: Select all

;---------------------------------------------------------------------
; RECYCLE BIN
;---------------------------------------------------------------------
[Bin]
Meter=Image
ImageName=#@#Launchers\Bin Empty (orange)
LeftMouseUpAction=!Execute [!PluginBang "mBinItems OpenBin"]
RightMouseUpAction=!Execute [!PluginBang "mBinItems EmptyBin"]
ToolTipIcon=Info
ToolTipTitle="Recycle Bin"
ToolTipText="%1#CRLF#%2B#CRLF##CRLF#L-click = Open#CRLF#R-click = Empty"
X=12
Y=25r
W=34
H=34

[mBinItems]
Measure=Plugin
Plugin=RecycleManager.dll
RecycleType=Count
UpdateDivider=2
Substitute=".0":" items"
;,"0 items":"Empty"
IfCondition=BinInfo = 0
IfTrueAction=[!SetOption BinInfo Text Empty] [!UpdateMeter *] [!Redraw]
IfFalseAction=[!SetOption BinInfo Text %1#CRLF#%2B] [!UpdateMeter *] [!Redraw]
DynamicVariables=1

[mBinSize]
Measure=Plugin
Plugin=RecycleManager.dll
RecycleType=Size
UpdateDivider=2
Substitute=".0":""

[BinInfo]
Meter=String
MeasureName=mBinItems
MeasureName2=mBinSize
MeterStyle=sAllText | sHighlight
StringAlign=Right
Text="%1#CRLF#%2B"
LeftMouseUpAction=!Execute [!PluginBang "mBinItems OpenBin"]
RightMouseUpAction=!Execute [!PluginBang "mBinItems EmptyBin"]
ToolTipIcon=Info
ToolTipTitle="Recycle Bin"
ToolTipText="L-click = Open#CRLF#R-click = Empty"
AutoScale=1
X=103r
Y=0r
Thanks for your help
Last edited by sl23 on April 26th, 2014, 1:52 pm, edited 1 time in total.
User avatar
VasTex
Posts: 407
Joined: September 20th, 2012, 3:17 pm
Location: USA - Montana

Re: Recycle Bin

Post by VasTex »

Okay, well for starters there are several things that we need to fix in your code before we can start to understand what we need to change. I'll list them off as I see them and provide the best fix that I can think of as well as why it needs to change.

First off, this isn't required, but it's good practice to always have the [Rainmeter] Section at the top of your code. This is the best way to control the update rate of the entire skin as well as perform a few functions that can only be done in this section. This is how it should look at the very top of your skins code.

Code: Select all

[Rainmeter]
Update=1000
Second, you have several instances of the bang '!Execute' as well as the bang '!PluginBang' neither of which are needed anymore. These bangs have been deprecated and it is suggested that they not be used in newer skins. Removing them will, in no way, effect the function of your code.

That being said, there are other issues with your lines of code using those bangs. Take this line for example and I'll highlight the changes in Blue and the incorrect bits of code in Red.
LeftMouseUpAction=!Execute [!PluginBang "mBinItems OpenBin"] * Notice that the quotation marks are also in red.

This line of code should be changed to look like this instead:
LeftMouseUpAction=[!CommandMeasure "mBinItems" "OpenBin"] * Notice the change from !PluginBang to !CommandMeasure as well as the separation of mBinItems and OpenBin with the proper use of quotations.

By having your quote marks around both the mBinItems and OpenBin statements you were essentially telling Rainmeter to treat these two things as one thing. This will definitely cause some issues.

Now, on to some other issues I noticed. In the measure mBinItems you have this line:
IfCondition=BinInfo = 0
Normally this would be fine, except in your case BinInfo is NOT a measure. It is a meter and meters do not actually hold any values. They simply display them. So when the measure checks the value of BinInfo it will always fail and most likely always return the value of 0 by default. You need to change this line the reflect a measure with the corresponding value. In this case it appears that you should be measuring the value of the measure mBinItems.

So you'll need to change this measure here:

Code: Select all

[mBinItems]
Measure=Plugin
Plugin=RecycleManager.dll
RecycleType=Count
UpdateDivider=2
Substitute=".0":" items"
IfCondition=BinInfo = 0
IfTrueAction=[!SetOption BinInfo Text Empty] [!UpdateMeter *] [!Redraw]
IfFalseAction=[!SetOption BinInfo Text %1#CRLF#%2B] [!UpdateMeter *] [!Redraw]
DynamicVariables=1
To look like this measure here: *Notice the added quotes (These aren't needed, but they are good practice and can help you to avoid future headache):

Code: Select all

[mBinItems]
Measure=Plugin
Plugin=RecycleManager.dll
RecycleType=Count
IfCondition=mBinItems = 0
IfTrueAction=[!SetOption "BinInfo" "Text" "Empty"][!UpdateMeter *][!Redraw]
IfFalseAction=[!SetOption "BinInfo" "Text" "%1#CRLF#%2B"][!UpdateMeter *][!Redraw]
Substitute=".0":" items"
DynamicVariables=1
UpdateDivider=2
* I took the liberty of re-arranging a few of the lines of code in here as well (personal preference though. This has no impact on the functionality).

Okay, almost done! :thumbup:

A few more minor issues to clear up before we start to get this working for you. In the meter Bin you're using an image (Or a folder?) called "Bin Empty (Orange)". In this case it's possible that this code works for you, but it WILL cause issues in the future in you're not careful. For starters, you should always try and give the full path and the name of the image you're using unless you need it to function otherwise. If you only give the folder path and not the direct path including the image then the meter will always use the first image in that folder even if there are dozens of images in there. Second, we're going to want to use quotations here again. Having spaces in a folder path is the easiest way to break your code. Always enclose anything, whether it be a path or a bang, in quotes if it contains spaces.

So in this case you should change that line from this:
ImageName=#@#Launchers\Bin Empty (orange)

To this:
ImageName="#@#Launchers\Bin Empty (orange)"

Preferably to this if you can:
ImageName="#@#Launchers\Bin Empty (orange)\BinImage.png" * The added image name should be changed to reflect the name of the image you're using.

Alright so I know that I haven't answered your original question, but it will be much easier to continue from here now that we're set on using the correct code. This should help us to avoid any future confusion. That being said, I wasn't able to test your code at all since it relies on Styles that I don't have. You'll need to post those styles as well as the image you're using later on if you want me to able to help you as best I can.

Here's the code, cleaned up with all of the above changes with a few lines re-arranged here and there for my personal preferences. If you have any questions please ask.

Code: Select all

;=================================================
; Rainmeter Recycle Bin Configuration File
; Updated April 23, 2014
;=================================================
[Rainmeter]
Update=1000

[Variables]
;Nothing needs to be here unless you want to add variables.
;Adding variables can be a helpful and easy way to allow people
;to change colors and other settings from here without needing to 
;pick through the code to find the right lines.

;===  Measures  ===;

[mBinItems]
Measure=Plugin
Plugin=RecycleManager.dll
RecycleType=Count
IfCondition=mBinItems = 0
IfTrueAction=[!SetOption "BinInfo" "Text" "Empty"][!UpdateMeter *][!Redraw]
IfFalseAction=[!SetOption "BinInfo" "Text" "%1#CRLF#%2B"][!UpdateMeter *][!Redraw]
Substitute=".0":" items"
DynamicVariables=1
UpdateDivider=2

[mBinSize]
Measure=Plugin
Plugin=RecycleManager.dll
RecycleType=Size
Substitute=".0":""
UpdateDivider=2

;===  Meters  ===;

[Bin]
Meter=Image
ImageName="#@#Launchers\Bin Empty (orange)"
X=12
Y=25r
W=34
H=34
LeftMouseUpAction=[!CommandMeasure "mBinItems" "OpenBin"]
RightMouseUpAction=[!CommandMeasure "mBinItems" "EmptyBin"]
ToolTipTitle="Recycle Bin"
ToolTipText="%1#CRLF#%2B#CRLF##CRLF#L-click = Open#CRLF#R-click = Empty"
ToolTipIcon=Info

[BinInfo]
Meter=String
MeterStyle=sAllText | sHighlight
MeasureName=mBinItems
MeasureName2=mBinSize
X=103r
Y=0r
LeftMouseUpAction=[!CommandMeasure "mBinItems" "OpenBin"]
RightMouseUpAction=[!CommandMeasure "mBinItems" "EmptyBin"]
StringAlign=Right
Text="%1#CRLF#%2B"
ToolTipTitle="Recycle Bin"
ToolTipText="L-click = Open#CRLF#R-click = Empty"
ToolTipIcon=Info
AutoScale=1
01010100 01100101 01100011 01101000 01101110 01101111 01101100 01101111 01100111 01101001
01100011 01100001 01101100 00100000 01000010 01100001 01100100 01100001 01110011 01110011
User avatar
sl23
Posts: 806
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Recycle Bin

Post by sl23 »

Thanks for the advice I'll certainly need some time to go through with that. But to answer your first point, [Rainmeter] is at the top, I only pasted the RB section instead of the whole skin due to it's size of 1400 lines!

Anyway, thanks again, I''l look at it when I get time.
User avatar
jsmorley
Developer
Posts: 22283
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Recycle Bin

Post by jsmorley »

Getting values into a ToolTip is as simple as using %1, %2 etc. tied to MeasureName, MeasureName2 etc. on the meter, OR using a measure value as a section variable with [MeasureName] in the ToolTipText option.

[SomeMeter]
Meter=String
MeasureName=SomeMeasure
MeasureName2=SomeOtherMeasure
ToolTipText=First value is %1, second value is %2, third value is [YetAnotherMeasure]
DynamicVariables=1

However, ToolTipText does NOT obey the options for a String meter when it is being output. That means that you can't take advantage of things like Percentual=1 or StringCase=Proper or (important in this case) AutoScale=1. Tooltip is not a feature of the String meter, but can be used on any meter type.

One imperfect solution is to scale the number using a parameter on a [SectionVariable]. So you might use:

TooTipText=[SomeMeasure/1024]
DynamicVariables=1

That will scale the number by 1024. What it won't do however is "auto scale" the number to "B/kB/MB/GB/TB" as needed. Really not what you want at all with a value like the size of the recycle bin that can be very small or very large.

It is a tad tricky, but you can get there with code like this:

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1

;Kilobyte (kB) = 1024
;Megabyte (MB) = 1048576 or 1024**2
;Gigabyte (GB) = 1073741824 or 1024**3
;Terabyte (TB) = 1099511627776 or 1024**4

[Variables]
ItemPostFix="s"
ScaleFactor="B"

[MeasureBinCount]
Measure=Plugin
Plugin=RecycleManager
RecycleType=Count
IfCondition=MeasureBinCount = 0
IfTrueAction=[!SetVariable ItemPostfix "s"][!SetOption MeterBinText Text "Empty"]
IfCondition2=MeasureBinCount = 1
IfTrueAction2=[!SetVariable ItemPostfix ""][!SetOption MeterBinText Text "[MeasureBinCount] item"]
IfCondition3=MeasureBinCount > 1
IfTrueAction3=[!SetVariable ItemPostfix "s"][!SetOption MeterBinText Text "[MeasureBinCount] items"]
IfConditionMode=1
UpdateDivider=2

[MeasureBinSize]
Measure=Plugin
Plugin=RecycleManager
RecycleType=Size
IfCondition=MeasureBinSize < 1024
IfTrueAction=[!SetOption MeasureScaledSize Formula "[MeasureBinSize]"][!SetVariable ScaleFactor "B"]
IfCondition2=(MeasureBinSize >= 1024) && (MeasureBinSize < 1024**2)
IfTrueAction2=[!SetOption MeasureScaledSize Formula "Round([MeasureBinSize]/1024,1)"][!SetVariable ScaleFactor "kB"]
IfCondition3=(MeasureBinSize >= 1024**2) && (MeasureBinSize < 1024**3)
IfTrueAction3=[!SetOption MeasureScaledSize Formula "Round([MeasureBinSize]/(1024**2),1)"][!SetVariable ScaleFactor "MB"]
IfCondition4=(MeasureBinSize >= 1024**3) && (MeasureBinSize < 1024**4)
IfTrueAction4=[!SetOption MeasureScaledSize Formula "Round([MeasureBinSize]/(1024**3),1)"][!SetVariable ScaleFactor "GB"]
IfCondition5=MeasureBinSize >= 1024**4
IfTrueAction5=[!SetOption MeasureScaledSize Formula "Round([MeasureBinSize]/(1024**4),1)"][!SetVariable ScaleFactor "TB"]
IfConditionMode=1
UpdateDivider=2

[MeasureScaledSize]
Measure=Calc
Formula=0
UpdateDivider=2

[MeterBinText]
Meter=String
FontSize=12
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
ToolTipIcon=Info
ToolTipTitle=Recycle Bin
ToolTipText=[MeasureBinCount] item#ItemPostfix##CRLF#[MeasureScaledSize] #ScaleFactor##CRLF##CRLF#L-click = Open#CRLF#R-click = Empty
Text=Empty
DynamicVariables=1
LeftMouseUpAction=[!CommandMeasure MeasureBinCount "OpenBin"]
RightMouseUpAction=[!CommandMeasure MeasureBinCount "EmptyBinSilent"]
2014-04-23_171258.jpg
2014-04-23_171258.jpg
So I am dealing with several things.

First, I am using some IfCondition options on [MeasureBinCount] to set a variable to deal with the fact that when the count is "1" in the Tooltip, it should be "item" and not "items". Then I am using !SetOption to set the Text option of the String meter to either "Empty" or the count of deleted item(s), again dealing with "item / items" for the Text option.

Then, I'm using a series of IfCondition options on [MeasureBinSize] to "auto scale" the number of bytes displayed in the Tooltip and adding the appropriate "B/kB/MB/GB/TB" postfix to it.
You do not have the required permissions to view the files attached to this post.
User avatar
smurfier
Moderator
Posts: 1930
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: Recycle Bin

Post by smurfier »

Now to throw some scary math at this conversation...

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1

;Kilobyte (kB) = 1024
;Megabyte (MB) = 1048576 or 1024**2
;Gigabyte (GB) = 1073741824 or 1024**3
;Terabyte (TB) = 1099511627776 or 1024**4

[Variables]
ItemPostFix="s"
;ScaleFactor="B"
Decimals=0

[MeasureBinCount]
Measure=Plugin
Plugin=RecycleManager
RecycleType=Count
IfCondition=MeasureBinCount = 0
IfTrueAction=[!SetVariable ItemPostfix "s"][!SetOption MeterBinText Text "Empty"]
IfCondition2=MeasureBinCount = 1
IfTrueAction2=[!SetVariable ItemPostfix ""][!SetOption MeterBinText Text "[MeasureBinCount] item"]
IfCondition3=MeasureBinCount > 1
IfTrueAction3=[!SetVariable ItemPostfix "s"][!SetOption MeterBinText Text "[MeasureBinCount] items"]
IfConditionMode=1
UpdateDivider=2

[MeasureBinSize]
Measure=Plugin
Plugin=RecycleManager
RecycleType=Size
UpdateDivider=2

[Scale]
Measure=Calc
Formula=MeasureBinSize=0?1:ceil(log(MeasureBinSize)/(10*log(2)))
Substitute="1":"B","2":"kB","3":"mB","4":"gB","5":"tB","6":"pB","7":"eB","8":"zB","9":"yB"

[MeasureScaledSize]
Measure=Calc
Formula=round(MeasureBinSize/1024**(Scale-1),#Decimals#)
UpdateDivider=2

[MeterBinText]
Meter=String
FontSize=12
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
ToolTipIcon=Info
ToolTipTitle=Recycle Bin
ToolTipText=[MeasureBinCount] item#ItemPostfix##CRLF#[MeasureScaledSize] [Scale]#CRLF##CRLF#L-click = Open#CRLF#R-click = Empty
Text=Empty
DynamicVariables=1
LeftMouseUpAction=[!CommandMeasure MeasureBinCount "OpenBin"]
RightMouseUpAction=[!CommandMeasure MeasureBinCount "EmptyBinSilent"]
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
User avatar
jsmorley
Developer
Posts: 22283
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Recycle Bin

Post by jsmorley »

Image
User avatar
sl23
Posts: 806
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Recycle Bin

Post by sl23 »

@ Vatsex:
Thanks for your reply. After cleaning up the code as you suggested, I started looking at the other points you mentioned.

Re: IfCondition=BinInfo = 0, The reason this was not directed at the measure is because I wasn't sure of RM's 'rules' about how this worked. I had previously tried the measures mBinItems and mBinSize, but as that didn't work I tried directing at BinInfo.

Re: Bin Empty Orange, this is actually the image and should have had .png on the end, thanks I must've missed that one! :thumbup: I did as you suggested and removed spaces.

Re: Variables, thank you for explaining that. I've been pondering on their purpose for a while. I mean, I thought that they were in some way variable. So sort of like styles, but somehow a way of adjusting things while the skin is active, I'd obviously got the wrong end of the stick. Is the only reason for Variables to make an 'easy access' for certain parameters that may need adjusting by yourself, or, if you share, another?


@ jsmorley:
Thank you for the solution. Works a treat :thumbup: I had figured that ToolTips were treated differently, would you mind if I asked why? Surely it would make sense to allow them to be treated the same? Is there some sort of limitation that stops this from becoming possible?

:rolmfao: :rolmfao: :rolmfao: Nice one, love the pic. I remember that episode, one of the best!

Btw, I'm a bit lost why this is in there:
[MeasureBinCount]
IfCondition=MeasureBinCount = 0
IfTrueAction=[!SetVariable ItemPostfix "s"][!SetOption MeterBinText Text "Empty"]

Why Postfix an s when the bin is empty then postfix with Empty?

I know one thing though, I'm well out of my depth with this! :oops: I look at that code and there's so much I can't get my head around! Then I look at smurfier's code and I am totally lost!

Is there any benefit from using one version over the other? Efficiency-wise I mean. smurfier's code is a few less lines than jsmorley's, does that make it more efficient?

Thanks again guys for your help.

PS, just noticed that with jsmorley's code, R=click Empties the Bin without asking for confirmation like my current code does. I say current code as I've created two new 'TEST' skins to try out the new versions above. I'll look at it see if I can fix it, if i can't I'll post back. Thanks again for your help :great: :thumbup:
User avatar
jsmorley
Developer
Posts: 22283
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Recycle Bin

Post by jsmorley »

sl23 wrote: @ jsmorley:
Thank you for the solution. Works a treat :thumbup: I had figured that ToolTips were treated differently, would you mind if I asked why? Surely it would make sense to allow them to be treated the same? Is there some sort of limitation that stops this from becoming possible?
ToolTip has nothing to do with the String meter. It can be used on any meter type. It is entirely different code, and it wouldn't be easy or make sense to have it somehow detect that it was being used in a String meter and zig-zag over to get the options from the String meter and implement them. Who are we to say you always "want" the options on a String meter to be used in a ToolTip on the meter anyway? Most of the options on a String meter just flat-out won't work in the context of a ToolTip in any case. You just can't have FontSize and FontColor and StringAlign and all that in a Windows ToolTip control.

Most of the functionality you might need for dealing with numbers is actually already available in a ToolTip by using [SectionVariables] with the various parameters for those. AutoScale is really the big one that isn't, and that is because the section variable is a "number" and we would have to turn it into a string to add the "B/kB/MB/GB" etc. to it. Without that scale indicator, AutoScale is useless as you would have no idea what the number means, but with it, it is no longer a number and that adds a lot of complexity.
Btw, I'm a bit lost why this is in there:
[MeasureBinCount]
IfCondition=MeasureBinCount = 0
IfTrueAction=[!SetVariable ItemPostfix "s"][!SetOption MeterBinText Text "Empty"]

Why Postfix an s when the bin is empty then postfix with Empty?
The ItemPostfix variable is used in the ToolTipText and the "Empty" is displayed in the actual String meter Text. Two different things.
Is there any benefit from using one version over the other? Efficiency-wise I mean. smurfier's code is a few less lines than jsmorley's, does that make it more efficient?
Lines of code almost never has anything at all to do with "efficiency" in the sense of resources used. I'm not sure that my approach or Smurfier's is more efficient, and either way it would be a matter of a handful of CPU cycles that no human could possibly ever detect. No doubt that his method is shorter, and probably the right way to go, as long as you can wrap your head around the logarithm math. If you can't understand what it is doing, and are just copy / pasting it in and hoping for the best, then I think it doesn't do what an answer here is intended for. It doesn't help you to understand how to accomplish what you are asking about. In any case it is entirely up to you. Both ways work fine.
PS, just noticed that with jsmorley's code, R=click Empties the Bin without asking for confirmation like my current code does. I say current code as I've created two new 'TEST' skins to try out the new versions above. I'll look at it see if I can fix it, if i can't I'll post back. Thanks again for your help :great: :thumbup:
I am using the Recycle plugin parameter "EmptyBinSilent" instead of "EmptyBin", as I don't need to be asked "if I am sure". If I wasn't sure, I wouldn't have right-clicked it. That is why.
User avatar
VasTex
Posts: 407
Joined: September 20th, 2012, 3:17 pm
Location: USA - Montana

Re: Recycle Bin

Post by VasTex »

Well I'll stick to just answering the parts directed at myself for the moment and allow the others to answer their questions respectively.

IfCondition=BinInfo = 0
-Yes, as far as I'm aware IfConditions can only work with the values of measures, numbers and variables (or any combination of the three). As I mentioned above the meters themselves don't ever really store any information. They're simply a way to display and manipulate the appearance of those variables.

Bin Empty Orange
-Ah, alright well if that is the direct path to the image then you should be fine how it is. I would still include the quotations and the removal of spaces, but otherwise it is fine. Placing the .png to the end is not necessary, but if you do not place it there then Rainmeter will assume that it is a .png anyway. Basically, if you try to use a format other than .png and you don't include the .jpg or .bmp or what have you then Rainmeter may not read it correctly as it will assume that it is a .png unless otherwise stated.

Variables
This section can be really helpful, but it is not always needed. I'll list out a few examples of why I always use it. For starters, let's say that you have 10 meters all of which display text and you want them all to be the same color. You can either define that color in a single Style and have that style govern the colors of the meters or you can have each meter with a line stating FontColor=#MyFontColor#. The #MyFontColor# Variable could be listed under the variables section and by changing that one line of code you've effectively changed every one of the ten meters you have.

Many people prefer to use the variables section to allow others to easily modify the look and feel of their skins without the other users needing to understand much, if any, code. Most people will have Font Type, Size and Color listed in the variables section so that others who download their skins can quickly and easily change the look of it.

Another good, and necessary, use for the [Variables] section is that it allows you to 'Include' external variables with the use of .inc files. I'll link you to the documentation explaining this, but essentially this let's you tell Rainmeter to grab a whole bunch of variables or styles from a single document and use those variables in any number of skins provided they have a line looking like this in the variables section:

[Variables]
@Include=#@#MyGlobalVariables.inc
@Include2=#@#MyGlobalStyles.inc


The @ symbol before the Include statement is necessary for Rainmeter to understand that you're asking for external variables via the Include command. The #@# is the built-in variable for Rainmeter which directs it to the @Resources folder inside of the current skin directory. I'll link you to the documentation for this now, and again, to those of you who know more than I do, if I missed or misinterpreted something, let me know.


Documentation in order Discussed
If Conditions : Documentation
Image Names : Read the 'Note' Section under ImageName
Meter Styles : Documentation
[Variables] Section : Documentation
@Include Option : Documentation
@Include Option : A Guide
Built-in Variables : Documentation
Resources Folder : Documentation
01010100 01100101 01100011 01101000 01101110 01101111 01101100 01101111 01100111 01101001
01100011 01100001 01101100 00100000 01000010 01100001 01100100 01100001 01110011 01110011
User avatar
sl23
Posts: 806
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Recycle Bin

Post by sl23 »

@ jsmorley:
Ah, I see. So efficiency isn't really much of an issue then? If it won't be noticed it's not worth worrying about?

Ok, I missed that about the code! Not had a chance to deal with yet and merge it with my own, but needs a couple things sorted first, things I did specify but you may have missed or perhaps can't be done:

1. Currently, my skin shows an RB Meter with text for items and size. This and an image of a Bin.
I wanted the Bin to have a Tooltip to replace the text, but when I use Measures in the ImageMeter the image disappears. I couldn't figure out how to get the Tooltip to show on the Image, is that possible? Or do I need two Meters placed in the same position?

2. The items text in the Tooltip should show: Empty instead of '0 items'.
The 's' in '1 items' wasn't a bother but thanks for the correction.

Re: R-click = Empty, I prefer confirmation in case of accidental clicking. Easy to sort since you replied though, thank you again :oops:

Oh, and you're right, I'll stick with your code, at least I can sort of figure out what's going on with it! :D

EDIT:
I noticed that under the [Rainmeter] Section you put this:

;Kilobyte (kB) = 1024
;Megabyte (MB) = 1048576 or 1024**2
;Gigabyte (GB) = 1073741824 or 1024**3
;Terabyte (TB) = 1099511627776 or 1024**4

As it is commented out, can I presume it's just for info?


@ Vastex:
Thanks for the links, most I had checked whilst trying to figure out other stuff, but your explanation about single lines replacing a whole measure when you only need to change a single option, is the best reason for me to use Variables at this stage of my understanding.