It is currently May 3rd, 2024, 8:28 pm

Inquiries on Spatial Management and Skin Logistics

Get help with creating, editing & fixing problems with skins
RTTLP
Posts: 10
Joined: January 8th, 2011, 2:28 am

Inquiries on Spatial Management and Skin Logistics

Post by RTTLP »

Hey guys, I'm back again!

Sorry if it seems like I'm flooding the forums. When I get my mind set on doing something, I tend to really pursue it, and as I've said before, I've bit off a little more than I can easily chew here.

In any case, I have two questions this time, one is mechanical and one is probably based more on personal preference and what you guys think is the most efficient way to get the job done.

1) If I make 2 skins/boxes/windows in a single .ini file, I'm aware that I can use "r" to make the second box move in relation to the other one. And leaving out the appended "r" results in the same origin point as the original box. Is there any way to get the second box to move independently, though? Preferably, I'd like to have the second one clip to the right edge of the screen totally independent of the original box.

which leads me into the second question...

2) I'm aware that when I make a .ini file, I can make multiple "windows" in this .ini. I can also use !bangs to activate skins within that same ini file or activate separate ini files (I think--I still need to test this some more) so I have to wonder the following:
In my situation, where I'm using a small, transparent window that lines up with an image on my wallpaper to make another, spatially separate skin appear on mouseover, would it be wiser (both system-wise and ease-of-programming-wise) to integrate both of these windows into the same .ini file or to have a separate .ini file for each? Furthermore, since I'll be doing this with MULTIPLE different origin/result windowsets within the same skin, does the answer change?

As always, thanks in advance!
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Inquiries on Spatial Management and Skin Logistics

Post by jsmorley »

Let me take a run at this... It is important that an understanding is had about how a skin works in this regard.

A single .ini file is a "skin". It has X and Y coordinates that are relative to your screen. Normally this is set by dragging the skin wherever you want it, but it can also be manually set with WindowX and WindowY in Rainmeter.ini, or moved by the !Move bang.

Things that are displayed as a part of a skin are "meters". There are all kinds of meters, images, strings, bars, etc. What they all have in common is that they also have X and Y coordinates. These coordinates are however relative to the "skin" they belong to, and NOT relative to your screen. So you simply can't have a meter in a skin align itself to the the edge of your screen in any case, before we concern ourselves about moving one meter dependent or independent of any other. A meter can certainly be set to be relative to the top or bottom or left or right or center of the parent skin, but that has nothing at all to do with the edge of your screen unless you drag or otherwise move the entire skin there.

Don't want to dwell on terminology here, but it should be clear that there are no "separate windows" in any skin. A "skin" is more or less a "window" in Windows terms, and a "meter" is a graphical object drawn on that window. It's a bit like an "Are you sure?" dialog that Windows pops up. You can drag the dialog around on the screen, it is after all a window. The "OK" button on it cannot be dragged separate from the window, and while in code you can put that button anywhere you want on the dialog, you can't tell the button to be "at the left edge of your screen", nor can you set that button outside of the dialog window.

So the short answer to your question is "no". You can use "r" and "R" to make meters relative to each other, you can use all kinds of formulas to determine what X and Y should be for a meter, you can use bangs like !MoveMeter or !MoveMeterGroup to move things around based on conditions like the return value of a measure, there are tons of ways to manage how meters position within a skin. The key is "within a skin" though.

With my explanation of the mechanics of a skin in mind, my gut reaction to your second question is "it depends". You can make one huge skin that is big enough (I'm talking about the W and H of the entire skin, not any individual meter) and then position the meters inside the skin in such a way that you can drag the skin and it will line up the meters where you want them on your wallpaper. You can also make separate skins, with for instance one meter in each, then drag these skins separately so they line up where you want them on the wallpaper. I lean toward the second approach a bit, as it allows things to be a bit independent of your screen resolution, but the first approach is certainly simpler to both create and manage.
RTTLP
Posts: 10
Joined: January 8th, 2011, 2:28 am

Re: Inquiries on Spatial Management and Skin Logistics

Post by RTTLP »

As usual jsmorley, your input is both extremely informative and greatly appreciated!

After reading through your post, I think I'm going to go with "option 2" and have separate files for each, as I would hope to one day be able to publish this skin in case anyone finds it useful, and it certainly makes the positioning of the meters a much less daunting task. The somewhat clunky & monotonous programming is a small sacrifice to pay for the versatility I feel this would offer.

I would like to especially thank you for clarifying me on the terminology. As I'm sure you could tell, I was only one step away from calling everything "a thingie," and my lack of knowledge was making me worry that my explanations were rendered useless!
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Inquiries on Spatial Management and Skin Logistics

Post by jsmorley »

RTTLP wrote:As usual jsmorley, your input is both extremely informative and greatly appreciated!

After reading through your post, I think I'm going to go with "option 2" and have separate files for each, as I would hope to one day be able to publish this skin in case anyone finds it useful, and it certainly makes the positioning of the meters a much less daunting task. The somewhat clunky & monotonous programming is a small sacrifice to pay for the versatility I feel this would offer.

I would like to especially thank you for clarifying me on the terminology. As I'm sure you could tell, I was only one step away from calling everything "a thingie," and my lack of knowledge was making me worry that my explanations were rendered useless!
Not to worry, we were all new at this stuff, and you are getting it just fine. The single most difficult part of Rainmeter is coming to grips with the somewhat elusive "terminology" that both allows you to communicate questions effectively and to wrap your head around how it all fits together. It just takes making one or two skins yourself from scratch, even simple ones (and I recommend starting reasonably simple) to have it all become clear though. It's really not hard stuff at all, just has a big "first step" to watch out for.
User avatar
Nebbishatudub
Posts: 26
Joined: January 28th, 2011, 4:57 am
Location: Washington, DC

Re: Inquiries on Spatial Management and Skin Logistics

Post by Nebbishatudub »

Hopefully I'm not befuddling an already clarified issue, but you can do what you were originally asking (although by the time you finish reading this you may not want to).

For these first answers, I'll assume that you want to move the two "windows" separately, independent of each other.

Independent Movement
If you'd simply like to make a "second window" (comprised of meters in your skin) that hugs along the edge of your screen and won't move, that's really straightforward.
  • First and foremost, I would really recommend a separate skin for this. It just makes things a lot easier and tends to use less resources unless you want whatever this skin shows to update at the same time (or rate) as some other thing Rainmeter is already doing. Once you've made the skin:
    • 1) Right click on the skin
      2) Click on Settings
      3) Then deselect < Draggable >
  • Read through this little Rainmeter Tips and Tricks article. This describes a few variables which are really helpful if you want to align things to parts of your screen. Here is one really quick example of making a box that hugs the right side of your screen:

    Code: Select all

    [SimpleWhiteBox]
    Meter=IMAGE
    SolidColor=255, 255, 255, 255
    X=(#SCREENAREAWIDTH#-123)
    Y=(#WORKAREAHEIGHT#-500)
    W=123
    H=70
    Note: Pay careful attention though when using these variables. Remember that things start drawing from the X and Y you designate, but then draw in a preset direction. Therefore, if you want things to hug the right hand side of your screen, you need to take the screenwidth and then subtract the width of whatever your meter is drawing.
  • However, this should really only be done for a skin which you don't want to move around (since you're hard coding exactly where it should be).
If however you'd like to be able to move this "second window" independent of your first skin, I'd recommend that you go about your coding as you probably already have.
  • Set both the X and Y for each of your meters to start at whatever you want relative to the lower left corner of the window you're drawing.
  • Then just make sure that both < Draggable > and < Snap to Edges > are selected in the settings drop down menu.
  • You'll be able to easily drag your skin along the edges of your screen (or have it easily align to any other skins already active).
Dependent Movement
However, let's say you want to be difficult! You want to be able to move one set of meters (which will draw your first "window") and have a second set of meters ("window 2") move with that AND hug some edge of your screen.

First and foremost, why on EARTH are you doing this? I'm sure you have a great reason, I'm just wondering what it is.
  • 10 minutes later...
Sadly, after looking through all of my old skins (many of which have been hacked to pieces), I haven't been able to find the example I was hoping to paste here. I don't remember the literal code, but you can look through a lot of the tips and tricks and the manual to figure out most of it. To be honest, the thought process isn't all that difficult.
  • Skin1 will construct your first Independently movable window. This is the one that you'll be using your mouse on to drag it around the screen.
  • Skin2 constructs the Dependent window. When Skin1 is moved around, Skin2 will move around with it while hugging the right hand side of the screen.
  • Don't worry about using the #SCREENAREAWIDTH# variables when writing the meters which will draw your windows. Start with X=0 and Y=0 and go from there. Just make sure that they look nice and pretty.
  • Now is the tricky part, and the part where I get fuzzy.
    • If memory serves (and that's a big if), way back in the dark ages of Rainmeter you could call a series of !bangs that would move Skin2 as you moved Skin1. It was ugly, required a lot of !RainmeterRedraws, and was really intensive.
    • Now though, I'm pretty sure that you can do the same thing using LUA. It's actually pretty simple, but if you feel this might be a bit over your head, maybe one of the other more experienced users out there would like to give it a try. Check out this page for some more hints.
    • Get the X,Y coordinates of Skin1 every redraw, then move Skin2's to the same Y coord and redraw it.

Now, regarding your second question
If all you're doing is showing "window2" when you mouseover "window1," and not moving things, check out the Bang section. You can create different "groups" for meters, which helps you to organize them.
  • Classify all of the meters which draw "window1" with Group=MainWindow, and mark all the meters drawing your second window with Group=SubWindow.
  • Also make sure that you set the meters in the SubWindow group to be Hidden
  • Then, when you mouseover anything in MainWindow, show the meters in group SubWindow.
  • When your mouse leaves SubWindow then set it to be hidden again.
Hopefully this wasn't information overload, but one more quick note (which you might already know), remember that 'r' and 'R' are treated differently.