Avoid annoying prompt when closing MDI sample with one window

Ask the user when closing the window with several MDI frames opened, if only
to demonstrate how to do it, but not if there is only one window as this is
just too annoying when using the sample for testing.
This commit is contained in:
Vadim Zeitlin
2016-01-30 21:30:43 +01:00
parent aa4aa74154
commit e89fc9c152

View File

@@ -253,7 +253,7 @@ wxMenuBar *MyFrame::CreateMainMenubar()
void MyFrame::OnClose(wxCloseEvent& event)
{
unsigned numChildren = MyChild::GetChildrenCount();
if ( event.CanVeto() && (numChildren > 0) )
if ( event.CanVeto() && (numChildren > 1) )
{
wxString msg;
msg.Printf("%d windows still open, close anyhow?", numChildren);