It is currently October 22nd, 2024, 11:31 pm

Determining the top / bottom position

Get help with creating, editing & fixing problems with skins
User avatar
Yincognito
Rainmeter Sage
Posts: 8537
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Determining the top / bottom position

Post by Yincognito »

balala wrote: October 17th, 2024, 7:34 pm No, I have not, excepting the fact that the FinishAction option is not valid on a Calc measure. It can be used on WebParser measure and on a few plugin measures (like Ping, RunCommand, FileView and so on), but not on a Calc measure. However the posted option doesn't cause any trouble, but strictly speaking it should be removed.
Indeed, good catch! :thumbup:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Rooky_89
Posts: 81
Joined: September 21st, 2024, 4:57 pm
Location: Germany, in the stone cave

Re: Determining the top / bottom position

Post by Rooky_89 »

balala wrote: October 17th, 2024, 7:34 pm
-> the FinishAction option is not valid on a Calc measure <-

It can be used on WebParser measure and on a few plugin measures (like Ping, RunCommand, FileView and so on), but not on a Calc measure. However the posted option doesn't cause any trouble, but strictly speaking it should be removed.
:rosegift: Thank you, I didn't know that... :rosegift:

For the upper screen area I now have this option, for the lower screen area it will be more difficult because I have to change the Y-position by the size of the skin, I have no idea yet. :oops: But I try to understand and learn everything :oops:


Code: !!! no longer current !!!

Code: Select all


[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]
background_W=300
background_H=70

;--------------------------------------------------------------------
ImageFolder=%USERPROFILE%\Documents\Rainmeter\Skins\ZeroSix\!Bing - Wallpaper\DownloadFile\
;ImageFolder=%USERPROFILE%\Pictures\
Interval=15					

;--------------------------------------------------------------------
;
[CoverContainer]
Meter=Shape
Shape=Rectangle 0,0,#background_W#,#background_H#,8 | StrokeWidth 0
DynamicVariables=1

[Background]
Meter=Image
Container=CoverContainer
AntiAlias=1
;==================================================================
; #MEASURE	#MEASURE	#MEASURE	#MEASURE
;==================================================================
;
[MeasurePosition]
Measure=Calc
Formula=(#SCREENAREAHEIGHT#-#CURRENTCONFIGY#-#CURRENTCONFIGHEIGHT#)
IfCondition=(MeasurePosition>#SCREENAREAHEIGHT#/2)
IfTrueAction=[!SetVariable background_H "200"][!SetOption MeterImage PreserveAspectRatio "0"][!Redraw]
DynamicVariables=1
Disabled=1

;
;==================================================================
; #MEASURE-PICTURE	#MEASURE-PICTURE	#MEASURE-PICTURE
;==================================================================
;
[MeasureImage]
Measure=Plugin
Plugin=QuotePlugin.dll
PathName=#ImageFolder#
FileFilter=*.png;*.jpg;*.jpeg;*.bmp
UpdateDivider=#Interval#

[MeasureName]
Measure=String
String=[MeasureImage]
Substitute=".*\\":""
RegExpSubstitute=1
DynamicVariables=1
;
;==================================================================
;
;==================================================================
;
[MeterImage]
Meter=Image
ImageName=[MeasureImage]
Container=CoverContainer
Borderline=255,255,255,255
Y=0
W=#background_W#
H=#background_H#
PreserveAspectRatio=2
DynamicVariables=1
LeftMouseUpAction=!Execute [explorer.exe "[MeasureImage]"]
MouseOverAction=[!EnableMeasure MeasurePosition]
MouseLeaveAction=[!SetVariable background_H "70"][!SetOption MeterImage PreserveAspectRatio "2"][!UpdateMeter MeterImage][!UpdateMeter CoverContainer][!DisableMeasure MeasurePosition][!Redraw]

[TestString]
Meter=String
FontFace=Arial
FontStyle=BOLD
FontSize=20
FontColor=255,255,255,255
SolidColor=0,0,0,1
InlineSetting=Shadow | 1 | 1 | 2 | 0,0,0,255
MeterStyle=styleLeftText
X=0
Y=0
Text=Screen Y-Pos [MeasurePosition]
AntiAlias=1
DynamicVariables=1


Last edited by Rooky_89 on October 18th, 2024, 2:32 pm, edited 4 times in total.
User avatar
balala
Rainmeter Sage
Posts: 16686
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Determining the top / bottom position

Post by balala »

Rooky_89 wrote: October 17th, 2024, 7:43 pm For the upper screen area I now have this option, for the lower screen area it will be more difficult because I have to change the Y-position by the size of the skin, I have no idea yet.
I can't follow you, especially that you didn't post the whole code, but I have to add a few things, which are not mandatory to be followed, but are recommended:
  • There is no need to quote anything in Rainmeter. You've quoted the ImageFolder variable, into the [Variables] section (ImageFolder="%USERPROFILE%\Pictures"), but Rainmeter simply ignores them. The ImageFolder=%USERPROFILE%\Pictures form of the option is quite well, no need for quoting, however as said, Rainmeter simply ignores the quotes, so this doesn't give headache.
  • The Plugin=Plugins\QuotePlugin.dll option used this way in the [MeasureImage] measure, is extremely outdated. The simplest Plugin=QuotePlugin is the most common form of this option (however due to backward compatibility the used form is also working).
  • Not sure what you did want to achieve by the Rondom=1 option on the same [MeasureImage] measure, but such an option, in this form, doesn't exist. You can use a Random function on a Calc measures, but even there a Random option doesn't exist (and even less a Rondom option). But here the same: since Rainmeter simply ignores the not-existing options, this option doesn't create problems either.
  • In IfConditions (and same way on formula options of a Calc measure), Rainmeter always use the numeric value of a measure, so no need to use the name of a measure as a section variable. You did this into the IfCondition option of the [MeasurePosition] measure (IfCondition=([MeasurePosition]>#SCREENAREAHEIGHT#/2)). Recommend to use it as IfCondition=(MeasurePosition>#SCREENAREAHEIGHT#/2).
  • You could use a MeasureName option instead of ImageName, into the [MeterImage] meter. If you want to do this, replace the ImageName=[MeasureImage] option by MeasureName=MeasureImage
User avatar
Rooky_89
Posts: 81
Joined: September 21st, 2024, 4:57 pm
Location: Germany, in the stone cave

Re: Determining the top / bottom position

Post by Rooky_89 »

balala wrote: October 17th, 2024, 8:17 pm
...not mandatory to be followed, but are recommended...
Hello people :welcome: :great:


Many thanks for the detailed explanation. For the "Round=1 option" I thought that an image would always be selected at random. I want to learn it properly and program.

There isn't a lot of programming code. It should be a small slide show that changes the image every 15 minutes and when you move the mouse over it the image should enlarge. With every project do you learn something new :rosegift:

- If the skin is at the top of the screen, it should open downwards/or expand. (Works for me :oops: )

- If the skin is at the bottom of the screen (task bar), it should open upwards/or expand.

;------------------------------------------------------------
I Found the Source of Random... :oops: :lol:
Screenshot 2024-10-18 173414.png
https://docs.rainmeter.net/manual/measures/calc/
;------------------------------------------------------------


Now you can see the current skin code down below. The measurement screen at the top works by extending the skin. When the Skin is in the lower position, the remaining value measure of the taskbar always remains 48px. The problem that I see now is that you can change the height of the taskbar if I remember correctly. Then the value may change.
You do not have the required permissions to view the files attached to this post.
Last edited by Rooky_89 on October 18th, 2024, 6:34 pm, edited 2 times in total.
User avatar
Rooky_89
Posts: 81
Joined: September 21st, 2024, 4:57 pm
Location: Germany, in the stone cave

Re: Determining the top / bottom position

Post by Rooky_89 »

Hello

It is really tricky... Now i have a little demonstration of it. but i have problem to back to old position and size of the skin. The i need a wise head who can help me. :lol: :oops: :rosegift: :bow: It needs to be revised. :-(


demo.gif
Skin-Code (Up to Date)

Code: Select all


[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
SolidColor=255,255,255,255
BackgroundMode=2

[Variables]
background_W=300
background_H=70
;--------------------------------------------------------------------
;ImageFolder=%USERPROFILE%\Documents\Rainmeter\Skins\ZeroSix\!Bing - Wallpaper\DownloadFile\
;ImageFolder=%USERPROFILE%\Pictures\
;Interval=15					

;--------------------------------------------------------------------
;
[CoverContainer]
Meter=Shape
Shape=Rectangle 0,0,#background_W#,#background_H#,8 | StrokeWidth 0
DynamicVariables=1

[Background]
Meter=Image
Container=CoverContainer
AntiAlias=1
;==================================================================
; #MEASURE	#MEASURE	#MEASURE	#MEASURE
;==================================================================
;
[MeasurePositionYTop]
Measure=Calc
Formula=(#SCREENAREAHEIGHT#-#CURRENTCONFIGY#)
IfCondition=(MeasurePositionYTop = #SCREENAREAHEIGHT#)
IfTrueAction=[!SetVariable background_H "200"][!SetOption MeterImage PreserveAspectRatio "0"][!Redraw]
DynamicVariables=1
Disabled=1


[MeasurePosYBottom]
Measure=Calc
Formula=(#SCREENAREAHEIGHT#-#background_H#-#CURRENTCONFIGY#)
IfCondition=(MeasurePosYBottom < 50)
IfTrueAction=[!ShowMeter TestString2][!Move "#CURRENTCONFIGX#" "(#CURRENTCONFIGY#-130)"][!Delay 500][!SetVariable background_H "200"][!SetOption MeterImage PreserveAspectRatio "0"][!Redraw]
DynamicVariables=1
Disabled=1
;
;==================================================================
; #MEASURE-PICTURE	#MEASURE-PICTURE	#MEASURE-PICTURE
;==================================================================
;
[MeasureImage]
Measure=Plugin
Plugin=QuotePlugin.dll
PathName=#ImageFolder#
FileFilter=*.png;*.jpg;*.jpeg;*.bmp
UpdateDivider=#Interval#

[MeasureName]
Measure=String
String=[MeasureImage]
Substitute=".*\\":""
RegExpSubstitute=1
DynamicVariables=1
;
;==================================================================
;
;==================================================================
;
[MeterImage]
Meter=Image
ImageName=[MeasureImage]
Container=CoverContainer
Borderline=255,255,255,255
Y=0
W=#background_W#
H=#background_H#
PreserveAspectRatio=2
DynamicVariables=1
LeftMouseUpAction=!Execute [explorer.exe "[MeasureImage]"]
MouseOverAction=[!EnableMeasure MeasurePositionYTop][!EnableMeasure MeasurePosYBottom]
MouseLeaveAction=[!DisableMeasure MeasurePositionYTop][!DisableMeasure MeasurePosYBottom][!SetVariable background_H "70"][!SetOption MeterImage PreserveAspectRatio "2"][!UpdateMeter MeterImage][!UpdateMeter CoverContainer][!Redraw]

[TestString]
Meter=String
MeasureName=MeasurePositionYTop
MeasureName2=MeasurePosYBottom
FontFace=Arial
FontStyle=BOLD
FontSize=20
FontColor=0,1,1,255
SolidColor=0,0,0,1
InlineSetting=Shadow | 1 | 1 | 2 | 0,0,0,255
MeterStyle=styleLeftText
X=0
Y=0
W=280
Text=PosY_Top: %1 PosY_Bot: %2
AntiAlias=1
DynamicVariables=1
ClipString=2

[TestString2]
Meter=String
MeasureName=MeasurePositionYTop
MeasureName2=MeasurePosYBottom
FontFace=Arial
FontStyle=BOLD
FontSize=15
FontColor=0,1,1,255
SolidColor=0,0,0,1
InlineSetting=Shadow | 1 | 1 | 2 | 0,0,0,255
MeterStyle=styleLeftText
X=200
Y=0
AntiAlias=1
Text=Smaller as 50
DynamicVariables=1
Hidden=1


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

Re: Determining the top / bottom position

Post by Yincognito »

Rooky_89 wrote: October 18th, 2024, 6:22 pmIt is really tricky...
Not as much as you think though. As an example, take the code here and replace the last two mouse actions with the ones here, for a different take on this. Left click and scroll up and down then right click and scroll up and down to notice the differences (it's a horizontal expansion, but it's more or less the same idea for a vertical one). Of course, if you don't want to change the skin anchor, the previous advices should be followed.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16686
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Determining the top / bottom position

Post by balala »

Rooky_89 wrote: October 18th, 2024, 6:22 pm It is really tricky...
Same here as Yincognito. Not so tricky as it seems on a first look. What you have missed is that if you want to extend the skin upward, you have to put the image downer than to Y=0, because if you put the image to its default position (Y=0), you can't extend it upward.
So, I'd try something like this:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
SolidColor=255,255,255,255
BackgroundMode=2

[Variables]
background_W=300
background_H=70
MouseOver=0
;--------------------------------------------------------------------
;ImageFolder=%USERPROFILE%\Documents\Rainmeter\Skins\ZeroSix\!Bing - Wallpaper\DownloadFile\
ImageFolder=d:\Documents\Pictures
Interval=15					

;--------------------------------------------------------------------
;
[CoverContainer]
Meter=Shape
Shape=Rectangle 0,(130-[MeasurePositionYTop]*(#background_H#-70)),#background_W#,#background_H#,8 | StrokeWidth 0
DynamicVariables=1

;[Background]
;Meter=Image
;Container=CoverContainer
;AntiAlias=1
;==================================================================
; #MEASURE	#MEASURE	#MEASURE	#MEASURE
;==================================================================
;
[MeasurePositionYTop]
Measure=Calc
Formula=(#CURRENTCONFIGY#>=#WORKAREAHEIGHT#-300)
IfCondition=(#CURRENTSECTION#>=1)
;IfTrueAction=[!SetVariable MouseOver "0"][!UpdateMeter "MeterImage"][!UpdateMeter "CoverContainer"][!Redraw]
;IfFalseAction=[!SetVariable MouseOver "130"][!UpdateMeter "MeterImage"][!UpdateMeter "CoverContainer"][!Redraw]
DynamicVariables=1
;Disabled=1

;[MeasurePosYBottom]
;Measure=Calc
;Formula=(#SCREENAREAHEIGHT#-#background_H#-#CURRENTCONFIGY#)
;DynamicVariables=1
;Disabled=1
;
;==================================================================
; #MEASURE-PICTURE	#MEASURE-PICTURE	#MEASURE-PICTURE
;==================================================================
;
[MeasureImage]
Measure=Plugin
Plugin=QuotePlugin.dll
PathName=#ImageFolder#
FileFilter=*.png;*.jpg;*.jpeg;*.bmp
UpdateDivider=#Interval#

[MeasureName]
Measure=String
String=[MeasureImage]
Substitute=".*\\":""
RegExpSubstitute=1
DynamicVariables=1
;
;==================================================================
;
;==================================================================
;
[MeterImage]
Meter=Image
ImageName=[MeasureImage]
Container=CoverContainer
Borderline=255,255,255,255
Y=(130-[MeasurePositionYTop]*(#background_H#-70))
W=#background_W#
H=#background_H#
PreserveAspectRatio=2
DynamicVariables=1
LeftMouseUpAction=!Execute [explorer.exe "[MeasureImage]"]
MouseOverAction=[!SetVariable background_H "200"][!UpdateMeter "CoverContainer"][!UpdateMeter "MeterImage"][!Redraw]
MouseLeaveAction=[!SetVariable background_H "70"][!UpdateMeter "CoverContainer"][!UpdateMeter "MeterImage"][!Redraw]

[TestString]
Meter=String
MeasureName=MeasurePositionYTop
MeasureName2=MeasurePosYBottom
FontFace=Arial
FontStyle=BOLD
FontSize=20
FontColor=0,1,1,255
SolidColor=0,0,0,1
InlineSetting=Shadow | 1 | 1 | 2 | 0,0,0,255
MeterStyle=styleLeftText
X=0
Y=0
W=280
Text=PosY_Top: %1 PosY_Bot: %2
AntiAlias=1
DynamicVariables=1
ClipString=2
Is this more or less alright?
User avatar
Rooky_89
Posts: 81
Joined: September 21st, 2024, 4:57 pm
Location: Germany, in the stone cave

Re: Determining the top / bottom position

Post by Rooky_89 »

Hello, :welcome: :rosegift:


After a few attempts I have the final version. Yincognito you were right with [!SetAnchor "0" "100%"] It slides open for a slowly and closes slowly [really nice]. I didn't know about this option before. With every Project i grow. Thank you very much. :rosegift: :great: :thumbup: 8-)

It works [Done]

Code: Select all


[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1

[Variables]
ContainerH=70
background_W=300
U=[!UpdateMeasure Slider][!UpdateMeter *][!Redraw]
icon1=@Icons\Picture.png
;-----------------------------------------------------
ImageFolder=%USERPROFILE%\Documents\Rainmeter\Skins\ZeroSix\!Bing - Wallpaper\DownloadFile\
;-----------------------------------------------------
Sekunden=180	


;==================================================================
; #BASE		#BASE		#BASE		#BASE
;==================================================================
;
[MeterBackVisible]
Meter=Shape
Shape=Rectangle 2,2,#background_W#,#ContainerH#,10 | Fill Color 0,0,0,0 | StrokeWidth 4 | Stroke Color 0,0,0,180
DynamicVariables=1
AntiAlias=1
MouseOverAction=[!SetAnchor "0" "100%"][!CommandMeasure Slider "Execute 1"][!SetOption MeterImage ImageTint 255,255,255,255][!HideMeterGroup HEADLINE]
MouseLeaveAction=[!CommandMeasure Slider "Stop 1"][!CommandMeasure Slider "Execute 2"][!SetOption MeterImage ImageTint 110,110,110,255][!ShowMeterGroup HEADLINE]

[MeterBackContainer]
Meter=Shape
Shape=Rectangle 2,2,#background_W#,#ContainerH#,10
DynamicVariables=1
AntiAlias=1

[Headline]
Group=HEADLINE
DynamicVariables=1
Meter=String
FontFace=Arial
FontStyle=BOLD
FontSize=25
FontColor=255,255,255,255
InlineSetting=Shadow | 1 | 1 | 2 | 0,0,0,180
X=150
Y=13
Text="Pictures"
StringAlign=Center
AntiAlias=1

[Icon_Picture]
Group=HEADLINE
Meter=Image
ImageName=#icon1#
X=10
Y=(#ContainerH#-48)/2
W=46
H=48
AntiAlias=1
DynamicVariables=1
;
;==================================================================
; #MEASURE-PICTURE	#MEASURE-PICTURE	#MEASURE-PICTURE
;==================================================================
;
[MeasureImage]
Measure=Plugin
Plugin=QuotePlugin.dll
PathName=#ImageFolder#
FileFilter=*.png;*.jpg;*.jpeg;*.bmp
UpdateDivider=#Sekunden#

[Slider]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat SlideDown,2,46
SlideDown=[!SetVariable ContainerH "(Clamp(#ContainerH#+4,70,200))"]#U#
ActionList2=Repeat SlideUp,2,46
SlideUp=[!SetVariable ContainerH "(Clamp(#ContainerH#-4,70,200))"]#U#
DynamicVariables=1

[MeterImage]
Meter=Image
ImageName=[MeasureImage]
Container=MeterBackContainer
ImageTint=110,110,110,255
AntiAlias=1
X=2
Y=2
H=#ContainerH#
W=#background_W#
PreserveAspectRatio=2
DynamicVariables=1


[/Snippet]

Version before
new.gif
==============================================================
Version-Now
perfect.gif
You do not have the required permissions to view the files attached to this post.
User avatar
Yincognito
Rainmeter Sage
Posts: 8537
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Determining the top / bottom position

Post by Yincognito »

Rooky_89 wrote: October 19th, 2024, 1:55 pm After a few attempts I have the final version. Yincognito you were right with [!SetAnchor "0" "100%"] It slides open for a slowly and closes slowly [really nice]. I didn't know about this option before. With every Project i grow. Thank you very much. :rosegift: :great: :thumbup: 8-)
Glad you made it, well done - looks very nice too! :thumbup:

As I said, if you don't want to change the skin anchor, it can be done using some !SetVariable with (... ? ... : ...) conditionals and a !Move bang, but you must be careful with the order of bangs and retaining the needed values (using the #standard# and the [#nested] syntax for variables helps in that case), especially when sliding back / "contracting" the skin, as sliding forth / " expanding" will work right away.

Good choice with the slow motion sliding, that's the ActionTimer plugin at work, not the anchor change. By the way, I don't see you setting back the anchor to "0" "0%" in the code, I suppose you only use the skin at the bottom of the screen and expanding upwards now and you don't really need the anchor back at the top left corner of the skin and expanding downwards anymore...
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16686
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Determining the top / bottom position

Post by balala »

Yincognito wrote: October 19th, 2024, 5:34 pm As I said, if you don't want to change the skin anchor, it can be done using some !SetVariable with (... ? ... : ...) conditionals and a !Move bang,
Instead of the !Move bang, the !SetWindowPosition bang can alter both: the position and the anchor of the skin, by one.