It is currently April 19th, 2024, 8:58 am

Locating the position of one config from another config

Get help with creating, editing & fixing problems with skins
Wyld_Goose
Posts: 36
Joined: May 12th, 2012, 3:23 am

Locating the position of one config from another config

Post by Wyld_Goose »

Like the title says, Is it possible to locate the position of one config from another? I want to be able to !ActivateConfig one skin in relation to the position another skin. If ConfigA is W=300 H=500 and is draggable , I want ConfigB to "Activate" in the position (ConfigA's X location+ 300). This is just an example to get a handle on how it maybe done. I understand this example runs into an inherent problem if ConfigA is to close to the right edge of the screen. But again it's just an example to get an idea on how this might be done.
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: Locating the position of one config from another config

Post by Kaelri »

What I would do is add a measure to ConfigA which detects changes in #CURRENTCONFIGX# and #CURRENTCONFIGY#, and writes the X/Y values to an include file that ConfigB will read when it loads.

In ConfigA, something like this:

Code: Select all

[Variables]
MyX=0
MyY=0

[MeasureMyX]
Measure=Calc
DynamicVariables=1
Formula=(#CURRENTCONFIGX# = #MyX#) && (#CURRENTCONFIGY# = #MyY#)
IfEqualValue=0
IfEqualAction=[!SetVariable MyX #CURRENTCONFIGX#][!SetVariable MyY #CURRENTCONFIGY#][!WriteKeyValue Variables ConfigAX #CURRENTCONFIGX# "Position.inc"][!WriteKeyValue Variables ConfigAY #CURRENTCONFIGY# "Position.inc"]
In ConfigB:

Code: Select all

[Rainmeter]
OnRefreshAction=!Move #ConfigAX# #ConfigAY#

@include=Positions.inc
Wyld_Goose
Posts: 36
Joined: May 12th, 2012, 3:23 am

Re: Locating the position of one config from another config

Post by Wyld_Goose »

Makes sense. Looks like the path I would have went down. Just didn't know if there was something else. I do find myself writing out an entire script only to find out there was a simpler "built-in" method that works just the same. Just seeing if this was the case. Thanx yet again