Override wxWindow::MSWGetCreateWindowCoords() in wxTopLevelWindow.
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 22 Apr 2010 11:21:21 +0000 (11:21 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 22 Apr 2010 11:21:21 +0000 (11:21 +0000)
commitfa5f4858288ebd8e031b9d3e89d4ec89e8f212e7
treefce5215ca05969f36908c7030157953b939e3a42
parentdb890987c6b04da48b0f4b2523c74aa4227bc04a
Override wxWindow::MSWGetCreateWindowCoords() in wxTopLevelWindow.

The old code was messy because it handled both top level and child windows at
wxWindow level when they need quite different treatment. This resulted in
several errors: first, wxWindow versions of WidthDefault and HeightDefault
were used to determine the initial size even of top level windows which was
clearly wrong as it created tiny windows (20*20). Second, CW_USEDEFAULT could
be used for child window for which this shouldn't be done.

Fix this by making MSWGetCreateWindowCoords() virtual and overriding it in
wxTopLevelWindow. This makes the code much simpler and more obviously correct.

Also make MSWGetCreateWindowCoords() void, as nobody was using its return
value anyhow (and the old version also had a bug in it and wrongly returned
true when default size was passed to it).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64101 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
include/wx/msw/toplevel.h
include/wx/msw/window.h
src/msw/toplevel.cpp
src/msw/window.cpp