It is currently November 29th, 2022, 10:52 am

[Suggestion] Rainmeter ignores further ContextTitle keys if one is missing

Report bugs with the Rainmeter application and suggest features.
User avatar
Active Colors
Moderator
Posts: 1199
Joined: February 16th, 2012, 3:32 am
Location: Berlin, Germany

[Suggestion] Rainmeter ignores further ContextTitle keys if one is missing

Post by Active Colors »

Sorry for the badly worded topic name.

First case:

If some ContextTitle is empty, whatever follows that ContextTitle will be ignored and will not be shown in the context menu.

ContextTitle=name 1
ContextTitle=[!SomeBang]
ContextTitle2=
ContextTitle2=[]
ContextTitle3=name 2
ContextTitle3=[!SomeBang]

In this case, since ContextTitle2 is empty, ContextTitle3 will not be displayed.

Is it possible to make Rainmeter not ignore ContextTitles that are listed after some empty ContextTitle?




Second case:

ContextTitle=name 1
ContextTitle=[!SomeBang]
ContextTitle2=name 2
ContextTitle2=[!SomeBang]
ContextTitle7=name 3
ContextTitle7=[!SomeBang]

In this case, ContextTitle7 will not be displayed because there are "missing" ContextTitle3, 4, 5, and 6.

Will it be possible to make Rainmeter display the ContextTitles that are listed after "missing" ContextTitles?



Possible solution. Rainmeter is able to interpret ContextTitle="---" as a separator. Perhaps, it would also be possible to add something similar that will be interpreted as a "skip" item. Something like ContextTitle="___". However, the best result would be to make Rainmeter not ignore ContextTitles that are listed after some "missing" ContextTitles, like in the second case.
User avatar
Yincognito
Rainmeter Sage
Posts: 4817
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [Suggestion] Rainmeter ignores further ContextTitle keys if one is missing

Post by Yincognito »

Active Colors wrote: March 19th, 2022, 10:41 am Sorry for the badly worded topic name.

First case:

If some ContextTitle is empty, whatever follows that ContextTitle will be ignored and will not be shown in the context menu.

ContextTitle=name 1
ContextTitle=[!SomeBang]
ContextTitle2=
ContextTitle2=[]
ContextTitle3=name 2
ContextTitle3=[!SomeBang]

In this case, since ContextTitle2 is empty, ContextTitle3 will not be displayed.

Is it possible to make Rainmeter not ignore ContextTitles that are listed after some empty ContextTitle?




Second case:

ContextTitle=name 1
ContextTitle=[!SomeBang]
ContextTitle2=name 2
ContextTitle2=[!SomeBang]
ContextTitle7=name 3
ContextTitle7=[!SomeBang]

In this case, ContextTitle7 will not be displayed because there are "missing" ContextTitle3, 4, 5, and 6.

Will it be possible to make Rainmeter display the ContextTitles that are listed after "missing" ContextTitles?



Possible solution. Rainmeter is able to interpret ContextTitle="---" as a separator. Perhaps, it would also be possible to add something similar that will be interpreted as a "skip" item. Something like ContextTitle="___". However, the best result would be to make Rainmeter not ignore ContextTitles that are listed after some "missing" ContextTitles, like in the second case.
Doesn't using some invisible space character like my [\x200B] favirite as title solve both issues? I'm on phone now so can't test, but it looks to me that it would not be difficult... :???:

P.S. The above won't skip items, it will only make them blank, so it depends on whether you're OK with that or not.
User avatar
Active Colors
Moderator
Posts: 1199
Joined: February 16th, 2012, 3:32 am
Location: Berlin, Germany

Re: [Suggestion] Rainmeter ignores further ContextTitle keys if one is missing

Post by Active Colors »

Yincognito wrote: March 19th, 2022, 11:47 am P.S. The above won't skip items, it will only make them blank, so it depends on whether you're OK with that or not.
Yeah I won't like having blank items, because that would increase the size of the context menu.

My case is that I have several meters that have their own different context menu entries. And additionally, I have several "default" entries that are shared across all those meters. For example:

Meter1 will have:
- Default entry 1
- Default entry 2
- A
- B
- C

Meter2 will have:
- Default entry 1
- Default entry 2
- D
- E
- F
- G

Meter3 will have:
- Default entry 1
- Default entry 2
- H


The problem is – if at some point I decide to change the number of "default" entries , let's say from 2 to 3, then the numeration of context entries of each meter will need to be shifted by 1, so, ContextTile3 will have to become ContextTitle4, and so on. This is bad in my case due to some specifics of what I am creating (let's say, I want to make things "automatic" no matter what the amount of "default" entries is.)

I could solve this by having my "default" entries listed at the very end of 25 possible context menu entries but then I would face the problem that I described in my first post here that those entries will not be displayed.
I could also set my "default" entries right after the meter's context menu entries, however, each meter can have a different number of entries, and because of this, I will not be able to simply attach my "default" set of context menu entries to every meter's own context menu entries.

Also, sorry for not being active in the text editor thread, I was actively working on my master thesis and I have just completed it :)
User avatar
death.crafter
Rainmeter Sage
Posts: 1398
Joined: April 24th, 2021, 8:13 pm

Re: [Suggestion] Rainmeter ignores further ContextTitle keys if one is missing

Post by death.crafter »

It's how things are parsed in general. A cheap Lua interpretation would be:

Code: Select all

section = {
	SomeOptions = {}
}
local i = 1
while true do
	local val = rmSection:GetOption('SomeOption' .. (i == 1 and '' or i))
	if val then
		section.SomeOptions[i] = val
	else
		break
	end
	i = i + 1
end
Now, if we consider getting all 25 options (only in this case since max 25 items are allowed), we have to go through a loop like:

Code: Select all

local k = 1
for i = 1, 25 do
	local val = rmSection:GetOption('SomeOption' .. (i == 1 and '' or i))
	if val then
		section.SomeOptions[i] = val
		k = k + 1
	end
end
And since Rainmeter is a mandatroy section, that means this loop has to run every time the skin updates, which wouldn't very efficient.

Also, I don't know how to access the Rainmeter section from Lua. Or else I had a solution in mind, which ofc contains a loop :lol:
from the Realm of Death
User avatar
balala
Rainmeter Sage
Posts: 14744
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: [Suggestion] Rainmeter ignores further ContextTitle keys if one is missing

Post by balala »

Definitely a dev has to come and say something meaningful about this question, but note that there is no numbered option which is working if any of them is ignored. For instance if on a measure we have IfCondition, IfCondition2 and IfCondition3, they are working all three, but if IfCondition2 is missing, IfCondition3 is not working anymore. Can't skip the numbered options.
User avatar
Yincognito
Rainmeter Sage
Posts: 4817
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [Suggestion] Rainmeter ignores further ContextTitle keys if one is missing

Post by Yincognito »

Active Colors wrote: March 19th, 2022, 1:01 pmThe problem is – if at some point I decide to change the number of "default" entries , let's say from 2 to 3, then the numeration of context entries of each meter will need to be shifted by 1, so, ContextTile3 will have to become ContextTitle4, and so on. This is bad in my case due to some specifics of what I am creating (let's say, I want to make things "automatic" no matter what the amount of "default" entries is.)
I suppose you can't share a simple sample of what your code looks like, due to those specifics? I'm very much into making things automatic myself, so I understand what you're saying. If I was having this problem, I suppose I would just put all titles / actions in two separator separated strings initialized in some one time updated String measure according to what default entries and meter specific entries you might have, then perform both the modifications in those measures via RegExp Substitutes, followed by getting each title / action in its own String measure which you can use in the corresponding options. That would be done with the help of regex {quantifiers}, to count the currently set default entries, delete the rest of the default entries, and delete what's beyond 25 titles / actions, so you end up with a list-like string already ordered correctly where the invalid entries will always be the last and will cancel themselves, so to speak. For example, like this (it ended up larger than I wanted, but we're used to copy paste in the Rainmeter code, plus you can easily put the relevant code in a @Include and forget about it, if the method suits you):

Code: Select all

[Variables]
MeterWidth=100
MeterHeight=100
MeterGap=20
BackColor=0,0,0,255
ForeColor=255,0,0,255
MeterCount=3
MeterIndex=1
DefaultEntries=2
DT1 =Default entry 1
DT2 =Default entry 2
DT3 =Default entry 3
DT4 =Default entry 4
DT5 =Default entry 5
DT6 =Default entry 6
DT7 =Default entry 7
DT8 =Default entry 8
DT9 =Default entry 9
DT10=Default entry 10
DT11=Default entry 11
DT12=Default entry 12
DT13=Default entry 13
DT14=Default entry 14
DT15=Default entry 15
DT16=Default entry 16
DT17=Default entry 17
DT18=Default entry 18
DT19=Default entry 19
DT20=Default entry 20
DT21=Default entry 21
DT22=Default entry 22
DT23=Default entry 23
DT24=Default entry 24
DT25=Default entry 25
DA1 =[]
DA2 =[]
DA3 =[]
DA4 =[]
DA5 =[]
DA6 =[]
DA7 =[]
DA8 =[]
DA9 =[]
DA10=[]
DA11=[]
DA12=[]
DA13=[]
DA14=[]
DA15=[]
DA16=[]
DA17=[]
DA18=[]
DA19=[]
DA20=[]
DA21=[]
DA22=[]
DA23=[]
DA24=[]
DA25=[]
M1T1=A
M1T2=B
M1T3=C
M2T1=D
M2T2=E
M2T3=F
M2T4=G
M3T1=H
M1A1=["M1A1"]
M1A2=["M1A2"]
M1A3=["M1A3"]
M2A1=["M2A1"]
M2A2=["M2A2"]
M2A3=["M2A3"]
M2A4=["M2A4"]
M3A1=["M3A1"]

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
ContextTitle=[ContextTitle1]
ContextAction=[ContextAction1]
ContextTitle2=[ContextTitle2]
ContextAction2=[ContextAction2]
ContextTitle3=[ContextTitle3]
ContextAction3=[ContextAction3]
ContextTitle4=[ContextTitle4]
ContextAction4=[ContextAction4]
ContextTitle5=[ContextTitle5]
ContextAction5=[ContextAction5]
ContextTitle6=[ContextTitle6]
ContextAction6=[ContextAction6]
ContextTitle7=[ContextTitle7]
ContextAction7=[ContextAction7]
ContextTitle8=[ContextTitle8]
ContextAction8=[ContextAction8]
ContextTitle9=[ContextTitle9]
ContextAction9=[ContextAction9]
ContextTitle10=[ContextTitle10]
ContextAction10=[ContextAction10]
ContextTitle11=[ContextTitle11]
ContextAction11=[ContextAction11]
ContextTitle12=[ContextTitle12]
ContextAction12=[ContextAction12]
ContextTitle13=[ContextTitle13]
ContextAction13=[ContextAction13]
ContextTitle14=[ContextTitle14]
ContextAction14=[ContextAction14]
ContextTitle15=[ContextTitle15]
ContextAction15=[ContextAction15]
ContextTitle16=[ContextTitle16]
ContextAction16=[ContextAction16]
ContextTitle17=[ContextTitle17]
ContextAction17=[ContextAction17]
ContextTitle18=[ContextTitle18]
ContextAction18=[ContextAction18]
ContextTitle19=[ContextTitle19]
ContextAction19=[ContextAction19]
ContextTitle20=[ContextTitle20]
ContextAction20=[ContextAction20]
ContextTitle21=[ContextTitle21]
ContextAction21=[ContextAction21]
ContextTitle22=[ContextTitle22]
ContextAction22=[ContextAction22]
ContextTitle23=[ContextTitle23]
ContextAction23=[ContextAction23]
ContextTitle24=[ContextTitle24]
ContextAction24=[ContextAction24]
ContextTitle25=[ContextTitle25]
ContextAction25=[ContextAction25]

---Measures---

[ContextTitles]
Group=ContextMenuGroup
Measure=String
String=#DT1#,#DT2#,#DT3#,#DT4#,#DT5#,#DT6#,#DT7#,#DT8#,#DT9#,#DT10#,#DT11#,#DT12#,#DT13#,#DT14#,#DT15#,#DT16#,#DT17#,#DT18#,#DT19#,#DT20#,#DT21#,#DT22#,#DT23#,#DT24#,#DT25#[\x200B][#M[#MeterIndex]T1],[#M[#MeterIndex]T2],[#M[#MeterIndex]T3],[#M[#MeterIndex]T4],[#M[#MeterIndex]T5],[#M[#MeterIndex]T6],[#M[#MeterIndex]T7],[#M[#MeterIndex]T8],[#M[#MeterIndex]T9],[#M[#MeterIndex]T10],[#M[#MeterIndex]T11],[#M[#MeterIndex]T12],[#M[#MeterIndex]T13],[#M[#MeterIndex]T14],[#M[#MeterIndex]T15],[#M[#MeterIndex]T16],[#M[#MeterIndex]T17],[#M[#MeterIndex]T18],[#M[#MeterIndex]T19],[#M[#MeterIndex]T20],[#M[#MeterIndex]T21],[#M[#MeterIndex]T22],[#M[#MeterIndex]T23],[#M[#MeterIndex]T24],[#M[#MeterIndex]T25],
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^((?:.*,){#DefaultEntries#}).*[\x200B](.*)$":"\1\2","(?:^\\1|\\2$)":"","(?siU)^((?:.*,){25}).*$":"\1","^\\1$":"","\[#M\d+T\d+\]":""
DynamicVariables=1

[ContextTitle1]
Group=ContextMenuGroup
Measure=String
String=[ContextTitles]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){0}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextTitle2]
Group=ContextMenuGroup
Measure=String
String=[ContextTitles]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){1}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextTitle3]
Group=ContextMenuGroup
Measure=String
String=[ContextTitles]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){2}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextTitle4]
Group=ContextMenuGroup
Measure=String
String=[ContextTitles]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){3}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextTitle5]
Group=ContextMenuGroup
Measure=String
String=[ContextTitles]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){4}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextTitle6]
Group=ContextMenuGroup
Measure=String
String=[ContextTitles]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){5}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextTitle7]
Group=ContextMenuGroup
Measure=String
String=[ContextTitles]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){6}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextTitle8]
Group=ContextMenuGroup
Measure=String
String=[ContextTitles]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){7}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextTitle9]
Group=ContextMenuGroup
Measure=String
String=[ContextTitles]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){8}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextTitle10]
Group=ContextMenuGroup
Measure=String
String=[ContextTitles]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){9}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextTitle11]
Group=ContextMenuGroup
Measure=String
String=[ContextTitles]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){10}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextTitle12]
Group=ContextMenuGroup
Measure=String
String=[ContextTitles]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){11}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextTitle13]
Group=ContextMenuGroup
Measure=String
String=[ContextTitles]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){12}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextTitle14]
Group=ContextMenuGroup
Measure=String
String=[ContextTitles]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){13}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextTitle15]
Group=ContextMenuGroup
Measure=String
String=[ContextTitles]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){14}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextTitle16]
Group=ContextMenuGroup
Measure=String
String=[ContextTitles]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){15}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextTitle17]
Group=ContextMenuGroup
Measure=String
String=[ContextTitles]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){16}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextTitle18]
Group=ContextMenuGroup
Measure=String
String=[ContextTitles]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){17}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextTitle19]
Group=ContextMenuGroup
Measure=String
String=[ContextTitles]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){18}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextTitle20]
Group=ContextMenuGroup
Measure=String
String=[ContextTitles]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){19}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextTitle21]
Group=ContextMenuGroup
Measure=String
String=[ContextTitles]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){20}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextTitle22]
Group=ContextMenuGroup
Measure=String
String=[ContextTitles]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){21}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextTitle23]
Group=ContextMenuGroup
Measure=String
String=[ContextTitles]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){22}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextTitle24]
Group=ContextMenuGroup
Measure=String
String=[ContextTitles]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){23}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextTitle25]
Group=ContextMenuGroup
Measure=String
String=[ContextTitles]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){24}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextActions]
Group=ContextMenuGroup
Measure=String
String=#DA1#,#DA2#,#DA3#,#DA4#,#DA5#,#DA6#,#DA7#,#DA8#,#DA9#,#DA10#,#DA11#,#DA12#,#DA13#,#DA14#,#DA15#,#DA16#,#DA17#,#DA18#,#DA19#,#DA20#,#DA21#,#DA22#,#DA23#,#DA24#,#DA25#[\x200B][#M[#MeterIndex]A1],[#M[#MeterIndex]A2],[#M[#MeterIndex]A3],[#M[#MeterIndex]A4],[#M[#MeterIndex]A5],[#M[#MeterIndex]A6],[#M[#MeterIndex]A7],[#M[#MeterIndex]A8],[#M[#MeterIndex]A9],[#M[#MeterIndex]A10],[#M[#MeterIndex]A11],[#M[#MeterIndex]A12],[#M[#MeterIndex]A13],[#M[#MeterIndex]A14],[#M[#MeterIndex]A15],[#M[#MeterIndex]A16],[#M[#MeterIndex]A17],[#M[#MeterIndex]A18],[#M[#MeterIndex]A19],[#M[#MeterIndex]A20],[#M[#MeterIndex]A21],[#M[#MeterIndex]A22],[#M[#MeterIndex]A23],[#M[#MeterIndex]A24],[#M[#MeterIndex]A25],
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^((?:.*,){#DefaultEntries#}).*[\x200B](.*)$":"\1\2","(?:^\\1|\\2$)":"","(?siU)^((?:.*,){25}).*$":"\1","^\\1$":"","\[#M\d+A\d+\]":"[]"
DynamicVariables=1

[ContextAction1]
Group=ContextMenuGroup
Measure=String
String=[ContextActions]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){0}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextAction2]
Group=ContextMenuGroup
Measure=String
String=[ContextActions]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){1}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextAction3]
Group=ContextMenuGroup
Measure=String
String=[ContextActions]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){2}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextAction4]
Group=ContextMenuGroup
Measure=String
String=[ContextActions]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){3}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextAction5]
Group=ContextMenuGroup
Measure=String
String=[ContextActions]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){4}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextAction6]
Group=ContextMenuGroup
Measure=String
String=[ContextActions]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){5}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextAction7]
Group=ContextMenuGroup
Measure=String
String=[ContextActions]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){6}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextAction8]
Group=ContextMenuGroup
Measure=String
String=[ContextActions]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){7}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextAction9]
Group=ContextMenuGroup
Measure=String
String=[ContextActions]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){8}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextAction10]
Group=ContextMenuGroup
Measure=String
String=[ContextActions]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){9}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextAction11]
Group=ContextMenuGroup
Measure=String
String=[ContextActions]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){10}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextAction12]
Group=ContextMenuGroup
Measure=String
String=[ContextActions]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){11}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextAction13]
Group=ContextMenuGroup
Measure=String
String=[ContextActions]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){12}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextAction14]
Group=ContextMenuGroup
Measure=String
String=[ContextActions]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){13}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextAction15]
Group=ContextMenuGroup
Measure=String
String=[ContextActions]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){14}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextAction16]
Group=ContextMenuGroup
Measure=String
String=[ContextActions]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){15}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextAction17]
Group=ContextMenuGroup
Measure=String
String=[ContextActions]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){16}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextAction18]
Group=ContextMenuGroup
Measure=String
String=[ContextActions]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){17}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextAction19]
Group=ContextMenuGroup
Measure=String
String=[ContextActions]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){18}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextAction20]
Group=ContextMenuGroup
Measure=String
String=[ContextActions]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){19}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextAction21]
Group=ContextMenuGroup
Measure=String
String=[ContextActions]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){20}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextAction22]
Group=ContextMenuGroup
Measure=String
String=[ContextActions]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){21}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextAction23]
Group=ContextMenuGroup
Measure=String
String=[ContextActions]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){22}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextAction24]
Group=ContextMenuGroup
Measure=String
String=[ContextActions]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){23}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

[ContextAction25]
Group=ContextMenuGroup
Measure=String
String=[ContextActions]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="(?siU)^(?:.*,){24}(.*),.*$":"\1","^\\1$":""
DynamicVariables=1

---Styles---

[sImage]
Group=ContextMenuGroup
X=(#MeterGap#)R
Y=(0)r
W=(#MeterWidth#)
H=(#MeterHeight#)
SolidColor=#ForeColor#
UpdateDivider=-1
DynamicVariables=1

---Meters---

[Background]
Meter=Image
SolidColor=#BackColor#
W=((#MeterWidth#+#MeterGap#)*#MeterCount#+#MeterGap#)
H=(#MeterHeight#+#MeterGap#*2)
UpdateDivider=-1
MouseScrollUpAction=[!SetVariable DefaultEntries ((26+#DefaultEntries#+1)%26)][!UpdateMeasureGroup ContextMenuGroup][!UpdateMeterGroup ContextMenuGroup][!UpdateMeter #CURRENTSECTION#][!Redraw]
MouseScrollDownAction=[!SetVariable DefaultEntries ((26+#DefaultEntries#-1)%26)][!UpdateMeasureGroup ContextMenuGroup][!UpdateMeterGroup ContextMenuGroup][!UpdateMeter #CURRENTSECTION#][!Redraw]
DynamicVariables=1

[Meter1]
Meter=Image
MeterStyle=sImage
X=(#MeterGap#)r
Y=(#MeterGap#)r
RightMouseUpAction=[!SetVariable MeterIndex 1][!UpdateMeasureGroup ContextMenuGroup][!UpdateMeterGroup ContextMenuGroup][!Redraw][!SkinCustomMenu]

[Meter2]
Meter=Image
MeterStyle=sImage
RightMouseUpAction=[!SetVariable MeterIndex 2][!UpdateMeasureGroup ContextMenuGroup][!UpdateMeterGroup ContextMenuGroup][!Redraw][!SkinCustomMenu]

[Meter3]
Meter=Image
MeterStyle=sImage
RightMouseUpAction=[!SetVariable MeterIndex 3][!UpdateMeasureGroup ContextMenuGroup][!UpdateMeterGroup ContextMenuGroup][!Redraw][!SkinCustomMenu]

DynamicContextMenus.jpg
The only problem I would see with this type of approach is the care you should have when escaping stuff in the context menu bangs, but then, that's already outside the scope of the initial issue...

P.S. That's ok regarding the other thread, I tried what I could and just posted what I found there for reference, taking a break from it for the moment (or until someone finds some game changer there). Real life comes first, you don't need to apologize for that. ;-)
P.S.S. Forgot the "instructions": scroll on the black background to set the number of default entries, then right click on any meter to see the appropriate context menu.
You do not have the required permissions to view the files attached to this post.
Last edited by Yincognito on March 19th, 2022, 7:48 pm, edited 2 times in total.
User avatar
jsmorley
Developer
Posts: 22551
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [Suggestion] Rainmeter ignores further ContextTitle keys if one is missing

Post by jsmorley »

The idea behind not allowing "skipping" of Context items is by design. It allows you to have a long list of items, and turn them "all" off and on by simply using SetOption to remove and replace the first one.