]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/dialog.cpp
drawing optimization fix
[wxWidgets.git] / src / msw / dialog.cpp
index 85ba82edd0503e4cb07b903e79ad2235c35c50d4..8f5afe79e7df0e52e4e71b00f25ec5796d54eb1f 100644 (file)
@@ -78,7 +78,6 @@ wxDialog::wxDialog(void)
   m_modalShowing = FALSE;
 
   SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
-  SetDefaultBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
 }
 
 bool wxDialog::Create(wxWindow *parent, wxWindowID id,
@@ -89,7 +88,6 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID id,
            const wxString& name)
 {
   SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
-  SetDefaultBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
   SetName(name);
   
   if (!parent)
@@ -523,8 +521,8 @@ void wxDialog::OnOK(wxCommandEvent& event)
             EndModal(wxID_OK);
         else
         {
-        SetReturnCode(wxID_OK);
-        this->Show(FALSE);
+            SetReturnCode(wxID_OK);
+            this->Show(FALSE);
         }
   }
 }
@@ -549,7 +547,7 @@ void wxDialog::OnCancel(wxCommandEvent& event)
 
 bool wxDialog::OnClose(void)
 {
-  // Behaviour changed in 2.0: we'll send a Cancel message by default,
+    // Behaviour changed in 2.0: we'll send a Cancel message by default,
     // which may close the dialog.
     // Check for looping if the Cancel event handler calls Close()
 
@@ -560,13 +558,13 @@ bool wxDialog::OnClose(void)
 
     closing.Append(this);
 
-  wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
-  cancelEvent.SetEventObject( this );
-  GetEventHandler()->ProcessEvent(cancelEvent);
+    wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
+    cancelEvent.SetEventObject( this );
+    GetEventHandler()->ProcessEvent(cancelEvent);
 
     closing.DeleteObject(this);
 
-  return FALSE;
+    return FALSE;
 }
 
 void wxDialog::OnCloseWindow(wxCloseEvent& event)
@@ -576,6 +574,8 @@ void wxDialog::OnCloseWindow(wxCloseEvent& event)
     {
         this->Destroy();
     }
+    else
+        event.Veto(TRUE);
 }
 
 // Destroy the window (delayed, if a managed window)
@@ -592,7 +592,6 @@ void wxDialog::OnSysColourChanged(wxSysColourChangedEvent& event)
   Ctl3dColorChange();
 #else
   SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
-  SetDefaultBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
   Refresh();
 #endif
 }