From cca1624d2a0b06280494e0d3be857819a331f344 Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Thu, 23 Mar 2006 13:00:06 +0000 Subject: [PATCH] Centering maximized wxTLWs on screen should do nothing. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38300 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/dialogs/dialogs.cpp | 2 -- src/common/toplvcmn.cpp | 7 +++++-- src/msw/toplevel.cpp | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/samples/dialogs/dialogs.cpp b/samples/dialogs/dialogs.cpp index 2e5e93aa53..55bc4b3f28 100644 --- a/samples/dialogs/dialogs.cpp +++ b/samples/dialogs/dialogs.cpp @@ -383,9 +383,7 @@ bool MyApp::OnInit() myCanvas = new MyCanvas(frame); myCanvas->SetBackgroundColour(*wxWHITE); -#ifndef __WXWINCE__ frame->Centre(wxBOTH); -#endif // Show the frame frame->Show(true); diff --git a/src/common/toplvcmn.cpp b/src/common/toplvcmn.cpp index 1645b2bf97..d99000e5e2 100644 --- a/src/common/toplvcmn.cpp +++ b/src/common/toplvcmn.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: common/toplvcmn.cpp +// Name: src/common/toplvcmn.cpp // Purpose: common (for all platforms) wxTopLevelWindow functions // Author: Julian Smart, Vadim Zeitlin // Created: 01/02/97 @@ -187,6 +187,10 @@ void wxTopLevelWindowBase::DoCentre(int dir) rectParent = rectDisplay; } + // centering maximized window on screen is no-op + if((rectParent == rectDisplay) && IsMaximized()) + return; + // the new window rect candidate wxRect rect = GetRect().CentreIn(rectParent, dir); @@ -345,4 +349,3 @@ void wxTopLevelWindowBase::RequestUserAttention(int WXUNUSED(flags)) // it's probably better than do nothing, isn't it? Raise(); } - diff --git a/src/msw/toplevel.cpp b/src/msw/toplevel.cpp index c1bba3066e..82b65ed06b 100644 --- a/src/msw/toplevel.cpp +++ b/src/msw/toplevel.cpp @@ -724,8 +724,8 @@ void wxTopLevelWindowMSW::Maximize(bool maximize) bool wxTopLevelWindowMSW::IsMaximized() const { -#ifdef __WXWINCE__ - return false; +#if defined(__SMARTPHONE__) || defined(__POCKETPC__) + return true; #else return m_maximizeOnShow || ::IsZoomed(GetHwnd()) != 0; #endif -- 2.45.2