It is currently August 8th, 2020, 6:11 am

Little help

Help with creating, editing & fixing problems with skins
User avatar
JamX
Posts: 173
Joined: October 4th, 2019, 2:46 pm

Little help

Post by JamX »

Hallo everybody,

Could you have a look at my weatherskin.

I have added a context menu to it so I can select a "location" to see the weather and the wind conditions

The weather part is working fine, when I select a different city the weather data of that city is displayed.
The wind part is not working, when I select a different city the wind info of the first city is shown. The wind data is not updated, even with the commandmeasure "update" bangs
(To see the windpart hover over the x kts text box)

I have used

Code: Select all

MiddleMouseUpAction=[!SkinCustomMenu]
ContextTitle="-- Locations --"
ContextAction=[]
ContextTitle2=---
ContextAction2=[]
ContextTitle3="• Landgraaf"
;ContextAction3=[!Setvariable Latitude 50.8871][!Setvariable Longitude 6.0116][!Setvariable URLSite "https://weather.com/#Language#/weather/today/l/50.8871,6.0116"][!Commandmeasure @EntireSiteSuperParent "Update"]
ContextAction3=[!Setvariable Latitude 50.8871][!Setvariable Longitude 6.0116][!Setvariable URLSite "https://weather.com/#Language#/weather/today/l/50.8871,6.0116"][!Setvariable URLWind "https://www.windfinder.com/forecast/kerkrade"][!Commandmeasure @EntireSiteSuperParent "Update"][!Commandmeasure MeasureWindInfo "Update"][!Commandmeasure MeasureWindInfo4 "Update"]
ContextTitle4="• Oolderplas"
ContextAction4=[!Setvariable Latitude 51.1796][!Setvariable Longitude 5.9429][!Setvariable URLSite "https://weather.com/#Language#/weather/today/l/51.1796,5.9429"][!Setvariable URLWind "https://www.windfinder.com/forecast/olderplas_ool"][!Commandmeasure @EntireSiteSuperParent "Update"][!Commandmeasure MeasureWindInfo "Update"][!Commandmeasure MeasureWindInfo4 "Update"]
ContextTitle5="• Brouwersdam"
ContextAction5=[!Setvariable Latitude 51.7563][!Setvariable Longitude 3.8402][!Setvariable URLSite "https://weather.com/#Language#/weather/today/l/51.7563,3.8402"][!Setvariable URLWind "https://www.windfinder.com/forecast/renesse_kabbelarsbank"][!Commandmeasure @EntireSiteSuperParent "Update"][!Commandmeasure MeasureWindInfo "Update"][!Commandmeasure MeasureWindInfo4 "Update"]
ContextTitle6=---
ContextAction6=[]
Here is the package:
weather_.rmskin
You do not have the required permissions to view the files attached to this post.
User avatar
Yincognito
Posts: 2195
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Little help

Post by Yincognito »

JamX wrote:
July 20th, 2020, 10:02 am
The wind part is not working, when I select a different city the wind info of the first city is shown. The wind data is not updated, even with the commandmeasure "update" bangs
(To see the windpart hover over the x kts text box)
Add DynamicVariables=1 to the MeasureWindInfo and MeasureWindInfo4 measures in your associated .inc file. That should do it, as far as I can see.
User avatar
JamX
Posts: 173
Joined: October 4th, 2019, 2:46 pm

Re: Little help

Post by JamX »

Thanks again Yincognito,

That is the solution.

PS the rain radar is running flawless till now.
User avatar
Yincognito
Posts: 2195
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Little help

Post by Yincognito »

JamX wrote:
July 20th, 2020, 3:39 pm
Thanks again Yincognito,

That is the solution.

PS the rain radar is running flawless till now.
You're welcome - I'm glad it helped. :great:
User avatar
JamX
Posts: 173
Joined: October 4th, 2019, 2:46 pm

Re: Little help

Post by JamX »

Other little question

Is it possible when you have a 'sliding' window to refresh it on middle mouse button action and directly let it slide out?

Like:

Code: Select all

[Rainmeter]
MiddleMouseUpAction=[!Refresh][!CommandMeasure "MeasureSlide" "Execute 1"][!CommandMeasure "MeasureSlide" "Stop 2"]
The refesh bang works but the slide does not slide OUT.
mak_kawa
Posts: 773
Joined: December 30th, 2015, 9:47 am

Re: Little help

Post by mak_kawa »

Hi JamX

!Refresh bang reloads the whole skin, so two !CommandMeasure bangs after !Refresh bang do nothing.
What actually do you want to do with "refresh"??

EDIT: I am not sure but... what if MiddleMouseUpAction=[!CommandMeasure "MeasureSlide" "Execute 1"][!CommandMeasure "MeasureSlide" "Stop 2"][!Update][!Redraw]?
User avatar
JamX
Posts: 173
Joined: October 4th, 2019, 2:46 pm

Re: Little help

Post by JamX »

mak_kawa wrote:
July 24th, 2020, 9:51 am
Hi JamX

!Refresh bang reloads the whole skin, so two !CommandMeasure bangs after !Refresh bang do nothing.
What actually do you want to do with "refresh"??

EDIT: I am not sure but... what if MiddleMouseUpAction=[!CommandMeasure "MeasureSlide" "Execute 1"][!CommandMeasure "MeasureSlide" "Stop 2"][!Update][!Redraw]?
It's a skin with a stock quote:
Capture.JPG
Sometimes the green or red color, depending if the stock is higher or lower then previous closing date is not displayed correctly. It's white for some kind of a reason I do not know. After I refresh the skin the colors are OK again but then I have to slide the skin OUT manually.

quotes_.rmskin
You do not have the required permissions to view the files attached to this post.
User avatar
Yincognito
Posts: 2195
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Little help

Post by Yincognito »

JamX wrote:
July 24th, 2020, 9:23 am
Other little question

Is it possible when you have a 'sliding' window to refresh it on middle mouse button action and directly let it slide out?

Like:

Code: Select all

[Rainmeter]
MiddleMouseUpAction=[!Refresh][!CommandMeasure "MeasureSlide" "Execute 1"][!CommandMeasure "MeasureSlide" "Stop 2"]
The refesh bang works but the slide does not slide OUT.
Mak_kawa is perfectly right, a skin refresh won't do anything, since the middle mouse click is not "remembered" on refresh, since it belongs to the previous "load session", if you know what I mean. But then, you probably want to update the WebParser measure and slide out on that click, so yeah, it's obviously possible - it's about using the command measure update for the WebParser and stopping and executing the appropriate slides.

One other thing ... I'm not sure that executing an AT action before stopping the previous one makes much sense, in my view it could actually create problems. The whole point of this set of commands is to stop whatever animation is happening and let the desired one to run. The former must happen before the former to achieve something useful, as doing the reverse (like in your code above) has the potential to make the animations overlap.
User avatar
balala
Rainmeter Sage
Posts: 11172
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Little help

Post by balala »

JamX wrote:
July 24th, 2020, 9:23 am
The refesh bang works but the slide does not slide OUT.
I'd add the following option to the [Rainmeter] section: OnRefreshAction=[!CommandMeasure "MeasureSlide" "Execute 1"][!CommandMeasure "MeasureSlide" "Stop 2"].
User avatar
Yincognito
Posts: 2195
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Little help

Post by Yincognito »

JamX wrote:
July 24th, 2020, 10:18 am
It's a skin with a stock quote:
Capture.JPG

Sometimes the green or red color, depending if the stock is higher or lower then previous closing date is not displayed correctly. It's white for some kind of a reason I do not know. After I refresh the skin the colors are OK again but then I have to slide the skin OUT manually.


quotes_.rmskin
I believe I corrected all issues, let me know if I didn't:

Code: Select all

;  ######################################################
;  #    MarketPrices-showing eight stocks/indexes       #
;  #    Prices from CNBC.com                            #      
;  ######################################################

[Rainmeter]
DynamicWindowSize=1
AccurateText=1

[Metadata]
Author=Mordasius
Name=8quotes-Medium
Version=220718
Description= Shows the price and change in price for eight stocks or market indexes. Prices are from http://www.CNBC.com | Right-click on the skin -> Edit Stocks/Labels - to change the stocks being shown

[Variables]
TableTitle=Financial Markets
UpdateQuotes=15
ColorPair-Quote=255,255,255,255
ColorSteady=255,255,255,255
ColorUp=00FF00cc
ColorDown=FF0000
FontHeight=9
ExpQuote=(?siU).*div id="structured-data".*"name" content="(.*)" />.*"price" content="(\d+\.\d{0,2}+).*"PriceChange" content="(.*)" .*"PriceChangePercent" content="(.*)"

Nindex1=UMICore
Symbol1=UMI-BE
Symbol2=UMI.BR

Font=Roboto-Regular
FS2=25
BarTotal=225,225,225,55
FCN=255,255,255,255
FCT=13a7c7
FCD=13A7C7

BackgroundColor=0,0,0,50
BackgroundColor2=0,0,0,160
X=-280
U=[!UpdateMeasure "MeasureSlide"][!UpdateMeterGroup "Wind"][!Redraw]

; --- STYLES ---

[styleTitle]
StringCase=UPPER
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,100
FontColor=#FCT#
FontFace=#Font# 
FontSize=#FS2#
AntiAlias=1

[styleSeperator]
SolidColor=#BarTotal#
Container=MeterContainer
Group=Wind

[sTextLeft]
FontFace=#TextFont#
StringAlign=LEFT
FontSize=#FontHeight#
StringEffect=SHADOW
FontEffectColor=0,0,0,100
ClipString=1
Antialias=1
Container=MeterContainer
Group=Wind

[sTextRight]
FontFace=#TextFont#
StringAlign=RIGHT
FontSize=#FontHeight#
StringEffect=SHADOW
FontEffectColor=0,0,0,100
Antialias=1
Container=MeterContainer
Group=Wind

; --- Measures ---

[MeasureSlide]
Measure=Plugin
Plugin=ActionTimer
Group=Sliders
ActionList1=Repeat Right,15,50
Right=[!SetVariable X "(Clamp((#X#+14),-350,30))"]#U#
ActionList2=Repeat Left,15,50
Left=[!SetVariable X "(Clamp((#X#-14),-350,30))"]#U#
DynamicVariables=1

[InfoIndex1]
Measure=WebParser
URL=https://www.cnbc.com/quotes/#Symbol1#
RegExp=#ExpQuote#
StringIndex=1
UpdateRate=#UpdateQuotes#

[mIndex1_Price]
Measure=WebParser
Url=[InfoIndex1]
StringIndex=2

[mIndex1_Change]
Measure=WebParser
Url=[InfoIndex1]
StringIndex=3

[mIndex1_ChangePer]
Measure=WebParser
Url=[InfoIndex1]
StringIndex=4

[mIndex1_UpDown]
Measure=WebParser
Url=[InfoIndex1]
StringIndex=3

[UpDownSteady1]
Measure=Calc
Formula=mIndex1_UpDown
IfAboveValue=0
IfAboveAction=[!SetOption "LabelIndex1_Change" "FontColor" "#ColorUp#"] [!SetOption "LabelIndex1_ChangePer" "FontColor" "#ColorUp#"] [!SetOption "UpDownImage_1" "ImageName" "Up.png"][!UpdateMeter *][!Redraw]
IfEqualValue=0
IfEqualAction=[!SetOption "LabelIndex1_Change" "FontColor" "#ColorSteady#"] [!SetOption "LabelIndex1_ChangePer" "FontColor" "#ColorSteady#"][!SetOption "UpDownImage_1" "ImageName" "Steady.png"][!UpdateMeter *][!Redraw]
IfBelowValue=0
IfBelowAction=[!SetOption "LabelIndex1_Change" "FontColor" "#ColorDown#"] [!SetOption "LabelIndex1_ChangePer" "FontColor" "#ColorDown#"] [!SetOption "UpDownImage_1" "ImageName" "Down.png"][!UpdateMeter *][!Redraw]

; ---  METERS ---

[meterTitleBox]
Meter=Shape
X=0
Y=492
Shape=Rectangle 0,0,30,25,5 | Fill Color #Backgroundcolor# | StrokeWidth 1.5 | Stroke Color #Backgroundcolor2#
LeftMouseUpAction=[!CommandMeasure "MeasureSlide" "Stop 2"][!CommandMeasure "MeasureSlide" "Execute 1"]
RightMouseUpAction=[!CommandMeasure "MeasureSlide" "Stop 1"][!CommandMeasure "MeasureSlide" "Execute 2"]
MiddleMouseUpAction=[!CommandMeasure InfoIndex1 "Update"][!UpdateMeasure *][!UpdateMeter *][!Redraw][!CommandMeasure "MeasureSlide" "Stop 2"][!CommandMeasure "MeasureSlide" "Execute 1"]
DynamicVariables=1

[MeterShadow]
Meter=Image
X=8r
Y=6r
H=15
W=15
ImageName=#@#Images\Stock.png
GreyScale=1
ImageTint=0,0,0,100

[meterTitleText]
Meter=Image
ImageName=#@#Images\Stock.png
Imagetint=#FCD#
X=-1r
Y=-1r
H=15
W=15

[MeterContainer]
Meter=Image
SolidColor=0,0,0
X=25r
Y=-5r
W=280
H=25

[MeterSlidingBackground]
Meter=Shape
Shape=Rectangle 0,0,280,25,5 | Fill Color #Backgroundcolor2# | StrokeWidth 1.5 | Stroke Color #Backgroundcolor#
X=(#X#-30)
Y=r
DynamicVariables=1
Container=MeterContainer
Group=Wind

[LabelIndex1]
MeasureName=InfoIndex1
Meter=STRING
MeterStyle=sTextLeft
FontColor=#ColorSteady#
MouseOverAction=[!SetOption "#CURRENTSECTION#" FontColor 66ccff] [!Update]
MouseLeaveAction=[!SetOption "#CURRENTSECTION#" FontColor #ColorSteady#] [!Update]
LeftMouseUpAction=https://finance.yahoo.com/chart/#Symbol2#
X=10r
y=4r

[LabelPrice1]
Meter=STRING
MeasureName=mIndex1_Price
MeterStyle= sTextRight
FontColor=#ColorSteady#
x=110r
y=r

[UpDownImage_1]
Meter=Image
ImageName=Steady.png
x=25r
y=2r
Group=wind
Container=MeterContainer
DynamicVariables=1

[LabelIndex1_Change]
MeasureName=mIndex1_Change
Meter=STRING
MeterStyle= sTextRight 
FontColor=#ColorSteady#
x=60r
y=-2r
DynamicVariables=1

[LabelIndex1_ChangePer]
MeasureName=mIndex1_ChangePer
Meter=STRING
MeterStyle=sTextRight 
FontColor=#ColorSteady#
x=65r
y=r
Text=(%1%)
DynamicVariables=1

;-------------------------

I removed the unneeded refresh and replaced it with updating things and sliding out, added the needed update meter and redraw bangs in [UpDownSteady1], and moved a measure lost between meters back to where it should have been (sorry, but had to improve clarity).