Miniwindow autopositioning w/ multiple windows

Posted by Madcatz on Thu 06 May 2010 02:44 PM — 5 posts, 19,129 views.

#0
When I have multiple miniwindows at (for example) autoposition 7 (center top-bottom on right), is there a way to know what physical order they'll be displayed in? Is it order of first creation? Or _is_ there a reliable way to know?

By "order", I mean position from top to bottom, not the temporal order that they're displayed.
USA #1
They use alphabetical (or more precisely, ASCII-based) order determined by the window names. Window "AAA" is drawn before (below) "ZZZ", which is itself drawn before (below) "lol" (because lowercase letters come after uppercase letters in ASCII).
Australia Forum Administrator #2
Quite right. And the physical and temporal order are related, in that the earlier it is drawn the "lower" it is. So the window named B will overlap (be on top of) the window named A.

You can still use the Plugin ID to make your window names unique, just put something in front of it, eg.


window1 = "A_" .. GetPluginID ()
window2 = "B_" .. GetPluginID ()

Australia Forum Administrator #3
I notice you are specifically asking about mode 7, but I think my answer is still correct. When working which ones to show where, it still respects that name order. This alias will test it:


<aliases>
  <alias
   match="overlap"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>

WindowCreate ("1", 0, 0, 100, 100, 6, 0, ColourNameToRGB ("cyan")) 
WindowCreate ("2", 0, 0, 100, 100, 7, 0, ColourNameToRGB ("red")) 
WindowCreate ("3", 0, 0, 100, 100, 7, 0, ColourNameToRGB ("blue")) 
WindowCreate ("4", 0, 0, 100, 100, 7, 0, ColourNameToRGB ("yellow")) 
WindowCreate ("5", 0, 0, 100, 100, 7, 0, ColourNameToRGB ("green")) 
WindowCreate ("6", 0, 0, 100, 100, 8, 0, ColourNameToRGB ("magenta")) 

WindowShow "1"
WindowShow "2"
WindowShow "3"
WindowShow "4"
WindowShow "5"
WindowShow "6"

</send>
  </alias>
</aliases>


Template:pasting
For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.


As you shrink the window down, you will notice that the top and bottom squares (cyan and magenta) remain in place, and that the middle ones disappear in reverse sequence (ie. green disappears first since it is drawn last).

Note that in this mode the windows don't actually overlap at all, they only get drawn if they can be drawn in full. If you want them to overlap, use the "absolute position" flag instead, then they will always be drawn, and then use the name to control the drawing sequence.
Amended on Thu 06 May 2010 08:48 PM by Nick Gammon
#4
Perfect, that'll work for what I need, I think. Have a bunch of windows all drawn with position 7, and was wanting the user to be able to control what order they were listed. Thanks for the help.