[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
[Variables]
LeastY=13
CurrentY=13
; This FontHeight is the height in pixels of a character in
; the font, inlcuding any slack space above or below the actual
; character glyph.
FontHeight=17
[MeasureFile]
Measure=WebParser
; The file should be encoded as UTF-8 or ANSI. If you need to use a
; file that is encoded as UTF-16 LE, Set CodePage=1200 on this measure.
URL=file://#@#Text\Casey at the bat.txt
;URL=file://#@#Text\Charge of the Light Bridage.txt
RegExp=(?siU)^(.*)$
StringIndex=1
FinishAction=[!UpdateMeter MeasureTextHeight]
[MeterHider]
Meter=Shape
; So we don't want [MeasureTextHeight] to impact the height of the
; overall skin, nor to in any way be actually displayed, so we put
; it inside a Container that is a "singularity". It will still have
; the measureable width and height that it would on its own, but will
; not display, nor make the size of the skin any larger.
X=-1
Y=-1
W=1
H=1
SolidColor=0,0,0,1
[MeasureTextHeight]
Meter=String
; We use this to measure the height of the text as if it was displayed,
; by using [MeasureTextHeight:H] in a formula anywhere.
MeasureName=MeasureFile
W=483
ClipString=2
FontSize=11
FontColor=0,0,0,0
Container=MeterHider
[MeterContainerVisible]
Meter=Shape
Shape=Rectangle 1,1,483,303 | StrokeWidth 2 | Stroke Color 150,150,150,255 | Fill Color 47,47,47,255
[MeterContainer]
Meter=Shape
; Note that we don't want any text to overlap the border "stroke" on the
; visible container, so we make the actual container a tad inset and smaller.
Shape=Rectangle 2,2,480,300
DynamicVariables=1
MouseScrollDownAction=[!SetVariable CurrentY "(Clamp((#CurrentY# - (#FontHeight#*2)),(-([&MeasureTextHeight:H]-300)),#LeastY#))"][!UpdateMeter *][!Redraw]
MouseScrollUpAction=[!SetVariable CurrentY "(Clamp((#CurrentY# + (#FontHeight#*2)),(-([&MeasureTextHeight:H]-300)),#LeastY#))"][!UpdateMeter *][!Redraw]
[MeterText]
Meter=String
MeasureName=MeasureFile
Y=#CurrentY#
W=483
ClipString=2
FontSize=11
FontWeight=400
FontColor=255,255,255,255
Padding=10,0,0,0
AntiAlias=1
DynamicVariables=1
Container=MeterContainer
You do not have the required permissions to view the files attached to this post.
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
[Variables]
LeastY=13
CurrentY=13
; This FontHeight is the height in pixels of a character in
; the font, inlcuding any slack space above or below the actual
; character glyph.
FontHeight=17
[MeasureFile]
Measure=WebParser
; The file should be encoded as UTF-8 or ANSI. If you need to use a
; file that is encoded as UTF-16 LE, Set CodePage=1200 on this measure.
URL=file://#@#Text\Casey at the bat.txt
;URL=file://#@#Text\Charge of the Light Bridage.txt
RegExp=(?siU)^(.*)$
StringIndex=1
FinishAction=[!UpdateMeter MeasureTextHeight]
[MeterHider]
Meter=Shape
; So we don't want [MeasureTextHeight] to impact the height of the
; overall skin, nor to in any way be actually displayed, so we put
; it inside a Container that is a "singularity". It will still have
; the measureable width and height that it would on its own, but will
; not display, nor make the size of the skin any larger.
X=-1
Y=-1
W=1
H=1
SolidColor=0,0,0,1
[MeasureTextHeight]
Meter=String
; We use this to measure the height of the text as if it was displayed,
; by using [MeasureTextHeight:H] in a formula anywhere.
MeasureName=MeasureFile
W=483
ClipString=2
FontSize=11
FontColor=0,0,0,0
Container=MeterHider
[MeterContainerVisible]
Meter=Shape
Shape=Rectangle 1,1,483,303 | StrokeWidth 2 | Stroke Color 150,150,150,255 | Fill Color 47,47,47,255
[MeterContainer]
Meter=Shape
; Note that we don't want any text to overlap the border "stroke" on the
; visible container, so we make the actual container a tad inset and smaller.
Shape=Rectangle 2,2,480,300
DynamicVariables=1
MouseScrollDownAction=[!SetVariable CurrentY "(Clamp((#CurrentY# - (#FontHeight#*2)),(-([&MeasureTextHeight:H]-300)),#LeastY#))"][!UpdateMeter *][!Redraw]
MouseScrollUpAction=[!SetVariable CurrentY "(Clamp((#CurrentY# + (#FontHeight#*2)),(-([&MeasureTextHeight:H]-300)),#LeastY#))"][!UpdateMeter *][!Redraw]
[MeterText]
Meter=String
MeasureName=MeasureFile
Y=#CurrentY#
W=483
ClipString=2
FontSize=11
FontWeight=400
FontColor=255,255,255,255
Padding=10,0,0,0
AntiAlias=1
DynamicVariables=1
Container=MeterContainer
How about the possibility to change the URL value dynamically? Let say I have a file "Notes1.txt" then upon clicking an image/button, it should change to "Notes2.txt". I already done this with QuotePlugin but I'm having a hard time to do this on WebParser
The key is to use !CommandMeasure to force WebParser to immediately go out to the remote resource, rather than waiting for the nature course of UpdateRate to update the data.
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
ContextTitle=Casey at the Bat
ContextAction=[!SetOption MeasureFile URL "file://#@#Text\Casey at the bat.txt"][!CommandMeasure MeasureFile "Update"][!Update]
ContextTitle2=Charge of the Light Brigade
ContextAction2=[!SetOption MeasureFile URL "file://#@#Text\Charge of the Light Brigade.txt"][!CommandMeasure MeasureFile "Update"][!Update]
[Variables]
LeastY=13
CurrentY=13
; This FontHeight is the height in pixels of a character in
; the font, inlcuding any slack space above or below the actual
; character glyph.
FontHeight=17
[MeasureFile]
Measure=WebParser
; The file should be encoded as UTF-8 or ANSI. If you need to use a
; file that is encoded as UTF-16 LE, Set CodePage=1200 on this measure.
URL=file://#@#Text\Casey at the bat.txt
;URL=file://#@#Text\Charge of the Light Brigade.txt
RegExp=(?siU)^(.*)$
StringIndex=1
FinishAction=[!UpdateMeter MeasureTextHeight]
[MeterHider]
Meter=Shape
; So we don't want [MeasureTextHeight] to impact the height of the
; overall skin, nor to in any way be actually displayed, so we put
; it inside a Container that is a "singularity". It will still have
; the measureable width and height that it would on its own, but will
; not display, nor make the size of the skin any larger.
X=-1
Y=-1
W=1
H=1
SolidColor=0,0,0,1
[MeasureTextHeight]
Meter=String
; We use this to measure the height of the text as if it was displayed,
; by using [MeasureTextHeight:H] in a formula anywhere.
MeasureName=MeasureFile
W=483
ClipString=2
FontSize=11
FontColor=0,0,0,0
Container=MeterHider
[MeterContainerVisible]
Meter=Shape
Shape=Rectangle 1,1,483,303 | StrokeWidth 2 | Stroke Color 150,150,150,255 | Fill Color 47,47,47,255
[MeterContainer]
Meter=Shape
; Note that we don't want any text to overlap the border "stroke" on the
; visible container, so we make the actual container a tad inset and smaller.
Shape=Rectangle 2,2,480,300
DynamicVariables=1
MouseScrollDownAction=[!SetVariable CurrentY "(Clamp((#CurrentY# - (#FontHeight#*2)),(-([&MeasureTextHeight:H]-300)),#LeastY#))"][!UpdateMeter *][!Redraw]
MouseScrollUpAction=[!SetVariable CurrentY "(Clamp((#CurrentY# + (#FontHeight#*2)),(-([&MeasureTextHeight:H]-300)),#LeastY#))"][!UpdateMeter *][!Redraw]
[MeterText]
Meter=String
MeasureName=MeasureFile
Y=#CurrentY#
W=483
ClipString=2
FontSize=11
FontWeight=400
FontColor=255,255,255,255
Padding=10,0,0,0
AntiAlias=1
DynamicVariables=1
Container=MeterContainer
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
ContextTitle=Casey at the Bat
ContextAction=[!SetOption MeasureFile URL "file://#@#Text\Casey at the bat.txt"][!CommandMeasure MeasureFile "Update"][!Update]
ContextTitle2=Charge of the Light Brigade
ContextAction2=[!SetOption MeasureFile URL "file://#@#Text\Charge of the Light Brigade.txt"][!CommandMeasure MeasureFile "Update"][!Update]
I always learn something from jsmorley's codes. Thank you as always.
Here is my deliverables. SKIN: Displays a HTTP response headers and body using a RunCommand plugin and curl.exe.
Animated preview:
Scrolling Text in a Container.
Update=-1 in the [Rainmeter] section.
There are not meters/measures having a DynamicVariables=1
Using a Mouse.dll plugin to grab the scrollbar button.
--20210220
--UTF-16LE BOM / UCS-2 LE BOM
function setHEIGHT(MeterName, VariableName)
local m = SKIN:GetMeter(MeterName)
SKIN:Bang('!SetVariable', VariableName, (nil~=m and m:GetH() or 0))
end