Beuwolf wrote: ↑March 26th, 2020, 8:58 pmOne thing I noticed though, if I move the skin to the side, then use the scroll wheel over it later on, the skin jumps to the last place it was saved on (say if changing something in the ini file). Not sure why, but probably due to something in the Mouse actions that I missed maybe ?? It's not anything major though, just more curious as to why it does it, since your skin don't do that.
Well, I'm going to be honest with you: you messed up the code a bit when "playing around" with it. Adding things just like that and expecting them to work is not how one efficiently builds stuff. You must at least have an idea about what this and that does before you copy paste things here and there. If you don't, you ask!
Beuwolf wrote: ↑March 26th, 2020, 8:58 pmHopefully I can get the HotKey plugin to work, since from what I understand, holding say the right arrow key down, then the slider would be moving until you release the arrow key, which would be great. With the middle/right mouse click, it has to be clicked forward one pixel at a time !
If you took a look at my code trying to understand what's happening there, you wouldn't even think to use one pixel middle / right mouse click to move things - I mean, come on, what are we, turtles?! If you set up a "move mode", then you can use the much faster mouse scroll for
both horizontal and vertical movement, and the middle mouse click to
toggle between them (like I did in my version of the skin). And of course, you'd free up the right mouse click entirely (no need for CTRL key to be pressed anymore).
The revised code:
Code: Select all
; Lines starting ; (semicolons) are commented out.
; That is, they do not affect the code and are here for demonstration purposes only.
; ----------------------------------
[Rainmeter]
Update=-1
[Metadata]
Author=Beuwolf
Name=Dashboard with Ruler
Information=Description: Portable dashboard with X and Y axis rulers and movable sliders. | Credit for coding of rulers goes to Ivaran at Deviantart.
License=Creative Commons Attribution-NonCommercial-ShareAlike 3.0
Version=0.4
; ----------------------------------
; Variables
; ----------------------------------
[Variables]
N=50
; StartX and EndX
X=150
; StartY and EndY
Y=150
; Slider Color
FC=4affff
; ----------------------------------
; STYLES are used to "centralize" options
; ----------------------------------
[StyleTitle]
FontColor=255,255,255
FontSize=10
AntiAlias=1
y=r
x=#N#r
[StyleTitle_2]
FontColor=255,255,255
FontSize=10
AntiAlias=1
Angle=(Rad(-90))
y=#N#r
x=0
; ----------------------------------
; MEASURES return some kind of value
; ----------------------------------
[MeasureScrollMode]
Measure=Calc
Formula=((MeasureScrollMode+1)%2)
UpdateDivider=-1
RegExpSubstitute=1
Substitute="^0$":"Horizontal","^1$":"Vertical"
DynamicVariables=1
[MeasureScrollChange]
Measure=Calc
Formula=0
UpdateDivider=-1
IfCondition=(MeasureScrollMode=0) && (MeasureScrollChange=-1)
IfTrueAction=[!SetVariable X (Max(#X#-2,0))]
IfCondition2=(MeasureScrollMode=0) && (MeasureScrollChange=1)
IfTrueAction2=[!SetVariable X (Min(#X#+2,1100))]
IfCondition3=(MeasureScrollMode=1) && (MeasureScrollChange=-1)
IfTrueAction3=[!SetVariable Y (Max(#Y#-2,0))]
IfCondition4=(MeasureScrollMode=1) && (MeasureScrollChange=1)
IfTrueAction4=[!SetVariable Y (Min(#Y#+2,600))]
IfConditionMode=1
DynamicVariables=1
; ----------------------------------
; METERS display images, text, bars, etc.
; ----------------------------------
[BG]
Meter=Shape
; Horizontal
Shape=Rectangle 0,0,1100,17 | StrokeWidth 0 | Fill Color 47,47,47
;#SCREENAREAWIDTH#
; Vertical
Shape2=Rectangle 0,0,17,600 | StrokeWidth 0 | Fill Color 47,47,47
;#SCREENAREAHEIGHT#
; Area
Shape3=Rectangle 17,17,1083,583 | StrokeWidth 0 | Fill Color 47,47,47,25
; Horizontal Slider
Shape4=Line 0,#Y#,1100,#Y# | Stroke Color #FC#
; Vertical Slider
Shape5=Line #X#,0,#X#,600 | Stroke Color #FC#
MiddleMouseUpAction=[!UpdateMeasure MeasureScrollMode]
MouseScrollUpAction=[!SetOption MeasureScrollChange Formula -1][!UpdateMeasure MeasureScrollChange][!UpdateMeter BG][!Redraw]
MouseScrollDownAction=[!SetOption MeasureScrollChange Formula 1][!UpdateMeasure MeasureScrollChange][!UpdateMeter BG][!Redraw]
DynamicVariables=1
[Corner]
Meter=Shape
Shape=Rectangle 0,0,17,17 | StrokeWidth 0 | Fill Color 535353
Shape2=Line 12,0,12,17 | StrokeWidth 1 | Stroke Color 666666
Shape3=Line 0,12,17,12 | StrokeWidth 1 | Stroke Color 666666
Shape4=Line 17,0,17,17 | StrokeWidth 1 | Stroke Color 66,66,66
Shape5=Line 0,17,17,17 | StrokeWidth 1 | Stroke Color 66,66,66
Hidden=0
[GH]
Meter=Image
ImageName=#@#Images_Ruler/#N#.png
W=1100
;#SCREENAREAWIDTH#
Tile=1
[GV]
Meter=Image
ImageName=#@#Images_Ruler/#N#.png
ImageRotate=90
ImageFlip=Vertical
H=600
;#SCREENAREAHEIGHT#
Tile=1
___________________________________________________________________
;NUMBERS
;Horizontal
[NH1]
Meter=string
text=[NH1:X]
MeterStyle=StyleTitle
y=0
[NH2]
Meter=string
text=[NH2:X]
MeterStyle=StyleTitle
[NH3]
Meter=string
text=[NH3:X]
MeterStyle=StyleTitle
[NH4]
Meter=string
text=[NH4:X]
MeterStyle=StyleTitle
[NH5]
Meter=string
text=[NH5:X]
MeterStyle=StyleTitle
[NH6]
Meter=string
text=[NH6:X]
MeterStyle=StyleTitle
[NH7]
Meter=string
text=[NH7:X]
MeterStyle=StyleTitle
[NH8]
Meter=string
text=[NH8:X]
MeterStyle=StyleTitle
[NH9]
Meter=string
text=[NH9:X]
MeterStyle=StyleTitle
[NH10]
Meter=string
text=[NH10:X]
MeterStyle=StyleTitle
[NH11]
Meter=string
text=[NH11:X]
MeterStyle=StyleTitle
[NH12]
Meter=string
text=[NH12:X]
MeterStyle=StyleTitle
[NH13]
Meter=string
text=[NH13:X]
MeterStyle=StyleTitle
[NH14]
Meter=string
text=[NH14:X]
MeterStyle=StyleTitle
[NH15]
Meter=string
text=[NH15:X]
MeterStyle=StyleTitle
[NH16]
Meter=string
text=[NH16:X]
MeterStyle=StyleTitle
[NH17]
Meter=string
text=[NH17:X]
MeterStyle=StyleTitle
[NH18]
Meter=string
text=[NH18:X]
MeterStyle=StyleTitle
[NH19]
Meter=string
text=[NH19:X]
MeterStyle=StyleTitle
[NH20]
Meter=string
text=[NH20:X]
MeterStyle=StyleTitle
; ===== Vertical
[NV1]
Meter=string
text=[NV1:Y]
MeterStyle=StyleTitle_2
y=#N#
[NV2]
Meter=string
text=[NV2:Y]
MeterStyle=StyleTitle_2
[NV3]
Meter=string
text=[NV3:Y]
MeterStyle=StyleTitle_2
[NV4]
Meter=string
text=[NV4:Y]
MeterStyle=StyleTitle_2
[NV5]
Meter=string
text=[NV5:Y]
MeterStyle=StyleTitle_2
[NV6]
Meter=string
text=[NV6:Y]
MeterStyle=StyleTitle_2
[NV7]
Meter=string
text=[NV7:Y]
MeterStyle=StyleTitle_2
[NV8]
Meter=string
text=[NV8:Y]
MeterStyle=StyleTitle_2
[NV9]
Meter=string
text=[NV9:Y]
MeterStyle=StyleTitle_2
[NV10]
Meter=string
text=[NV10:Y]
MeterStyle=StyleTitle_2
Be aware that the 1100 and 600 in
[MeasureScrollChange] are the hardcoded values you have used
yourself in
[BG]. Normally, they should be the screen area dimensions, so that it would suit every monitor, since hardcoded values have the potential to be "incompatible" when the resolution of the monitor changes (to smaller dimensions, for example).
Some notes regarding your mistakes in the previously posted code:
- all the shapes you had in
[BG] represent a
single meter, so no matter how you arrange your mouse actions there, they will react to the meter (that includes all the ShapeN shapes), not to the shape they are under!
-
[!Move (#CURRENTCONFIGX#) (#CURRENTCONFIGY#)] caused the jump you saw in your skin. The bang should have done nothing, as it basically moved to the same coordinates (since you didn't add or subtract anything from #CURRENTCONFIGX/Y#), but for some reason it jumped to that location - didn't investigate too much why and where, I just deleted it as it was wrong and served no purpose whatsoever (eclectic tech's skin doesn't need to move like my initial version of the code)
- you copy pasted the Max() formulas into the mouse actions from
[BG] without thinking too much what they mean. Thus, you didn't pay attention that there were some Min() formulas in the code I originally posted as well. The purpose of the Max() formulas is to prevent values
under 0, and the purpose of the Min() formulas is to prevent values
over the current resolution or any other hardcoded value you use as "movement bounds" (be it vertical or horizontal). Like I said, if you don't know something, just ask - knowledge is no place to be "stubborn", you can only be stubborn after you know what you're doing.
There you go - I told you exactly what should have been said. Fairly and honestly, no hard feelings. These kind of things are to help you progress, because if you only go by taking some code from here and another from there and expect the mix to magically work, it might not behave as you expect it too. On the other hand, if you try to understand (and ask where you don't) things, then the code will "follow your lead" more easily.