It is currently May 2nd, 2024, 12:27 am

[BUG?] #CURRENTCONFIGWIDTH# Variable

Report bugs with the Rainmeter application and suggest features.
User avatar
KreAch3R
Posts: 608
Joined: February 7th, 2011, 7:27 pm
Location: Thessaloniki, GR

[BUG?] #CURRENTCONFIGWIDTH# Variable

Post by KreAch3R »

I am using 2.4 beta and somehow #CURRENTCONFIGWIDTH# is not working. Here is a test skin:

Code: Select all

[Rainmeter]

[Variables]
Width=#CURRENTCONFIGWIDTH#
Test=#CURRENTCONFIG#

[Meter]
SolidColor=0,0,0,1
Meter=STRING
Text="CURRENTCONFIGWIDTH=#Width##CRLF#CURRENTCONFIG=#Test#"
FontSize=15
AntiAlias=1
Image

I haven't used it before, but right now it isn't resolving in pixels.
Inactive, due to life changes. Send me a PM for any question.

Desktop DeviartArt
Image
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [BUG?] #CURRENTCONFIGWIDTH# Variable

Post by jsmorley »

From the manual:

Code: Select all

The variables below are dynamic in nature. As a result, DynamicVariables=1 must be set on the measure or meter in which they are used and they may not be used in the [Rainmeter] or [Variables] sections.

#CURRENTCONFIGWIDTH# - Width of the current config in pixels
#CURRENTCONFIGHEIGHT# - Width of the height config in pixels
#CURRENTCONFIGX# - Left screen position of the current config in pixels
#CURRENTCONFIGY# - Top screen position of the current config in pixels
It certainly does work.. ;-)
7-24-2012 9-21-51 AM.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
KreAch3R
Posts: 608
Joined: February 7th, 2011, 7:27 pm
Location: Thessaloniki, GR

Re: [BUG?] #CURRENTCONFIGWIDTH# Variable

Post by KreAch3R »

After a lot of post edits, ok, I undestood what you meant. :) It certainly is working. You must scratched your head a little trying to understand what 731 stands for. :p
Last edited by KreAch3R on July 24th, 2012, 1:28 pm, edited 1 time in total.
Inactive, due to life changes. Send me a PM for any question.

Desktop DeviartArt
Image
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: [BUG?] #CURRENTCONFIGWIDTH# Variable

Post by Kaelri »

The real reason it's not working in this case is because you're assigning the value of #CURRENTCONFIGWIDTH# to another variable (#Width#) before the skin has actually set the initial value, as 0 or whatever it is.

If you used -

Text="CURRENTCONFIGWIDTH=#CURRENTCONFIGWIDTH##CRLF#CURRENTCONFIG=#Test#"

- then it would be fine (although of course, without dynamic variables, it would not update to reflect changes in the window size).

I'm not sure whether to call this a bug or not. On the one hand, I think it would be ideal if Rainmeter resolved at least the initial values of built-in variables during the initial parsing of [Variables] to prevent this. On the other hand, I can't see many reasons to pass something like CurrentConfigWidth through another variable. Thoughts, anyone?
jsmorley wrote:
7-24-2012 9-21-51 AM.jpg
Brilliant.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [BUG?] #CURRENTCONFIGWIDTH# Variable

Post by jsmorley »

My problem with changing this in any way is that #CURRENTCONFIGWIDTH# is always dynamic in both code and in any logical practical sense. There is just no value at all in setting a [Variables] to #CURRENTCONFIGWIDTH# as [Variables] are not in an of themselves dynamic and can only be changed with !SetVariable. I see no value at all in trying to create some kind of "exception" processing for this, as the "inital" value of the width of the skin is at worst zero and at best going to be out of date as soon as meters start updating so you are far better off just directly using #CURRENTCONFIGWIDTH# dynamically where you need it rather than assigning it to a variable.
User avatar
KreAch3R
Posts: 608
Joined: February 7th, 2011, 7:27 pm
Location: Thessaloniki, GR

Re: [BUG?] #CURRENTCONFIGWIDTH# Variable

Post by KreAch3R »

Yeah, now I get it. :) I haven't even noticed what the manual was saying after the DynamicVariables=1 part. That 'book' is the reason for my most self - embarrassing reading moments.
As for what you should set a built-in variable to another variable, I don't find any reason to, too. I just did it for testing, I was trying something else in my skin. I will go now to find out if everything is working there, too.

@JSMorley: I just read your post, I completely agree.

UPDATE: Unfortunately, I can't use it the way I wanted it to. I would like to activate a config completely centered, so I thought this line, under its [Rainmeter] Section:

Code: Select all

OnRefreshAction=[!ZPos 1][!KeepOnScreen 0][!Move "((#SCREENAREAWIDTH#- #CURRENTCONFIGWIDTH#)/2)" "((#SCREENAREAHEIGHT#- #CURRENTCONFIGHEIGHT#)/2)" "#CURRENTCONFIG#"][!SnapEdges 0]
If you think about it, that's why I was seeing ghosts about #CURRENTCONFIGWIDTH#. :)
Last edited by KreAch3R on July 24th, 2012, 1:37 pm, edited 2 times in total.
Inactive, due to life changes. Send me a PM for any question.

Desktop DeviartArt
Image
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [BUG?] #CURRENTCONFIGWIDTH# Variable

Post by jsmorley »

KreAch3R wrote:After a lot of post edits, ok, I undestood what you meant. :) It certainly is working. You must scratched your head a little trying to understand what 731 stands for. :p
The more confusing one at first was a post on the forums that was something like

"Hey #SKINSPATH# is not working right for me!"

and I looked up to see

"Hey C:\Users\Jeffrey Morley\Documents\Rainmeter\Skins is not working right for me!"

I was like WTH? for a second or two.. ;-)
User avatar
KreAch3R
Posts: 608
Joined: February 7th, 2011, 7:27 pm
Location: Thessaloniki, GR

Re: [BUG?] #CURRENTCONFIGWIDTH# Variable

Post by KreAch3R »

jsmorley wrote:
The more confusing one at first was a post on the forums that was something like

"Hey #SKINSPATH# is not working right for me!"

and I looked up to see

"Hey C:\Users\Jeffrey Morley\Documents\Rainmeter\Skins is not working right for me!"

I was like WTH? for a second or two.. ;-)
Hahah, I would be like that for sure. Would I be too cruel to say that I would have thought he actually tried this path on his computer to find something? :D

Any thoughts on the UPDATE part on the above post?
Inactive, due to life changes. Send me a PM for any question.

Desktop DeviartArt
Image
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [BUG?] #CURRENTCONFIGWIDTH# Variable

Post by jsmorley »

KreAch3R wrote: Any thoughts on the UPDATE part on the above post?
I can understand the charm of what you are trying to do, but as you know it won't work as those four skin "size / position" variables are just not resolved in [Rainmeter] or [Variables]. Again, even if we did, there is every chance that the "inital" width of the skin when it is refreshed would be completely out of date by the time the first Update of the skin was finished, and all that centering would be for naught. What I would do is put some background meter on the skin (even if invisible) so you have a "constant" width and then hard code that number into your OnRefreshAction.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [BUG?] #CURRENTCONFIGWIDTH# Variable

Post by jsmorley »

You can see a demonstration of what I mean with this skin:

[Rainmeter]
Update=1000
DynamicWindowSize=1

[MeterString]
Meter=String
W=200
H=30
FontSize=12
FontColor=255,255,255,255
AntiAlias=1
Text=#CURRENTCONFIGWIDTH#
DynamicVariables=1

When you load or refresh it, you will get "0" for one Update, then "200".