Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Miniwindows ➜ Miniwindow Z-level priority

Miniwindow Z-level priority

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Grek   Sweden  (12 posts)  Bio
Date Fri 08 Aug 2008 09:59 PM (UTC)

Amended on Fri 08 Aug 2008 10:23 PM (UTC) by Grek

Message
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.


Top

Posted by WillFa   USA  (525 posts)  Bio
Date Reply #1 on Fri 08 Aug 2008 11:21 PM (UTC)
Message
You can set a flag for "draw underneath", other than that last WindowShow() wins, from what I've seen.
Top

Posted by Grek   Sweden  (12 posts)  Bio
Date Reply #2 on Fri 08 Aug 2008 11:41 PM (UTC)
Message
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?
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #3 on Sat 09 Aug 2008 04:49 AM (UTC)
Message
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).

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #4 on Sat 09 Aug 2008 04:50 AM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Grek   Sweden  (12 posts)  Bio
Date Reply #5 on Sat 09 Aug 2008 11:20 AM (UTC)
Message
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.

Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #6 on Sat 09 Aug 2008 09:53 PM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


19,315 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.