It is currently April 19th, 2024, 3:27 am

Auto resizing dropdown box.

Get help with creating, editing & fixing problems with skins
inpowell28
Posts: 2
Joined: July 8th, 2020, 12:23 pm

Auto resizing dropdown box.

Post by inpowell28 »

Hi Guys. I'm trying to create a dropdown menu linked to a folder: using fileview and folderinfo I have been trying to get the size of the dropdown to dynamicaly adjust to the number of files in the folder. Ive tried several ways:

Code: Select all

[FileCountMeasure]
Measure=Plugin
Plugin=FolderInfo
Folder=#@#\Aplications"
InfoType=FileCount
DynamicVariables=1

[Background]
W=200
H=([FileCountMeasure] * 20)
SolidColor=0,0,0,200

[testCount]
Meter=String
text=[FileCountMeasure]
MeterStyle=TextStyle 
/ the test count returns 0 even though the folder has 9 files in it. /

Code: Select all

[Background]
W=200
MeasureName=FileCountMeasure
H=%1 * 20
SolidColor=0,0,0,200

[testCount]
Meter=String
MeasureName=FileCountMeasure
text="%1"
MeterStyle=TextStyle 
/ this one returns 9 but the backgrond doesn't show, i've tried several alterations of the syntax. /

Any Ideas where im going wrong?
Last edited by balala on August 31st, 2020, 7:13 pm, edited 1 time in total.
Reason: Please use <code> tags whenever are posting code snippets. It's the </> button.
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: Auto resizing dropdown box.

Post by mak_kawa »

Hi inpowell28

What if the option of [Background] is H=([FileCountMeasure]*20) and add DynamicVariables=1 to the meter?

Possibly, only H=(%1*20) may solve, but not sure.

Ps.: Parentheses are necessary to declare that it is a calculation formula.
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: Auto resizing dropdown box.

Post by mak_kawa »

Ah, sorry... for the first question, maybe DynamicaVariables=1 is needed in [Background] and [testCount] meters.

And... meter type declaration Meter=Image are missing in the [Background] meter.
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: Auto resizing dropdown box.

Post by mak_kawa »

Further... #@# has trailing "\", as far as I know. If so, Folder=#@#Aplications", instead of Folder=#@#\Aplications, or in the case that your skin path includes spaces, Folder="#@#Aplications".

BTW, I didn't test your code actually as running skin, so I am not sure what is the exact solution, sorry.
inpowell28
Posts: 2
Joined: July 8th, 2020, 12:23 pm

Re: Auto resizing dropdown box.

Post by inpowell28 »

Thanks, got it working with you help. dynamicvariables+braketing fixed the problem. :D
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Auto resizing dropdown box.

Post by balala »

mak_kawa wrote: August 31st, 2020, 12:49 pm Further... #@# has trailing "\", as far as I know.
Yes, but adding further backslashes is not a problem (see the PS here).
mak_kawa wrote: August 31st, 2020, 12:49 pm If so, Folder=#@#Aplications", instead of Folder=#@#\Aplications, or in the case that your skin path includes spaces, Folder="#@#Aplications".
Quotes are not needed, neither in options, nor in variables. They are simply ignored by Rainmeter: https://forum.rainmeter.net/viewtopic.php?f=5&t=27375&p=142041&p142041#p142041
However, the original Folder=#@#\Aplications" option ([FileCountMeasure] measure), doesn't look good, since it has a not matching final quote.
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: Auto resizing dropdown box.

Post by mak_kawa »

Welcome back, balala. :-)

"Bountiful" tolerance in Rainmeter skin code is really grateful, but sometimes confusing me... :D
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Auto resizing dropdown box.

Post by balala »

mak_kawa wrote: August 31st, 2020, 8:13 pm "Bountiful" tolerance in Rainmeter skin code is really grateful, but sometimes confusing me... :D
Not sure. Why?
User avatar
Yincognito
Rainmeter Sage
Posts: 7125
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Auto resizing dropdown box.

Post by Yincognito »

balala wrote: August 31st, 2020, 8:33 pmNot sure. Why?
I assume it's because it's not consistent across the entire spectrum of scenarios (e.g. quotes ignored in options, but required in bangs, to give just one example). That's pretty much the main reason why I also try to "normalize" the code by using them everywhere, even where they are not really required.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Auto resizing dropdown box.

Post by balala »

Yincognito wrote: September 1st, 2020, 9:53 am I assume it's because it's not consistent across the entire spectrum of scenarios (e.g. quotes ignored in options, but required in bangs, to give just one example). That's pretty much the main reason why I also try to "normalize" the code by using them everywhere, even where they are not really required.
Might be. However: :confused: