From 00f7f5a71f431998aa13fa613c89dbcf60b56c28 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 16 Jan 2008 01:49:36 +0000 Subject: [PATCH] don't enable disabled windows when showing them (patch 1871879) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51230 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 4 ++++ src/msw/toplevel.cpp | 12 ++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 4a74bbbeaf..5f5f165353 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -321,11 +321,15 @@ All (GUI): - Added wxWindow::GetNextSibling() and GetPrevSibling() - Improve wximage::ResampleBox() (Mihai Ciocarlie) - Implemented ScrollList() in generic wxListCtrl (Tim Kosse) +- Fixed wxXmlResource::GetText() to convert data to current locale's + charset in ANSI build. wxMSW: - Fix rare bug with messages delivered to wrong wxSocket (Tim Kosse) - Fix setting icons when they have non-default (16*16 and 32*32) sizes +- Fixed wxLocale::GetInfo to use the C locale. +- Don't enable disabled windows when showing them (Harry McKame). wxGTK: diff --git a/src/msw/toplevel.cpp b/src/msw/toplevel.cpp index 8a22cb54a1..d0e47ea963 100644 --- a/src/msw/toplevel.cpp +++ b/src/msw/toplevel.cpp @@ -660,10 +660,14 @@ bool wxTopLevelWindowMSW::Show(bool show) } else // just show { - if ( GetWindowStyle() & wxFRAME_TOOL_WINDOW ) - nShowCmd = SW_SHOWNA; - else - nShowCmd = SW_SHOW; + // we shouldn't use SW_SHOW which also activates the window for + // tool frames (as they shouldn't steal focus from the main window) + // nor for the currently disabled windows as they would be enabled + // as a side effect + if ( HasFlag(wxFRAME_TOOL_WINDOW) || !IsEnabled() ) + nShowCmd = SW_SHOWNA; + else + nShowCmd = SW_SHOW; } } else // hide -- 2.45.2