ID:33455
 
Keywords: 40, interface
A couple things I would like some elaboration on:

Anchors: I know basically how they work, but what I am wondering is if I can create a map element that stays centered and stretches 50% as much as the window it is in stretches. I know the first anchor has to be set to 50,0 to keep it centered, but I don't know if it is possible to have it stretch and keep it centered. I could set it for Top Left and then 100,50 like in the guide, but then it would stretch to much horizontally. And 50% vertically. I want it to stretch 50% horizontally and vertically while at the same time remaining at the top center.

Tab, Child, and Grids: I have not seen any real guide or info on these. How do they work? How do you set them up?
I'm not sure if this is right but for your first problem:

1) Open your window and double click the title bar. Note down the width and height it tells you. Let these be Mx and My.

2) Double click your centred object. Note down its X and Y (top left coordinate) and width and height.

3) Go to its anchors and choose other. The first anchor's x = 100*X/Mx and y = 100*Y/My. The second anchor's y = 100*(Y+height)/MY and x = 100*(X + width)/Mx

As for question 2, I think tab/child/grid will have a use in later BYOND versions. I could be wrong but I remember hearing someone say something like that.
Those equations worked well, thank you.
I forgot to explain what in the world they mean.

The anchors ask for percentages. You can work out how far along your window is given its top left hand coordinate and its dimensions. It's just doing 100*position/maxposition.

I'm not sure if the percentage the anchors want are equal to how far along the object is in the window.
Thanks that makes a bit more sense now.
Child elements are fairly straight forward. Pretty much they just reference another window. To use them, place a child in the skin. Edit it and goto Options, and set left/top window ID to the name of the window you want to be placed inside it. You can also put one in the "Right/Bottom Window ID" to have a split effect, similar to how text and browser/info were split in the old interface. Now, create a new window and edit it. Set it's ID to the same one you used for the child, and under options, select "Is a pane". When the game is run, that window should appear where you placed the child element.

This is all I've figured out so far for grids:

mob/verb/TestWho()
winset(client,"whogrid","is-list=true;")
var/i=0
for(var/mob/Human/H in world)
winset(client,"whogrid","current-cell=1,[i];")
src<<output(H.name,"whogrid")
i++

I'm still looking for a way to just pass it a list and have it fill itself in.
Ok, I was wrong about question 2 then.

Also, I forgot to explain one more point. I think anchor #1 refers to the top left hand corner of the object you're anchoring and anchor #2 refers to the bottom right hand corner. That's just my interpretation from a bit of trial and error though - it's quite possible that I'm wrong.
Yep, They're all in, just completely undocumented. I spent a good amount of time trying to get someone to tell me what a grid was, with no luck*. Experimentation ftw!


*I'm tempted to make a short tutorial post about what I've found so far
That might be a good idea, or even have like a 4.0 guild where people can post tips and tricks on what they have found out.