Miniwindow Z-level priority

Posted by Grek on Fri 08 Aug 2008 09:59 PM — 7 posts, 27,315 views.

Sweden #0
How is the z-level priority decided?

I'm drawing multiple Miniwindows over each other, however I have no clue which one will show up at top.


Amended on Fri 08 Aug 2008 10:23 PM by Grek
USA #1
You can set a flag for "draw underneath", other than that last WindowShow() wins, from what I've seen.
Sweden #2
Well, I'm trying to draw a miniwindow on top of another miniwindow, both should be on top of mud's text. Tried setting WindowShow in the order I wanted them but it's not working.

Also, is there any way to remove a single text rectangle?
Australia Forum Administrator #3
See: http://www.gammon.com.au/mushclient/mw_other.htm#DrawingOrder

No, you can't remove a single text rectangle, short of drawing something you happened to know was underneath it back again.

The drawing is quite fast, I have found with something like the mapper, that simply drawing the entire window with your background colour and then redrawing everything, works acceptably fast.

But if you mean, you want an elaborate window with some text in the middle, that might change, just store the text rectangle position, and clear it whenever you want to remove it (by clear, I mean draw the underlying background colour on top of it).
Australia Forum Administrator #4
WindowShow merely toggles on the "show" flag which controls if it will be shown next time the output window is drawn. The order in which you call WindowShow will have no effect.
Sweden #5
I think it would be great to add a z-level index to the windows, making the client draw them in order of z-index, if z-index is equal then draw in alphabetic order.

Would make coding custom decorations such as borders, labels etc a bit easier.

Australia Forum Administrator #6
You should be able to achieve this without having to use multiple (visible) windows.

Check out http://www.gammon.com.au/mushclient/mw_images.htm#WindowImageFromWindow

You could make extra windows (for your decorations etc.) and then use WindowImageFromWindow and then WindowDrawImage to draw that other window on top of the current miniwndow. That way you control the z-order yourself, whilst still maintaining different graphical elements in separate windows.