Make the modal print preview window behave like a modal dialog.

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
This commit is contained in:
Václav Slavík 2012-08-07 10:12:09 +00:00
parent b9171a1730
commit 46aa0c9e7b

View 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();