It is currently April 8th, 2020, 2:23 pm

Not sure if this is even possible, so have to ask.

Help with creating, editing & fixing problems with skins
User avatar
Yincognito
Posts: 1152
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Not sure if this is even possible, so have to ask.

Post by Yincognito »

Beuwolf wrote:
March 26th, 2020, 2:53 pm
Yeah, no interest in the coordinates of the screen, just space between items in a dock etc.

So you mean something like the below picture, but able to move the 'sliders' with either the mouse scroll wheel, or maybe even keyboard ? Example Horizontal Slider 1 with Up and Down arrow, Horizontal Slider 2 with CTRL + Up or Down arrow ? Then the vertical sliders with the side arrows ? (Forget about the red squares, they just 'handles' I put on the 'sliders', and the skin would be much lighter so the skin underneath would show better.)

Something like that would be great, if it is possible. What kind of stuff should I concentrate on reading up to for something like that then ??

I have seen skins using the scroll wheel to decrease or increase the size of them but so far not gone in and tried to figure it all out.
There is no "below picture" - you probably forgot to attach it...
I have something in the works right now, but it's not yet complete (still working on it as I write):

Code: Select all

[Variables]
RW=100
RH=100
FC=0,0,0,32
SC=255,255,255,255
SW=1

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

---Meters---

[MeterFrame]
Meter=Shape
X=0
Y=0
Shape=Rectangle 0,0,#RW#,#RH# | Fill Color #FC# | Stroke Color #SC# | StrokeWidth #SW#
MouseScrollUpAction=[!Move (#CURRENTCONFIGX#+1) (#CURRENTCONFIGY#+1)][!SetVariable RW (Max(#RW#-2,0))][!SetVariable RH (Max(#RH#-2,0))][!UpdateMeter *][!Redraw]
MouseScrollDownAction=[!Move (#CURRENTCONFIGX#-1) (#CURRENTCONFIGY#-1)][!SetVariable RW (Min(#RW#+2,#SCREENAREAWIDTH#))][!SetVariable RH (Min(#RH#+2,#SCREENAREAHEIGHT#))][!UpdateMeter *][!Redraw]
TooltipText="L = (#CURRENTCONFIGX#+[MeterFrame:X])#CRLF#T = (#CURRENTCONFIGY#+[MeterFrame:Y])#CRLF#R = (#CURRENTCONFIGX#+[MeterFrame:XW])#CRLF#B = (#CURRENTCONFIGY#+[MeterFrame:YH])#CRLF#W = [MeterFrame:W]#CRLF#H = [MeterFrame:H]"
DynamicVariables=1
It shows things in tooltips, it "zooms" on both W/H, it centers itself on move. So far, of course. Yeah, I know: it should sum up those values in the tooltips. As I said, it's a work in progress - but when it will behave as I want it to, I might just use it myself too... ;-)

P.S. Don't forget to set it always topmost, in order to be always visible. Ha! Just measured one of my skins, LMFAO - I already like it, hahaha!
User avatar
Beuwolf
Posts: 28
Joined: February 15th, 2020, 10:08 pm

Re: Not sure if this is even possible, so have to ask.

Post by Beuwolf »

Yincognito wrote:
March 26th, 2020, 3:05 pm
There is no "below picture" - you probably forgot to attach it...
whopsi so I did ! :oops:

Have added it now though.
Yincognito wrote:
March 26th, 2020, 3:05 pm
I have something in the works right now, but it's not yet complete (still working on it as I write):

It shows things in tooltips, it "zooms" on both W/H, it centers itself on move. So far, of course. Yeah, I know: it should sum up those values in the tooltips. As I said, it's a work in progress - but when it will behave as I want it to, I might just use it myself too... ;-)

P.S. Don't forget to set it always topmost, in order to be always visible.
Will have a look at what you posted, and see if I can make sense of it ! :oops:

Thanks ! :thumbup:
User avatar
Beuwolf
Posts: 28
Joined: February 15th, 2020, 10:08 pm

Re: Not sure if this is even possible, so have to ask.

Post by Beuwolf »

Yincognito wrote:
March 26th, 2020, 3:05 pm
I have something in the works right now, but it's not yet complete (still working on it as I write):

Code: Select all

[Variables]
RW=100
RH=100
FC=0,0,0,32
SC=255,255,255,255
SW=1

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

---Meters---

[MeterFrame]
Meter=Shape
X=0
Y=0
Shape=Rectangle 0,0,#RW#,#RH# | Fill Color #FC# | Stroke Color #SC# | StrokeWidth #SW#
MouseScrollUpAction=[!Move (#CURRENTCONFIGX#+1) (#CURRENTCONFIGY#+1)][!SetVariable RW (Max(#RW#-2,0))][!SetVariable RH (Max(#RH#-2,0))][!UpdateMeter *][!Redraw]
MouseScrollDownAction=[!Move (#CURRENTCONFIGX#-1) (#CURRENTCONFIGY#-1)][!SetVariable RW (Min(#RW#+2,#SCREENAREAWIDTH#))][!SetVariable RH (Min(#RH#+2,#SCREENAREAHEIGHT#))][!UpdateMeter *][!Redraw]
TooltipText="L = (#CURRENTCONFIGX#+[MeterFrame:X])#CRLF#T = (#CURRENTCONFIGY#+[MeterFrame:Y])#CRLF#R = (#CURRENTCONFIGX#+[MeterFrame:XW])#CRLF#B = (#CURRENTCONFIGY#+[MeterFrame:YH])#CRLF#W = [MeterFrame:W]#CRLF#H = [MeterFrame:H]"
DynamicVariables=1
It shows things in tooltips, it "zooms" on both W/H, it centers itself on move. So far, of course. Yeah, I know: it should sum up those values in the tooltips. As I said, it's a work in progress - but when it will behave as I want it to, I might just use it myself too... ;-)

P.S. Don't forget to set it always topmost, in order to be always visible. Ha! Just measured one of my skins, LMFAO - I already like it, hahaha!
Been playing around with the code you posted and having some progress here ! :thumbup:

Been able to have one horizontal and one vertical slider working on the 'ruler dash board' by using the mouse functions. Looking into the HotKey Plugin now though, to see if can manage using the Arrow keys instead of the mouse, or the middle click and right click might be hammered to much ! :lol:

Also, if possible, be nice if I can squeeze in 2 of each slider. Will see how it goes !

Thanks again for the code, it pushed me in the right direction ! :thumbup: :thumbup:
User avatar
Yincognito
Posts: 1152
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Not sure if this is even possible, so have to ask.

Post by Yincognito »

Beuwolf wrote:
March 26th, 2020, 5:41 pm
Been playing around with the code you posted and having some progress here ! :thumbup:

Been able to have one horizontal and one vertical slider working on the 'ruler dash board' by using the mouse functions. Looking into the HotKey Plugin now though, to see if can manage using the Arrow keys instead of the mouse, or the middle click and right click might be hammered to much ! :lol:

Also, if possible, be nice if I can squeeze in 2 of each slider. Will see how it goes !

Thanks again for the code, it pushed me in the right direction ! :thumbup: :thumbup:
Well, apparently we finished working on this at the same time. Here is my version (might need some visual polishing, but functionally it's complete, I think):

Code: Select all

[Variables]
; Rectangle Shape Properties: RW = Width, RH = Height, FC = Fill Color, SC = Stroke Color, SW = Stroke Width
RW=100
RH=100
FC=0,0,0,32
SC=255,255,255,255
SW=1
; Displayed Frame Properties: FL = Left, FT = Top, FR = Right, FB = Bottom, FW = Width, FH = Height
FL=0
FT=0
FR=0
FB=0
FW=0
FH=0
; Size Step: the number of pixels by which size is modified on scroll (subtracted on decrease, added on increase)
SS=1

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

---Measures---

; Scroll Mode: 0 = Change Size Step; 1 = Change Width And Height; 2 = Change Width Only; 3 = Change Height Only

[MeasureScrollMode]
Measure=Calc
Formula=((MeasureScrollMode+1)%4)
UpdateDivider=-1
RegExpSubstitute=1
Substitute="^0$":"Size Step","^1$":"Width & Height","^2$":"Width Only","^3$":"Height Only"
DynamicVariables=1

[MeasureScrollChange]
Measure=Calc
Formula=0
UpdateDivider=-1
IfCondition=(MeasureScrollMode=0) && (MeasureScrollChange=-1)
IfTrueAction=[!SetVariable SS (Max((#SS#-1),1))]
IfCondition2=(MeasureScrollMode=0) && (MeasureScrollChange=1)
IfTrueAction2=[!SetVariable SS (Min((#SS#+1),#SCREENAREAWIDTH#))]
IfCondition3=(MeasureScrollMode=1) && (MeasureScrollChange=-1)
IfTrueAction3=[!SetVariable RW (Max((#RW#-#SS#),1))][!SetVariable RH (Max((#RH#-#SS#),1))]
IfCondition4=(MeasureScrollMode=1) && (MeasureScrollChange=1)
IfTrueAction4=[!SetVariable RW (Min((#RW#+#SS#),#SCREENAREAWIDTH#))][!SetVariable RH (Min((#RH#+#SS#),#SCREENAREAHEIGHT#))]
IfCondition5=(MeasureScrollMode=2) && (MeasureScrollChange=-1)
IfTrueAction5=[!SetVariable RW (Max((#RW#-#SS#),1))]
IfCondition6=(MeasureScrollMode=2) && (MeasureScrollChange=1)
IfTrueAction6=[!SetVariable RW (Min((#RW#+#SS#),#SCREENAREAWIDTH#))]
IfCondition7=(MeasureScrollMode=3) && (MeasureScrollChange=-1)
IfTrueAction7=[!SetVariable RH (Max((#RH#-#SS#),1))]
IfCondition8=(MeasureScrollMode=3) && (MeasureScrollChange=1)
IfTrueAction8=[!SetVariable RH (Min((#RH#+#SS#),#SCREENAREAHEIGHT#))]
IfConditionMode=1
DynamicVariables=1

[MeasureFL]
Group=FrameGroup
Measure=Calc
Formula=(#CURRENTCONFIGX#+[MeterFrame:X])
UpdateDivider=-1
DynamicVariables=1

[MeasureFT]
Group=FrameGroup
Measure=Calc
Formula=(#CURRENTCONFIGY#+[MeterFrame:Y])
UpdateDivider=-1
DynamicVariables=1

[MeasureFR]
Group=FrameGroup
Measure=Calc
Formula=(#CURRENTCONFIGX#+[MeterFrame:XW])
UpdateDivider=-1
DynamicVariables=1

[MeasureFB]
Group=FrameGroup
Measure=Calc
Formula=(#CURRENTCONFIGY#+[MeterFrame:YH])
UpdateDivider=-1
DynamicVariables=1

[MeasureFW]
Group=FrameGroup
Measure=Calc
Formula=([MeterFrame:W])
UpdateDivider=-1
DynamicVariables=1

[MeasureFH]
Group=FrameGroup
Measure=Calc
Formula=([MeterFrame:H])
UpdateDivider=-1
DynamicVariables=1

---Meters---

[MeterFrame]
Group=FrameGroup
Meter=Shape
X=0
Y=0
AntiAlias=0
Shape=Rectangle (#SW#/2),(#SW#/2),(#RW#-#SW#),(#RH#-#SW#) | Fill Color #FC# | Stroke Color #SC# | StrokeWidth #SW#
MouseActionCursorName=Cross
TooltipText="Left = [MeasureFL], Top = [MeasureFT]#CRLF#Right = [MeasureFR], Bottom = [MeasureFB]#CRLF#Width = [MeasureFW]; Height = [MeasureFH]#CRLF#-------------------------------#CRLF#Size Step = #SS##CRLF#-------------------------------#CRLF#Size Mode = [MeasureScrollMode]"
MouseScrollUpAction=[!SetOption MeasureScrollChange Formula -1][!UpdateMeasure MeasureScrollChange][!UpdateMeterGroup "FrameGroup"][!UpdateMeasureGroup "FrameGroup"][!Redraw]
MouseScrollDownAction=[!SetOption MeasureScrollChange Formula 1][!UpdateMeasure MeasureScrollChange][!UpdateMeterGroup "FrameGroup"][!UpdateMeasureGroup "FrameGroup"][!Redraw]
LeftMouseUpAction=[!UpdateMeterGroup "FrameGroup"][!UpdateMeasureGroup "FrameGroup"][!Redraw]
MiddleMouseUpAction=[!UpdateMeasure MeasureScrollMode]
DynamicVariables=1
It has comments explaining what every variable (or measure in some cases) does, and it doesn't need any plugin at all - just the left mouse button, the middle mouse button and its wheel for scrolling. As I said, you gave me an idea for my usage scenarios as well, so this one is packed with all the "features" I could think of. ;-)

Preview:
ezgif.com-optimize.gif
What do you make of it? Is there anything else you'd like this to do?

P.S. Of course, the skin can be made to (horizontally, vertically or both) move on scroll, resize itself based on another "anchor point" (currently the top-left corner, which is positionally static), etc. It's just a matter of adding more variables, "scroll modes" in the corresponding measure and more "scroll change" IfConditions (along with the appropriate formulas) in the respective measure.
You do not have the required permissions to view the files attached to this post.
User avatar
Beuwolf
Posts: 28
Joined: February 15th, 2020, 10:08 pm

Re: Not sure if this is even possible, so have to ask.

Post by Beuwolf »

Yincognito wrote:
March 26th, 2020, 7:38 pm
Well, apparently we finished working on this at the same time. Here is my version (might need some visual polishing, but functionally it's complete, I think):

It has comments explaining what every variable (or measure in some cases) does, and it doesn't need any plugin at all - just the left mouse button, the middle mouse button and its wheel for scrolling. As I said, you gave me an idea for my usage scenarios as well, so this one is packed with all the "features" I could think of. ;-)

Preview:
ezgif.com-optimize.gif
What do you make of it? Is there anything else you'd like this to do?
I think that's a great little tool, and even more so that it is something you be able to use yourself ! It wasn't what I had in mind though, but saying that, it could still be used in a similar way as to what I was thinking of. :thumbup:

Here is what I come up with so far. Both the sliders can be moved: The horizontal one with the mouse wheel, up and down. The Vertical one Middle Mouse click moves the slider to the right, Right Mouse click moves it to the left. (And as I'm writing this I realize I should probably changes those two around if I can't get the HotKey plugin working !)

One 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.

Hopefully 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 ! O.O

Also have to remember to press down CTRL if wanting to open the right click menu since it wont pop up otherwise. :lol:

I will continue experimenting with the HotKey and see if I can get it working. For now when I try to add it, it makes the scrollable slider stop working. Might not be compatible with what I have in mind though, need to find out more information about the plugin. But, as I said, I be playing around with it a bit more.

Let me know what you think about it so far, and if you have any suggestions, or just a pointer in the right direction, fell free to add. :D

PS. I did not have to add the HotKey plugin, so either it been added before, or it is built into the Rainmeter already ?? If not I might have to download it and add it to the rmskin ??

PSS: Uploaded a new skin with the HotKey plugin added.
You do not have the required permissions to view the files attached to this post.
Last edited by Beuwolf on March 26th, 2020, 9:25 pm, edited 1 time in total.
User avatar
balala
Rainmeter Sage
Posts: 10093
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Not sure if this is even possible, so have to ask.

Post by balala »

Beuwolf wrote:
March 26th, 2020, 8:58 pm
PS. I did not have to add the HotKey plugin, so either it been added before, or it is built into the Rainmeter already ?? If not I might have to download it and add it to the rmskin ??
No, it's not built into Rainmeter. The list of the built in plugins is here: ActionTimer, AudioLevel, CoreTemp, FileView, FolderInfo, InputText, Ping, Power, Process, Quote, ResMon, RunCommand, SpeedFan, SysInfo, UsageMonitor, WiFiStatus, Win7Audio, WindowMessage and a few deprecated plugins (more precisely three such plugins: AdvancedCPU, PerfMon and iTunes).
Accordingly HotKey has to be added to the skin installer if you're distributing skins using this plugin. If it has been installed it to your system, you can find a copy of both versions of the plugin (the x64 and the x86) into the Skins\@Vault\Plugins\ folder.
Otherwise it can be downloaded here: https://forum.rainmeter.net/viewtopic.php?f=127&t=18849#p102030
User avatar
Beuwolf
Posts: 28
Joined: February 15th, 2020, 10:08 pm

Re: Not sure if this is even possible, so have to ask.

Post by Beuwolf »

balala wrote:
March 26th, 2020, 9:15 pm
No, it's not built into Rainmeter. The list of the built in plugins is here: ActionTimer, AudioLevel, CoreTemp, FileView, FolderInfo, InputText, Ping, Power, Process, Quote, ResMon, RunCommand, SpeedFan, SysInfo, UsageMonitor, WiFiStatus, Win7Audio, WindowMessage and a few deprecated plugins (more precisely three such plugins: AdvancedCPU, PerfMon and iTunes).
Accordingly HotKey has to be added to the skin installer if you're distributing skins using this plugin. If it has been installed it to your system, you can find a copy of both versions of the plugin (the x64 and the x86) into the Skins\@Vault\Plugins\ folder.
Otherwise it can be downloaded here: https://forum.rainmeter.net/viewtopic.php?f=127&t=18849#p102030
Ahh right ! Thanks balala ! :thumbup:

I have added the HotKey pluging to the skin and edited to post above accordingly.
User avatar
Yincognito
Posts: 1152
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Not sure if this is even possible, so have to ask.

Post by Yincognito »

Beuwolf wrote:
March 26th, 2020, 8:58 pm
One 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 pm
Hopefully 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 ! O.O
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. :thumbup:
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3875
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Not sure if this is even possible, so have to ask.

Post by eclectic-tech »

Beuwolf wrote:
March 26th, 2020, 8:58 pm
I will continue experimenting with the HotKey and see if I can get it working. For now when I try to add it, it makes the scrollable slider stop working. Might not be compatible with what I have in mind though, need to find out more information about the plugin. But, as I said, I be playing around with it a bit more.

Let me know what you think about it so far, and if you have any suggestions, or just a pointer in the right direction, fell free to add. :D
EDIT: YIncognito pointed out some errors in your code and made some suggestions that I showed you how to implement. I would suggest looking at the changes I made to your [BG] shape meter, and how the hotkey measures are grouped so they can be updated with a single bang. I hope that showing working code helps you with your coding. We all started not knowing how to do much, but with practice and patience, you will accomplish your goals.

Here's my "2-cents"...

Added hotkeys for movement (CTRL+Arrows).
Removed your !Move commands.
Removed the middle mouse and right mouse key. I left the mouse scroll, but think they are not needed since the arrow keys do everything.
Renamed X & Y variables to XPosition and YPosition.
I added middle mouse button to reset to position 150,150.
Added ruler width and height variables, so size can be changed.
Added hotkey variables to simplify changing control keys.
Added indicators for current X & Y positions at the end of the rulers.
Added Hidden test to only show ruler numbers that are within RulerWidth and RulerHeight settings.

You asked for suggestions or pointers... you created a very nice tool!

Since you already have the hotkey plugin, this code can be saved with a new name and tested...

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

OnRefreshAction=[!KeepOnScreen 0]

MiddleMouseUpAction=[!SetVariable XPosition 150][!SetVariable YPosition 150][!UpdateMeasureGroup Hotkeys][!UpdateMeter *][!Redraw]

[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.5

; ----------------------------------
; Variables
; ----------------------------------

[Variables]
RulerWidth=1100
RulerHeight=600
N=50

; StartX and EndX
XPosition=150
; StartY and EndY
YPosition=150

; Slider Color
FC=4affff

; Hot Keys
Key1=CTRL RIGHT
Key2=CTRL LEFT
Key3=CTRL UP
Key4=CTRL DOWN

; ----------------------------------
; 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
; ----------------------------------

[RightArrow]
Group=HotKeys
Measure=Plugin
Plugin=HotKey
HotKey=#Key1#
KeyDownAction=[!SetVariable XPosition (Clamp(#XPosition#+2,0,#RulerWidth#))][!UpdateMeasureGroup Hotkeys][!UpdateMeter *][!Redraw]
DynamicVariables=1

[LeftArrow]
Group=HotKeys
Measure=Plugin
Plugin=HotKey
HotKey=#Key2#
KeyDownAction=[!SetVariable XPosition (Clamp(#XPosition#-2,0,#RulerWidth#))][!UpdateMeasureGroup Hotkeys][!UpdateMeter *][!Redraw]
DynamicVariables=1

[UpArrow]
Group=HotKeys
Measure=Plugin
Plugin=HotKey
HotKey=#Key3#
KeyDownAction=[!SetVariable YPosition (Clamp(#YPosition#-2,0,#RulerWidth#))][!UpdateMeasureGroup Hotkeys][!UpdateMeter *][!Redraw]
DynamicVariables=1

[DownArrow]
Group=HotKeys
Measure=Plugin
Plugin=HotKey
HotKey=#Key4#
KeyDownAction=[!SetVariable YPosition (Clamp(#YPosition#+2,0,#RulerWidth#))][!UpdateMeasureGroup Hotkeys][!UpdateMeter *][!Redraw]
DynamicVariables=1

; ----------------------------------
; METERS display images, text, bars, etc.
; ----------------------------------

[BG]
Meter=Shape
; Horizontal
Shape=Rectangle 0,0,#RulerWidth#,17 | StrokeWidth 0 | Fill Color 47,47,47
;#SCREENAREAWIDTH#
; Vertical
Shape2=Rectangle 0,0,17,#RulerHeight# | StrokeWidth 0 | Fill Color 47,47,47
;#SCREENAREAHEIGHT# 
; Area
Shape3=Rectangle 17,17,(#RulerWidth#-17),(#RulerHeight#-17) | StrokeWidth 0 | Fill Color 47,47,47,25
; Horizontal Slider 
Shape4=Line 0,#YPosition#,#RulerWidth#,#YPosition# | Stroke Color #FC#
; Vertical Slider
Shape5=Line #XPosition#,0,#XPosition#,#RulerHeight# | Stroke Color #FC#

; Scroll vertical position (I would comment these out and just use the arrow keys)
MouseScrollUpAction=[!SetVariable YPosition (Clamp(#YPosition#-2,0,#RulerHeight#))][!UpdateMeasureGroup Hotkeys][!UpdateMeter *][!Redraw]
MouseScrollDownAction=[!SetVariable YPosition (Clamp(#YPosition#+2,0,#RulerHeight#))][!UpdateMeasureGroup Hotkeys][!UpdateMeter *][!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=#RulerWidth#
Tile=1

[Xposition]
Meter=String
MeterStyle=StyleTitle
SolidColor=47,47,47
X=R
Y=r
Text=#XPosition#
DynamicVariables=1

[GV]
Meter=Image 
ImageName=#@#Images_Ruler/#N#.png
ImageRotate=90
ImageFlip=Vertical
H=#RulerHeight#
Tile=1

[YPosition]
Meter=String
MeterStyle=StyleTitle
SolidColor=47,47,47
X=r
Y=R
Text=#YPosition#
DynamicVariables=1

; ___________________________________________________________________

;NUMBERS

;Horizontal

[NH1]
Meter=string 
text=[NH1:X]
MeterStyle=StyleTitle
y=0
Hidden=(#RulerWidth#<=50)?

[NH2]
Meter=string 
text=[NH2:X]
MeterStyle=StyleTitle
Hidden=(#RulerWidth#<=100)?

[NH3]
Meter=string 
text=[NH3:X]
MeterStyle=StyleTitle
Hidden=(#RulerWidth#<=150)?

[NH4]
Meter=string 
text=[NH4:X]
MeterStyle=StyleTitle
Hidden=(#RulerWidth#<=200)?

[NH5]
Meter=string 
text=[NH5:X]
MeterStyle=StyleTitle
Hidden=(#RulerWidth#<=250)?

[NH6]
Meter=string 
text=[NH6:X]
MeterStyle=StyleTitle
Hidden=(#RulerWidth#<=300)?

[NH7]
Meter=string 
text=[NH7:X]
MeterStyle=StyleTitle
Hidden=(#RulerWidth#<=350)?

[NH8]
Meter=string 
text=[NH8:X]
MeterStyle=StyleTitle
Hidden=(#RulerWidth#<=400)?

[NH9]
Meter=string 
text=[NH9:X]
MeterStyle=StyleTitle
Hidden=(#RulerWidth#<=450)?

[NH10]
Meter=string 
text=[NH10:X]
MeterStyle=StyleTitle
Hidden=(#RulerWidth#<=500)?

[NH11]
Meter=string 
text=[NH11:X]
MeterStyle=StyleTitle
Hidden=(#RulerWidth#<=550)?

[NH12]
Meter=string 
text=[NH12:X]
MeterStyle=StyleTitle
Hidden=(#RulerWidth#<=600)?

[NH13]
Meter=string 
text=[NH13:X]
MeterStyle=StyleTitle
Hidden=(#RulerWidth#<=650)?

[NH14]
Meter=string 
text=[NH14:X]
MeterStyle=StyleTitle
Hidden=(#RulerWidth#<=700)?

[NH15]
Meter=string 
text=[NH15:X]
MeterStyle=StyleTitle
Hidden=(#RulerWidth#<=750)?

[NH16]
Meter=string 
text=[NH16:X]
MeterStyle=StyleTitle
Hidden=(#RulerWidth#<=800)?

[NH17]
Meter=string 
text=[NH17:X]
MeterStyle=StyleTitle
Hidden=(#RulerWidth#<=850)?

[NH18]
Meter=string 
text=[NH18:X]
MeterStyle=StyleTitle
Hidden=(#RulerWidth#<=900)?

[NH19]
Meter=string 
text=[NH19:X]
MeterStyle=StyleTitle
Hidden=(#RulerWidth#<=950)?

[NH20]
Meter=string 
text=[NH20:X]
MeterStyle=StyleTitle
Hidden=(#RulerWidth#<=1000)?

[NH21]
Meter=string 
text=[NH21:X]
MeterStyle=StyleTitle
Hidden=(#RulerWidth#<=1050)?

[NH22]
Meter=string 
text=[NH22:X]
MeterStyle=StyleTitle
Hidden=(#RulerWidth#<=1100)?

[NH23]
Meter=string 
text=[NH23:X]
MeterStyle=StyleTitle
Hidden=(#RulerWidth#<=1150)?

[NH24]
Meter=string 
text=[NH24:X]
MeterStyle=StyleTitle
Hidden=(#RulerWidth#<=1200)?

[NH25]
Meter=string 
text=[NH25:X]
MeterStyle=StyleTitle
Hidden=(#RulerWidth#<=1250)?

[NH26]
Meter=string 
text=[NH26:X]
MeterStyle=StyleTitle
Hidden=(#RulerWidth#<=1300)?

[NH27]
Meter=string 
text=[NH27:X]
MeterStyle=StyleTitle
Hidden=(#RulerWidth#<=1350)?

[NH28]
Meter=string 
text=[NH28:X]
MeterStyle=StyleTitle
Hidden=(#RulerWidth#<=1400)?

[NH29]
Meter=string 
text=[NH29:X]
MeterStyle=StyleTitle
Hidden=(#RulerWidth#<=1450)?


; ===== Vertical

[NV1]
Meter=string 
text=[NV1:Y]
MeterStyle=StyleTitle_2
y=#N#
Hidden=(#RulerHeight#<=50)?

[NV2]
Meter=string 
text=[NV2:Y]
MeterStyle=StyleTitle_2
Hidden=(#RulerHeight#<=100)?

[NV3]
Meter=string 
text=[NV3:Y]
MeterStyle=StyleTitle_2
Hidden=(#RulerHeight#<=150)?

[NV4]
Meter=string 
text=[NV4:Y]
MeterStyle=StyleTitle_2
Hidden=(#RulerHeight#<=200)?

[NV5]
Meter=string 
text=[NV5:Y]
MeterStyle=StyleTitle_2
Hidden=(#RulerHeight#<=250)?

[NV6]
Meter=string 
text=[NV6:Y]
MeterStyle=StyleTitle_2
Hidden=(#RulerHeight#<=300)?

[NV7]
Meter=string 
text=[NV7:Y]
MeterStyle=StyleTitle_2
Hidden=(#RulerHeight#<=350)?

[NV8]
Meter=string 
text=[NV8:Y]
MeterStyle=StyleTitle_2
Hidden=(#RulerHeight#<=400)?

[NV9]
Meter=string 
text=[NV9:Y]
MeterStyle=StyleTitle_2
Hidden=(#RulerHeight#<=450)?

[NV10]
Meter=string 
text=[NV10:Y]
MeterStyle=StyleTitle_2
Hidden=(#RulerHeight#<=500)?

[NV11]
Meter=string 
text=[NV11:Y]
MeterStyle=StyleTitle_2
Hidden=(#RulerHeight#<=550)?

[NV12]
Meter=string 
text=[NV12:Y]
MeterStyle=StyleTitle_2
Hidden=(#RulerHeight#<=600)?

[NV13]
Meter=string 
text=[NV13:Y]
MeterStyle=StyleTitle_2
Hidden=(#RulerHeight#<=650)?

[NV14]
Meter=string 
text=[NV14:Y]
MeterStyle=StyleTitle_2
Hidden=(#RulerHeight#<=700)?

[NV15]
Meter=string 
text=[NV15:Y]
MeterStyle=StyleTitle_2
Hidden=(#RulerHeight#<=750)?

[NV16]
Meter=string 
text=[NV16:Y]
MeterStyle=StyleTitle_2
Hidden=(#RulerHeight#<=800)?

[NV17]
Meter=string 
text=[NV17:Y]
MeterStyle=StyleTitle_2
Hidden=(#RulerHeight#<=850)?

[NV18]
Meter=string 
text=[NV18:Y]
MeterStyle=StyleTitle_2
Hidden=(#RulerHeight#<=900)?

[NV19]
Meter=string 
text=[NV19:Y]
MeterStyle=StyleTitle_2
Hidden=(#RulerHeight#<=950)?

User avatar
Yincognito
Posts: 1152
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Not sure if this is even possible, so have to ask.

Post by Yincognito »

Eclectic-tech already integrated the Hotkey stuff into the code, and using keys instead of mouse scroll should be easier and more comfortable to work with, so that's already settled. What you should know though, just by looking at eclectic-tech's code is that (Clamp(#YPosition#+2,0,#RulerWidth#)) basically does what I did by using Max() and Min() formulas: it constraints a value (#YPosition#+2 in this case) between two others (i.e. 0 and #RulerWidth#). My method was more rudimentar, and could have been more or less written in this case using Max(#YPosition#+2, 0) and Min(#YPosition#+2, #RulerWidth#).