Shell size constraints [message #1849524] |
Sun, 23 January 2022 16:57 |
Marco Maccaferri Messages: 147 Registered: July 2009 |
Senior Member |
|
|
Hi,
I'm looking for a way to allow the user to resize a shell window with some constraints, for example, limit the size so it can contain an integer number of cells of a fixed size. If the cell is 10x20 pixels the user can resize to 100x200 pixels (contains 10x10 cells) but if the user resize to say 105x200 it should automatically resize to 100x200, same for the vertical size.
So far I have used a control listener to calculate the nearest size and re-set the shell size to it. It sort of works on Windows, on Linux it works with some quirks, don't know if it works on Mac.
I was wondering if there is a better, compatible, way to do something like that ?
Any example that I can look at ?
Thanks for any suggestion.
Best regards,
Marco
|
|
|
Powered by
FUDForum. Page generated in 0.04500 seconds