From b54238992fada5b370ff7ac7f0f62913622c5c5f Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 8 Jun 1999 07:01:10 +0000 Subject: [PATCH] Added wxFrame::MakeModal for MSW, (it's already there for GTK) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2706 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/msw/frame.h | 3 +++ src/msw/frame.cpp | 14 ++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/include/wx/msw/frame.h b/include/wx/msw/frame.h index 64e30f3e9b..c54d5f66f8 100644 --- a/include/wx/msw/frame.h +++ b/include/wx/msw/frame.h @@ -78,6 +78,9 @@ public: // process menu command: returns TRUE if processed bool ProcessCommand(int id); + // make the window modal (all other windows unresponsive) + virtual void MakeModal(bool modal = TRUE); + // Set icon virtual void SetIcon(const wxIcon& icon); diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp index f5558c492d..2c459e4c3a 100644 --- a/src/msw/frame.cpp +++ b/src/msw/frame.cpp @@ -791,6 +791,20 @@ void wxFrame::IconizeChildFrames(bool bIconize) } } + +// make the window modal (all other windows unresponsive) +void wxFrame::MakeModal(bool modal) +{ + if (modal) { + wxEnableTopLevelWindows(FALSE); + Enable(TRUE); // keep this window enabled + } + else { + wxEnableTopLevelWindows(TRUE); + } +} + + // =========================================================================== // message processing // =========================================================================== -- 2.45.2