]> git.saurik.com Git - wxWidgets.git/commitdiff
Make the modal print preview window behave like a modal dialog.
authorVáclav Slavík <vslavik@fastmail.fm>
Tue, 7 Aug 2012 10:12:09 +0000 (10:12 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Tue, 7 Aug 2012 10:12:09 +0000 (10:12 +0000)
It's unexpected for a modal dialog window to show up in the taskbar as
app's another window. It also shouldn't be possible to minimize a modal
window, because it's very confusing when a window is unresponsive
without a clear reason, because the modal child is hidden in the
taskbar.

Set wxFRAME_NO_TASKBAR and remove wxMINIMIZE_BOX to fix this. Do it only
for wxPreviewFrame_AppModal.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72301 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/prntbase.cpp

index 4aebfb1b5165056d35f279a8e0e98c9ad43e4e55..d78cc045953a7c267f4258d28a9462dd44670b1c 100644 (file)
@@ -1705,6 +1705,13 @@ void wxPreviewFrame::InitializeWithModality(wxPreviewFrameModalityKind kind)
             break;
     }
 
+    if ( m_modalityKind != wxPreviewFrame_NonModal )
+    {
+        // Behave like modal dialogs, don't show in taskbar. This implies
+        // removing the minimize box, because minimizing windows without
+        // taskbar entry is confusing.
+        SetWindowStyle(GetWindowStyle() & ~wxMINIMIZE_BOX | wxFRAME_NO_TASKBAR);
+    }
 
     Layout();