It is currently April 19th, 2024, 1:55 am

Setting a regexp for inlinesetting to use numofdecimals for part of the string

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

Setting a regexp for inlinesetting to use numofdecimals for part of the string

Post by CodeCode »

Hello,
I read about inline settings on the manual, it specifically mentioned numofdecimals, but it was kind of ambiguous to me.

Can it be done?

I have a text meter:

Code: Select all

[MeterText
Meter=String
MeasureName=Measure1
MeasureName2=Measure2
FontColor=220,220,220,255
StringAlign=CenterCenter
FontSize=14
X=5
Y=5
Text=%1 - %2
InlineSetting=??
InLinePattern=??
I just do not know how to fit the numofdecimals in there - if it is indeed possible to do to start with.
I made a workaround, but it deals with setting mouseactions and disabling and enabling them etc. So it is kind of slow.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Setting a regexp for inlinesetting to use numofdecimals for part of the string

Post by balala »

CodeCode wrote: May 20th, 2023, 7:37 am I read about inline settings on the manual, it specifically mentioned numofdecimals, but it was kind of ambiguous to me.

Can it be done?
Do you want to apply a different setting for the decimal part of the string? If you do, this is definitely possible, no matter how many decimals did you set on the String meter (just mentioning, you didn't apply a NumOfDecimals option on the posted meter). Just use the following InlinePatterns on the meter: InLinePattern=.*\.(.*). With this option, the setting is not applied to the decimal dot. If on the other hand, you want to apply it to the dot too, just include the dot as well into the parenthesis: InLinePattern=.*(\..*).
Hope I didn't misunderstood that the question isn't related to the setting you can apply (so isn't related to the InlineSetting option).
CodeCode wrote: May 20th, 2023, 7:37 am I made a workaround, but it deals with setting mouseactions and disabling and enabling them etc. So it is kind of slow.
What did you do? Not sure I understand...
User avatar
CodeCode
Posts: 1365
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Setting a regexp for inlinesetting to use numofdecimals for part of the string

Post by CodeCode »

Yes, that is what I was asking about - thanks for the regexp examples.

Heh, funny. For a minute there I was going to ask what the InlineSetting was going to look like. However, I realised that it wasn't necessary - the regexp is doing that for me.

Many Thanks balala. :great:
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Setting a regexp for inlinesetting to use numofdecimals for part of the string

Post by balala »

CodeCode wrote: May 20th, 2023, 10:12 am For a minute there I was going to ask what the InlineSetting was going to look like.
The InlineSetting applies certain setting, (usually) different than the ones set in the explicitly to the String meter, to the part of the string returned by the regular expression, used in the InlinePattern option.