It is currently July 4th, 2022, 6:13 am

Highlight buttons with no link on then (shorthanded as possible)

Get help with creating, editing & fixing problems with skins
User avatar
CodeCode
Posts: 1030
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Highlight buttons with no link on then (shorthanded as possible)

Post by CodeCode »

Hello, I have two rows of image buttons. The buttons number 17 for each row, and there are two text meters, one for each row. This is an all one skin.

MY trick is I am sure there is a calc measure solution but I am kind of lost on built=in variables need to get this job don - hopefully.

So there are 17 buttons all in a row - same Y but differing in X values roughly 32 pixels apart from one another.

I I started to try this: (just below) but quickly realise that meters cannot be tested in a calc like measure can. or am i completely numb?

Code: Select all

[mIsEmptyString]
Measure=Calc
IfCondition=([&ProcessText] = "") || ([&CentreTextLow] ="")
IfTrueAction={!SetOption}
The goal is a highlighted circle when a link with no info to light up.

I am starting to thing this is one of those longhanded efforts rather than some elegant shorthanded inde, But I am asking to avoid banging my head on this. (it is sore already and i havent started yet). :oops:
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
CodeCode
Posts: 1030
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Highlight buttons with no link on then (shorthanded as possible)

Post by CodeCode »

I also tried this, but if it is possible it will be the last thing i do to solve this lol.

Code: Select all

[mIsEmptyString]
Measure=Calc
IfCondition=([&ProcessText] = "") || ([&CentreTextLow] ="")
IfTrueAction=[!SetOption #CURRENTSECTION# ImageName "Clicky"][!Update]
DynamicVariables=1
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
balala
Rainmeter Sage
Posts: 14340
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Highlight buttons with no link on then (shorthanded as possible)

Post by balala »

Sorry, but me personally definitely didn't understand what is your intention, however I may say that the IfConditions have to be ENTIERLY numeric. This means you can't use an IfCondition to test if a measure is empty or not (assuming [ProcessText] and [CentreTextLow] are measures - or they are meters? - not sure at this point). To work with strings (for instance to check if a measure or variable is empty), you have to use IfMatch options.
So, for first please offer us a few details on how your skin should work, along with a code or a package of your config (especially if the skin uses resources, which we need).
User avatar
CodeCode
Posts: 1030
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Highlight buttons with no link on then (shorthanded as possible)

Post by CodeCode »

balala wrote: June 22nd, 2022, 7:19 am Sorry, but me personally definitely didn't understand what is your intention, however I may say that the IfConditions have to be ENTIERLY numeric. This means you can't use an IfCondition to test if a measure is empty or not (assuming [ProcessText] and [CentreTextLow] are measures - or they are meters? - not sure at this point). To work with strings (for instance to check if a measure or variable is empty), you have to use IfMatch options.
So, for first please offer us a few details on how your skin should work, along with a code or a package of your config (especially if the skin uses resources, which we need).

Code: Select all

[mIsEmptyString]
Measure=Calc
IfMatch=(ProcessText = "") || (CentreTextLow ="")
IfMatchAction=[!SetOption #CURRENTSECTION# ImageName "Clicky"][!Update]
IfMatchMode=1
DynamicVariables=1
OnChangeAction=[!Update *]
i realsied the ifconditions require nemerical values - sio i changed to IfMatch

Here is cone code that should serve to make things more obvious.

Code: Select all

[Low17]
Meter=Image
SolidColor=0,0,0,1
ImageAlpha=150
X=1463
Y=966
H=37
W=37
MouseOverAction=[!SetOption CentreTextLow Text ""#Low17Text#""][!UpdateMeter CentreTextLow][!UpdateMeter ScrollL][!UpdateMeter ScrollR][!Redraw]
MouseLeaveAction=[!SetOption CentreTextLow Text " "][!UpdateMeter CentreTextLow][!UpdateMeter ScrollL][!UpdateMeter ScrollR][!Redraw]
LeftMouseUpAction=#Low17Link#
DynamicVariables=1
UpdateDivider=-1

[mIsEmptyString]
Measure=Calc
IfMatch=(ProcessText = "") || (CentreTextLow ="")
IfMatchAction=[!SetOption #CURRENTSECTION# ImageName "Clicky"][!Update]
IfMatchMode=1
DynamicVariables=1
OnChangeAction=[!Update *]

[ProcessText]
Meter=String
X=960
Y=(-7+#LeftUpperVerticalAdjust#)
StringAlign=Center
Text=" "        
FontColor=#AllCenterText#
StringCase=None
FontFace=#LinkFont#
FontSize=#LinkFontSize#
StringEffect=Border
FontEffectColor=0,0,0
DynamicVariables=1

[CentreTextLow]
Meter=String
X=(#WORKAREAWIDTH# / 2)
Y=(1022+#LeftLowerVerticalAdjust#)
StringAlign=Center
Text=" "   
StringCase=None
FontColor=#AllCenterText#
FontFace=#LinkFont#
FontSize=#LinkFontSize#
StringEffect=Border
FontEffectColor=0,0,0
DynamicVariables=1
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
CodeCode
Posts: 1030
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Highlight buttons with no link on then (shorthanded as possible)

Post by CodeCode »

CodeCode wrote: June 22nd, 2022, 7:48 am

Code: Select all

[mIsEmptyString]
Measure=Calc
IfMatch=(ProcessText = "") || (CentreTextLow ="")
IfMatchAction=[!SetOption #CURRENTSECTION# ImageName "Clicky"][!Update]
IfMatchMode=1
DynamicVariables=1
OnChangeAction=[!Update *]
i realsied the ifconditions require nemerical values - sio i changed to IfMatch

Here is cone code that should serve to make things more obvious.

Code: Select all

[Variables]
Top17Text=""RGB""
Top17Link=[!ToggleConfig "RoundMegaSuite\Widgets\RGB Code 2.019\" "RGB Code.ini"]

[Low17]
Meter=Image
SolidColor=0,0,0,1
ImageAlpha=150
X=1463
Y=966
H=37
W=37
MouseOverAction=[!SetOption CentreTextLow Text ""#Low17Text#""][!UpdateMeter CentreTextLow][!UpdateMeter ScrollL][!UpdateMeter ScrollR][!Redraw]
MouseLeaveAction=[!SetOption CentreTextLow Text " "][!UpdateMeter CentreTextLow][!UpdateMeter ScrollL][!UpdateMeter ScrollR][!Redraw]
LeftMouseUpAction=#Low17Link#
DynamicVariables=1
UpdateDivider=-1

[mIsEmptyString]
Measure=Calc
IfMatch=(ProcessText = "") || (CentreTextLow ="")
IfMatchAction=[!SetOption #CURRENTSECTION# ImageName "Clicky"][!Update]
IfMatchMode=1
DynamicVariables=1
OnChangeAction=[!Update *]

[ProcessText]
Meter=String
X=960
Y=(-7+#LeftUpperVerticalAdjust#)
StringAlign=Center
Text=" "        
FontColor=#AllCenterText#
StringCase=None
FontFace=#LinkFont#
FontSize=#LinkFontSize#
StringEffect=Border
FontEffectColor=0,0,0
DynamicVariables=1

[CentreTextLow]
Meter=String
X=(#WORKAREAWIDTH# / 2)
Y=(1022+#LeftLowerVerticalAdjust#)
StringAlign=Center
Text=" "   
StringCase=None
FontColor=#AllCenterText#
FontFace=#LinkFont#
FontSize=#LinkFontSize#
StringEffect=Border
FontEffectColor=0,0,0
DynamicVariables=1
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
CodeCode
Posts: 1030
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Highlight buttons with no link on then (shorthanded as possible)

Post by CodeCode »

I have been trying this measure with every image meter to try and show or hide a png in the resources folder.

Code: Select all

[mTop4hide]
Measure=String
String=""#Top4Text#""
IfMatch=""^$""
IfMatchAction=[!SetOption "Top4" "ImageName" ""#@#Clicky""][!""Update]
IfNotMatchAction=[!SetOption "Top4" "ImageName" ""][!Update]
DynamicVariables=1
I just cannot get the image to show when the variable string is empty. I am overcomplicating this but i don't think too far of that.

Please help if wheat I has said in previous posts say anything useful :great:
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
balala
Rainmeter Sage
Posts: 14340
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Highlight buttons with no link on then (shorthanded as possible)

Post by balala »

CodeCode wrote: June 22nd, 2022, 7:48 am Here is cone code that should serve to make things more obvious.
There are a few issues here:
  • [ProcessText] and [CentreTextLow] are meters, as i supposed. You can't check if they are empty, this makes no sense. Measures can be compared, meters can't. A meter has no value, even if it shows something.
  • The IfMatch option of the [mIsEmptyString] is wrong. When working with IfMatch, you don't have to add the name of the measure (supposing it would be a measure, not a meter, as this time), as you do with IfCondition. IfMatch compares ONLY the string value of the measure in which it is used. Accordingly the IfMatch=(ProcessText = "") || (CentreTextLow ="") option wouldn't work, not even if the [ProcessText] and [CentreTextLow] was two measures (even less if they are meters, as said above).
  • I see what the [CentreTextLow] meter should show, this being controlled by the bangs of the MouseOverAction and MouseLeaveAction options of the [Low17] meter, but the [ProcessText] meter seems to show always an empty string (at least based on the posted code). So, the first part of the IfMatch option of the [mIsEmptyString] measure (this one: IfMatch=(ProcessText = "")...) would be always true (especially if it could work).
I probably would tend to set the image to be shown into the MouseOverAction and MouseLeaveAction options of the [Low17] meter (so to show one image when you're hovering the mouse over the meter and show another, or maybe even better to hide the meter, when you1re leaving it).
One more: you can't set an ImageName to a measure (of any type). Such a setting has been done by the IfMatchAction option of the [mIsEmptyString] measure (IfMatchAction=[!SetOption #CURRENTSECTION# ImageName "Clicky"][!Update]). [mIsEmptyString] is a measure, it doesn't have / admit an ImageName - this option belongs to Image meters. If used on the [mIsEmptyString] measure, #CURRENTSECTION# is mIsEmptyString.
User avatar
CodeCode
Posts: 1030
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Highlight buttons with no link on then (shorthanded as possible)

Post by CodeCode »

Wow!! Taanke balala, that explained alot.

However my main goal is that the got the Text17Link from an image value - that seems to only thing I can test to get my desired reult since there is a alot of thing goin on in the whole skin. I don't imagine an overarchin :great: g was for string measures and strienf meters

I looked onto different built in variables and didnt get a clear enough picture from those 2 pages.

So i imagine Text17Image.png will persistently show if the corresponding =#variable# are actualy evaluated. Is there a w ay to test the empty string straight up or with some finesse?

The idea was to test in activate of automatically thing it would be pretty cool for button, if somehow a string measure could be used to allow a match discern that either by using a calc or other measure along with the string measure so that conditions or matches could be used to show maintain that image until a text variable has a value -which would be entirelt manual - this is basically an "image button" idea. That is way I was overthingkingg it.

ANy further help is appreciated.CC
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
balala
Rainmeter Sage
Posts: 14340
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Highlight buttons with no link on then (shorthanded as possible)

Post by balala »

CodeCode wrote: June 22nd, 2022, 12:04 pm ANy further help is appreciated.CC
I probably would try to use a Calc measure ([MeasureLow17]), along with a properly set variable (Low17):

Code: Select all

[Variables]
Low17=0

[Low17]
Meter=Image
SolidColor=0,0,0,1
ImageAlpha=150
X=1463
Y=966
H=37
W=37
MouseOverAction=[!SetVariable Low17 "1"][!UpdateMeasure "MeasureLow17"]
MouseLeaveAction=[!SetVariable Low17 "0"][!UpdateMeasure "MeasureLow17"]
LeftMouseUpAction=#Low17Link#
DynamicVariables=1
UpdateDivider=-1

[MeasureLow17]
Measure=Calc
Formula=#Low17#
IfCondition=(#CURRENTSECTION#>=1)
IfTrueAction=[!SetOption ProcessText "#Low17Text#"][!SetOption TheProperImageMeter ImageName ""][!UpdateMeter "ProcessText"][!UpdateMeter "TheProperImageMeter"][!Redraw]
IfFalseAction=[!SetOption ProcessText ""][!SetOption TheProperImageMeter ImageName "Clicky"][!UpdateMeter "ProcessText"][!UpdateMeter "TheProperImageMeter"][!Redraw]
DynamicVariables=1
This code as written above, works only with the [Low17] meter (when hovering and leaving this one). There probably will be needed to properly modify the Formula option, to take into account what the [CentreTextLow] meter should show, but since that part of the code has not been posted, I can't tell exactly how should you deal with it. But hope you got the idea. If you didn't, please post the whole code, to can give a proper advice.
User avatar
CodeCode
Posts: 1030
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Highlight buttons with no link on then (shorthanded as possible)

Post by CodeCode »

That sounds like a good option for a fix,

I haven't been on that - I am consolidating skins to have less meters to reduce the pull on my CPU.

However if that gets working I might incorporate it into other skins,

My scrolls bar link shortcuts have finally bored me enough to start the process of reducing (again) of active configs,

I will let you know if that option works in my skin/s


Cheers
CC
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.