From 426936d182b0d2e8b60de65e2cad86c49d09faf6 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 5 Mar 2004 21:17:06 +0000 Subject: [PATCH] Change wxMSW to use WidthDefault and HeightDefault for window sizes, like the other platforms do. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26099 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/window.cpp | 51 ++++++++++++++++++++-------------------------- 1 file changed, 22 insertions(+), 29 deletions(-) diff --git a/src/msw/window.cpp b/src/msw/window.cpp index d3eab805ef..9a4db98241 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -2993,8 +2993,6 @@ bool wxWindowMSW::MSWGetCreateWindowCoords(const wxPoint& pos, { // yes, those are just some arbitrary hardcoded numbers static const int DEFAULT_Y = 200; - static const int DEFAULT_W = 400; - static const int DEFAULT_H = 250; bool nonDefault = false; @@ -3032,36 +3030,31 @@ bool wxWindowMSW::MSWGetCreateWindowCoords(const wxPoint& pos, this and ignore any attempts to change the window size to the size it already has - so no WM_SIZE would be sent. */ - if ( size.x == -1 ) - { - // we don't use CW_USEDEFAULT here for several reasons: - // - // 1. it results in huge frames on modern screens (1000*800 is not - // uncommon on my 1280*1024 screen) which is way too big for a half - // empty frame of most of wxWindows samples for example) - // - // 2. it is buggy for frames with wxFRAME_TOOL_WINDOW style for which - // the default is for whatever reason 8*8 which breaks client <-> - // window size calculations (it would be nice if it didn't, but it - // does and the simplest way to fix it seemed to change the broken - // default size anyhow) - // - // 3. there is just no advantage in doing it: with x and y it is - // possible that [future versions of] Windows position the new top - // level window in some smart way which we can't do, but we can - // guess a reasonably good size for a new window just as well - // ourselves - w = DEFAULT_W; - h = DEFAULT_H; - } - else - { - // and, again as above, we can't set the height to CW_USEDEFAULT here - w = size.x; - h = size.y == -1 ? DEFAULT_H : size.y; + + // we don't use CW_USEDEFAULT here for several reasons: + // + // 1. it results in huge frames on modern screens (1000*800 is not + // uncommon on my 1280*1024 screen) which is way too big for a half + // empty frame of most of wxWindows samples for example) + // + // 2. it is buggy for frames with wxFRAME_TOOL_WINDOW style for which + // the default is for whatever reason 8*8 which breaks client <-> + // window size calculations (it would be nice if it didn't, but it + // does and the simplest way to fix it seemed to change the broken + // default size anyhow) + // + // 3. there is just no advantage in doing it: with x and y it is + // possible that [future versions of] Windows position the new top + // level window in some smart way which we can't do, but we can + // guess a reasonably good size for a new window just as well + // ourselves + if ( size.x == -1 || size.y == -1) + { nonDefault = true; } + w = WidthDefault(size.x); + h = HeightDefault(size.y); AdjustForParentClientOrigin(x, y); -- 2.47.2