B4J Question Undecorated and Snap Layouts

Cableguy

Expert
Licensed User
Longtime User
Hi guys,

Under Windows 11 there is the new snap layouts feature, that allows the user to snap a layout to a pre-defined place/size.
In JFX this works out of the box with a Decorated Form... But, how to call that feature programmatically when designing our own decorations in a TRANSPARENT form?
 

Cableguy

Expert
Licensed User
Longtime User
Not sure if it's the same thing, I haven't seen Windows 11. But windows 10 has a snap to area as well. I simulated that in my Replacement Titlebar library. It may help if you want to look at it.
Actually I'm refering to this:
1695984406737.png

This is a sort of "context pop-up" when hovering the Restore/Maximize buttons
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
Ahh OK, no not seen that. You could still use a popup with the template and calculate the size required. But if the drop points are user defined, You may not be able to read them from the OS.

And the thing that is missing from the Titlebar is selecting the other windows to reposition. For example when the window is dropped in a 'half screen' position Windows allows you to choose another window to fill the other half.

Theoretically you could use the JNA to get a list of all of the windows and allow selection of the windows to position as appropriate, but is it really worth it?
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
I did find this, that targets exactly this case scenario of a custom title bar
Yes, that is what the link I posted is using. There is no Jar library file, so it would have to be re-written in B4x using JavaNativeAccess (JNA) , not a particularly easy task though.
 
Upvote 0
Top