It is currently April 19th, 2024, 5:11 pm
Dragging meters inside the skin???
-
- Posts: 3
- Joined: March 30th, 2017, 12:15 pm
Dragging meters inside the skin???
Is it possible to drag meters inside the skin? Or at least some workaround, something like measuring cursor position and changing meter position with bangs? Thanks in advance!
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Dragging meters inside the skin???
No, there is no practical way to do that. Meters are just not separate objects in the final rendered skin window, and Rainmeter really can't constantly detect the mouse position, or react to a "drag".
-
- Rainmeter Sage
- Posts: 16144
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Dragging meters inside the skin???
Am I misunderstood something? Because I would say that's possible. Dragging a meter indeed is harder to be done (however maybe even this would be possible), but measuring the position of the cursor when click, then moving a meter to this position, is definitely possible.sssmith wrote:Is it possible to drag meters inside the skin? Or at least some workaround, something like measuring cursor position and changing meter position with bangs? Thanks in advance!
For example:
Code: Select all
[Rainmeter]
Update=-1
AccurateText=1
SkinWidth=500
SkinHeight=350
BackgroundMode=2
SolidColor=80,80,80,160
LeftMouseUpAction=[!SetVariable X "$MouseX$"][!SetVariable Y "$MouseY$"][!UpdateMeter "MeterRemaining"][!Redraw]
[Variables]
X=250
Y=175
[MeterRemaining]
Meter=STRING
X=#X#
Y=#Y#
FontColor=220,220,220
FontEffectColor=0,0,0,150
StringEffect=Shadow
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=CENTERCENTER
AntiAlias=1
Text=Move this
DynamicVariables=1
sssmith, is this what you wanted?
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Dragging meters inside the skin???
That may work for this user, but I would argue that it is quite far from a "drag" operation.
Dragging is not about where your mouse is. It's about "grabbing" an object and dragging it to some other position. The mouse might be anywhere on the object, that is irrelevant. What you really want to capture is the "movement" of the mouse while the mouse button is being held down. That movement is then applied to the X and Y of the object that is selected, in real time.
Anyway, the answer to the question as asked is "you can't'.
Dragging is not about where your mouse is. It's about "grabbing" an object and dragging it to some other position. The mouse might be anywhere on the object, that is irrelevant. What you really want to capture is the "movement" of the mouse while the mouse button is being held down. That movement is then applied to the X and Y of the object that is selected, in real time.
Anyway, the answer to the question as asked is "you can't'.
-
- Rainmeter Sage
- Posts: 16144
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Dragging meters inside the skin???
For sure it's not, but sssmith initially said:jsmorley wrote:That may work for this user, but I would argue that it is quite far from a "drag" operation.
That's what could easily be done.sssmith wrote:measuring cursor position and changing meter position with bangs
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Dragging meters inside the skin???
Fair enough, the answer to a question like "can I change the position of a meter with a mouse click?" is yes. The answer to "can I drag a meter" is no. In a drag operation the position of the mouse is of little or no interest. Only the amount and direction of "movement" of the mouse matters. That movement is then applied to the position of the object, nothing to do with the position of the mouse.balala wrote:For sure it's not, but sssmith initially said:
That's what could easily be done.
Rainmeter could in theory constantly poll the position of the mouse when the mouse button is held down, and return some X and Y "movement" values, and I think there is even a 3rd-party plugin that could get you close to that. My bigger concern with any kind of "dragging" in Rainmeter is the absolute blizzard of skin redraws that would be needed to get anything even approaching "real time". I can't see a way we could support that which wouldn't be ugly, laggy, and inefficient. The real problem isn't with constantly knowing where the mouse "is", but "what do you do with that information?" in an environment that is based on an Update cycle, not event driven.
-
- Posts: 3
- Joined: March 30th, 2017, 12:15 pm
Re: Dragging meters inside the skin???
Thanks for replies! I now understand that dragging meters inside a skin is not possible at the moment and a bit difficult to implement... Then maybe it is possible to create parent/child relations between skins? So instead dragging meter I can make it as separate skin, connect it to main skin and then drag it as any other skin, at the same time when I drag main skin child skin will move with it.....?
Changing the position of a meter with a mouse click will work in my case too, but dragging would be perfect.... Thanks again!
Changing the position of a meter with a mouse click will work in my case too, but dragging would be perfect.... Thanks again!
-
- Rainmeter Sage
- Posts: 16144
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Dragging meters inside the skin???
That's possible, however, if I'm not wrong, maybe it's not very efficient.sssmith wrote:Then maybe it is possible to create parent/child relations between skins? So instead dragging meter I can make it as separate skin, connect it to main skin and then drag it as any other skin, at the same time when I drag main skin child skin will move with it.....?
Add the following measure to your "main" skin (which will move the "child" skin):
Code: Select all
[MeasureDrag]
Measure=Calc
Formula=( #CURRENTCONFIGX# + #CURRENTCONFIGY# )
OnChangeAction=[!Move "#CURRENTCONFIGX#" "#CURRENTCONFIGY#" "TheOtherConfig"]
DynamicVariables=1
It seems there always will be a delay between the two skins. I'm not sure how this could be avoided, but better I'd say you can't do more than this.