Something like......
Would you mind sharing a walk-through of the code and how I could add multiple collapsible sections?
multiple_foldunfold.gif
CodeCode:
[Variables];;;; Skin scaling - Based on display resolution recognized by the Rainmeter.exe;; ;; 1.00 (100%) - 1920x1080, 1280x720;; 1.25 (125%) - 1920x1200;; 1.50 (150%) - 2560x1440, 2560x1600, 3440x1440;; 2.00 (200%) - 3840x2160;; 4.00 (400%) - 7680x4320;;;; @see Rainmeter and DPI in Windows 10 by jsmorley | https://forum.rainmeter.net/viewtopic.php?t=22272;;$=(Max(1.00,Ceil(Min(#SCREENAREAWIDTH#,#SCREENAREAHEIGHT#)/1080*100/25)*25/100));; Border width$B=(Round(#$#-0.25))PANE1_W=80PANE1_H=80PANE2_W=80PANE2_H=80[Rainmeter]Update=-1; DefaultUpdateDivider=-1AccurateText=1MouseActionCursor=0OnRefreshAction=[!EnableMeasureGroup gAction];; ============================;; === Measures =============;; ============================;;;; IfConditions | https://docs.rainmeter.net/manual/measures/general-options/ifconditions/;; Section Variables | https://docs.rainmeter.net/manual/variables/section-variables/;; Nesting Variables | https://docs.rainmeter.net/manual/variables/nesting-variables/;;[aFoldUnfold]Measure=StringDynamicVariables=1Group=gActionIfConditionMode=1IfCondition=0<[[#SECTION_NAME]:H]IfTrueAction=[!HideMeterGroup "[#GROUP_NAME]"]IfFalseAction=[!ShowMeterGroup "[#GROUP_NAME]"]OnUpdateAction=[!UpdateMeter Ninja][!Redraw]Disabled=1;; ============================;; === Meters ===============;; ============================;;;; Shape meter | https://docs.rainmeter.net/manual/meters/shape/ ;;[Pane1]Meter=ShapeShape=Rectangle 0,0,#PANE1_W#,#PANE1_H#|StrokeWidth 0|Extend BackgroundColorBackgroundColor=Fill Color 81A1C1MouseLeaveAction=[!HideMeter ButtonHover][!Redraw]MouseOverAction=[!ShowMeter ButtonHover][Pane2]Meter=ShapeY=(10*#$#)RShape=Rectangle 0,0,#PANE2_W#,#PANE2_H#|StrokeWidth 0|Extend BackgroundColorBackgroundColor=Fill Color BF616AMouseLeaveAction=[!HideMeter ButtonHover][!Redraw]MouseOverAction=[!ShowMeter ButtonHover][tButton]X=0rY=0RShape=Rectangle 0,0,(Trunc(120*#$#)),(Trunc(20*#$#))|StrokeWidth 0|Extend BackgroundColorBackgroundColor=Fill Color 202020MouseOverAction=[!SetOption ButtonHover Y "[#CURRENTSECTION#:Y]"][!UpdateMeter ButtonHover][!Redraw][RefPoint1]Meter=StringX=([Pane1:X]+(10*#$#))Y=([Pane1:Y]+(10*#$#))DynamicVariables=1Hidden=1UpdateDivider=-1;; Background[Button10]Meter=ShapeMeterStyle=tButtonX=0rY=0rGroup=LeftMouseUpAction=[!SetVariable GROUP_NAME "gBackground"][!SetVariable SECTION_NAME "Button11"][!UpdateMeasure aFoldUnfold][Button11]Meter=ShapeMeterStyle=tButtonGroup=gBackground[Button12]Meter=ShapeMeterStyle=tButtonGroup=gBackgroundSolidColor=FF99FF[Button13]Meter=ShapeMeterStyle=tButtonGroup=gBackground[RefPoint2]Meter=StringX=([Pane2:X]+(10*#$#))Y=([Pane2:Y]+(10*#$#))DynamicVariables=1Hidden=1UpdateDivider=-1;; Header Font[Button20]Meter=ShapeMeterStyle=tButtonX=0rY=0rGroup=LeftMouseUpAction=[!SetVariable GROUP_NAME "gHeaderFont"][!SetVariable SECTION_NAME "Button21"][!UpdateMeasure aFoldUnfold][Button21]Meter=ShapeMeterStyle=tButtonGroup=gHeaderFont[Button22]Meter=ShapeMeterStyle=tButtonGroup=gHeaderFont[Button23]Meter=ShapeMeterStyle=tButtonGroup=gHeaderFont[Button24]Meter=ShapeMeterStyle=tButtonGroup=gHeaderFont[ButtonHover]Meter=ShapeX=0rY=-100Shape=Rectangle #$B#,0,(Trunc(120*#$#)-2*#$B#),(Trunc(20*#$#)),(Trunc(5*#$#))|StrokeWidth 0|Extend BackgroundColorBackgroundColor=Fill Color 444444Hidden=1;;;; String meter | https://docs.rainmeter.net/manual/meters/string/;;[tLabel]AntiAlias=1DynamicVariables=1FontColor=C0C0C0FontFace=Segoe UIFontSize=(10*#$#)Padding=0,0,(6*#$#),0StringAlign=RightCenter[Label10]Meter=StringMeterStyle=tLabelX=([Button10:XW])Y=([Button10:Y]+[Button10:H]/2)FontColor=FFA54FGroup=gLabelText=Background[Label11]Meter=StringMeterStyle=tLabelX=([Button11:XW])Y=([Button11:Y]+[Button11:H]/2)Group=gLabel|gBackgroundText=Scale[Label12]Meter=StringMeterStyle=tLabelX=([Button12:XW])Y=([Button12:Y]+[Button12:H]/2)Group=gLabel|gBackgroundText=Opacity[Label13]Meter=StringMeterStyle=tLabelX=([Button13:XW])Y=([Button13:Y]+[Button13:H]/2)Group=gLabel|gBackgroundText=Color[Label20]Meter=StringMeterStyle=tLabelX=([Button20:XW])Y=([Button20:Y]+[Button20:H]/2)FontColor=FFA54FGroup=gLabelText=Header Font[Label21]Meter=StringMeterStyle=tLabelX=([Button21:XW])Y=([Button21:Y]+[Button21:H]/2)Group=gLabel|gHeaderFontText=Font[Label22]Meter=StringMeterStyle=tLabelX=([Button22:XW])Y=([Button22:Y]+[Button22:H]/2)Group=gLabel|gHeaderFontText=Size[Label23]Meter=StringMeterStyle=tLabelX=([Button23:XW])Y=([Button23:Y]+[Button23:H]/2)Group=gLabel|gHeaderFontText=Color[Label24]Meter=StringMeterStyle=tLabelX=([Button24:XW])Y=([Button24:Y]+[Button24:H]/2)Group=gLabel|gHeaderFontText=Weight[Ninja]Meter=StringDynamicVariables=1Hidden=1UpdateDivider=-1OnUpdateAction=[!SetVariable PANE1_W "([Button10:W]+2*Trunc(10*#$#))"][!SetVariable PANE1_H "([Button13:YH]+Trunc(10*#$#))"][!SetOption Pane1 DynamicVariables 0][!UpdateMeter Pane1][!UpdateMeter RefPoint2][!SetVariable PANE2_W "([Button20:W]+2*Trunc(10*#$#))"][!SetVariable PANE2_H "([Button24:YH]-[Pane1:YH])"][!SetOption Pane2 DynamicVariables 0][!UpdateMeter Pane2][!UpdateMeterGroup gLabel]
It is hard for me to explain about each code in english, but I can share some tips.
1. [!SetOption SectionName DynamicVariables 0][!UpdateMeasure or !UpdateMeter SectionName] is useful for one time dynamically resolving variables/values. @see Nesting Variables
2. #VariableName# and [#VariableName]
Code:
[Variables]COUNT=0[Meter1]...LeftMouseUpAction=[!SetVariable COUNT "([#COUNT]+1)"][!Log "standard=#COUNT#, nested=[#COUNT]" Warning]
Statistics: Posted by nek — Yesterday, 11:49 pm