Wings 3D Development Forum
Set Window Size - plugin - Printable Version

+- Wings 3D Development Forum (https://www.wings3d.com/forum)
+-- Forum: Wings 3D (https://www.wings3d.com/forum/forumdisplay.php?fid=1)
+--- Forum: Design & Development (https://www.wings3d.com/forum/forumdisplay.php?fid=6)
+--- Thread: Set Window Size - plugin (/showthread.php?tid=3185)



Set Window Size - plugin - micheus - 02-20-2025

It has been very annoying to have to adjust the window size when I want to share it on social media before using the Print Screen command. So, I decided to create a plugin to choose or set a dimension for a window.

The option will be added to Tools menu, just bellow to the Screenshot... option.

The dialog will allow us to choose between the Main window and any other floating/undocked window.
[Image: Set-Window-Size.png]

But, not everything is perfect and for some unknow reason setting a window's size and getting its value are not matching with the dimension we get after past it on Paint (for instance). It becomes a little small with a difference of -14px x -7px (WxH) - at least on Windows OS.

Link for download: wpc_tools_win_resize.tar


RE: Set Window Size - plugin - edb - 03-02-2025

Hello micheus,

micheus Wrote:setting a window's size and getting its value are not matching with the dimension we get after past it on Paint (for instance).

The same occurs here (in windows 11): 14px by 7px. I wonder if it is wxWidgets or windows API.


RE: Set Window Size - plugin - micheus - 03-02-2025

I have no clue from where this is coming. I still need to check on Linux, but no much free time now to "debug" things like this. So, I just leaved it this way because it was not possible to find a safe workaround. The amount can change if using screen scaling (if I'm not wrong).


RE: Set Window Size - plugin - edb - 03-02-2025

Hello micheus,

I notice that when I bring the cursor towards the window, it becomes a resize cursor up to about 7 pixels on the left, bottom and right (but not the top, it starts at the title bar).

It might be that the window borders for (some?) apps in recent windows versions is invisible, and setSize sets the size of this window with its decoration, which would have been a thick border in older windows but is now transparent.

It might help to compensate by adding the extra decoration border thickness into setSize, then the window will be a little bit bigger.

The size of the (invisible) border can found with wxSystemSettings::GetMetric() I think:

https://erlang.org/documentation/doc-16-rc1/lib/wx-2.5/doc/html/wxSystemSettings.html#getMetric/1

Probably wxSYS_EDGE_X and wxSYS_EDGE_Y will contain the information.

https://docs.wxwidgets.org/3.2/settings_8h.html#a0f2b19d7a3717cdbef5a04cb05ab8f26a2aa2f16d2b82c0439ff498ac6f273cc4


RE: Set Window Size - plugin - micheus - 03-02-2025

I just noticed - using my notebook - after my wife had changed the theme setting that it comes from that. Using the windows contrast themes it returns the correct dimensions.