Controlling in which direction window resizes?
I am, through a script, resizing my parent window from a larger size to a smaller one and back to the larger one based on a button click. The basic window is designed to expand from larger window DOWN to a smaller window. However when I change the window size, the window resizes upwards, IE the window upper left never changes.
Is there any way to get the resize to work off say the bottom right instead of the upper left? I'm guessing there might be some pack setting that does this but all the pack stuff makes my head spin :p Note i'm talking about resize taking place via script (setting the window's size value) NOT via user resizing. |
I think maybe if you set all the child windows to pack location=bottom,right it might work but I am really not sure on that
|
No "easy" way to do this. No there isn't any setting to control where the window anchors when resized. I submitted this feature request many months ago.
No there isn't any way to do math on the location string to offset the window. Also requested this feature. The work around I came up with is to use a hidden dock window. Include a custom window matching the smaller size you want. Now give your resize script a line to set location to match the dock's location. An example of this can be seen in the Fetish6WayInventory mod. |
Quote:
Thanks for pointing out that I can't do any mathon the location to offset it because I woke up this morning thinking about trying that lol. I woulda been just butting my head against another wall I guess. Oh well this works for now. Just lock the window and turn in clickthrough and it works really nice. Thanks anyway :) |
The same "dock window" trick should work at any level. If you're docking a sub page of inventory.inventory, just make a hidden dummy page at the same lvl pre sized and positioned to the smaller settings, then have your script set the values equal to the dummy page.
Example Inventory |_ Inventory | |_Equipment | |_Dock2 |_Dock1 Say your Equipment page is 200x300 and you want it to resize down to 100x200 and shoved into the lower right corner. You'd set the Dock2 page to 100x200 and positioned into the lower right corner. Your script would be something like... Code:
OnPress="parent.Equipment.size=parent.Dock2.size parent.Equipment.location=parent.Dock2.location" |
Ah, I see what you are saying. Still use the same window, but have a dummy window that dictates the size and position of the main window.
Only problem I see with this is wouldn't that essentially be hardcoded? How would the user adjust the location of the dock unless I made the dummy window visible for positioning? |
Include a button in your main window to show the dock window. Make the dock user resizable and/or moveable.
Seriously, look at the Fetish6wayInventory mod ;) |
Quote:
As for looking at Fetish.. well I just prefer to build things like this from the ground up if I can. I learn more that way. |
Ok so I took a look at Fetish Nightfall. Not the code, but just loaded up and used the UI in game to see how it behaved. Slightly similiar to what i'm doing and I see how you did the whole docking window thing from the user perspective. Though what I noticed was that the collapse function rolls down the inventory similiar to what i'm doing but there was no dummy window that I could see, from the perspective of the user, that dictated where that ended up.
So I guess i'll take alook at the code and see what you did :) |
The collapse isn't actually resizing anything, it hides a taller subpage and shows the smaller subpage without changing parent window size.
However the zoom feature does actually change the window size and aligns it to a hidden dock window that can be shown and repositioned by the user with the "D" button ;) |
All times are GMT -5. The time now is 08:31 PM. |
vBulletin® - Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© MMOUI