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 ➜ Easy auto-offset positioning

Easy auto-offset positioning

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


Posted by Larkin   (278 posts)  Bio
Date Fri 22 Jan 2010 02:18 AM (UTC)
Message
I've been hunting through help files, plugins, and posts, but I haven't found a suitable answer yet. Basically, I have a background image in the lower left corner, and now I want to render various gauges on top of it at certain locations. Is there a convenient way to specify the coordinates such that the gauges are offset correctly from the corner?

I was hoping that the top/left would be translated to the bottom/left when I specified bottom-left positioning, but it seems now like absolute positioning is the only way to really accomplish this and that doesn't seem quite right, either.
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Fri 22 Jan 2010 02:41 AM (UTC)
Message
The auto-positioning will only really work with a single window. One approach would be to draw on top of that, by getting the background window's position using WindowInfo selectors 10 to 13, however that might conceivably be slightly behind, if all the windows are drawn at once.

What you probably need to do is work out from the background window's position (possibly forcing a repaint the very first time, as it won't have a position until the first refresh).

After that, use OnPluginWorldOutputResized to know when you need to recalculate (using absolute positions).

Or, on OnPluginWorldOutputResized simply get the output window's size, which should give you the lower edge for your other windows (the left obviously will be zero).

- Nick Gammon

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

Posted by Larkin   (278 posts)  Bio
Date Reply #2 on Fri 22 Jan 2010 01:20 PM (UTC)
Message
Thanks for the advice. I've gotten my gauges where I want them now, except that they don't move when I resize. Now, I know I can use a plugin and catch the resizing event. However, the InfoBox module somehow avoids this and my gauges still move with my panel nicely. I can't quite figure out the trick to that, though. Too much code to go through...
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.


16,035 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.