]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/dbgrptg.cpp
Don't generate any events from wxSpinCtrl and wxSpinCtrlDouble methods.
[wxWidgets.git] / src / generic / dbgrptg.cpp
index 4b96e9697549c6fc477f4bfbea64c8dcfb551b2a..99416162cee258c7cf43b1346458d3f755f09110 100644 (file)
@@ -4,9 +4,8 @@
 // Author:      Vadim Zeitlin, Andrej Putrin
 // Modified by:
 // Created:     2005-01-21
-// RCS-ID:      $Id$
 // Copyright:   (c) 2005 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
-// License:     wxWindows licence
+// Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
 // ============================================================================
 #endif // WX_PRECOMP
 
 #include "wx/filename.h"
-#include "wx/ffile.h"
+#ifdef wxUSE_FFILE
+    #include "wx/ffile.h"
+#else
+    #include "wx/file.h"
+#endif
 #include "wx/mimetype.h"
 
 #include "wx/statline.h"
 
 #ifdef __WXMSW__
     #include "wx/evtloop.h"     // for SetCriticalWindow()
+    #include "wx/scopeguard.h"
 #endif // __WXMSW__
 
 // ----------------------------------------------------------------------------
@@ -227,7 +231,7 @@ void wxDumpOpenExternalDlg::OnBrowse(wxCommandEvent& )
                      fname.GetPathWithSep(),
                      fname.GetFullName()
 #ifdef __WXMSW__
-                     , _("Executable files (*.exe)|*.exe|All files (*.*)|*.*||")
+                     , _("Executable files (*.exe)|*.exe|") + wxALL_FILES
 #endif // __WXMSW__
                      );
     if ( dlg.ShowModal() == wxID_OK )
@@ -333,9 +337,9 @@ wxDebugReportDialog::wxDebugReportDialog(wxDebugReport& dbgrpt)
     // ... and the list of files in this debug report with buttons to view them
     wxSizer *sizerFileBtns = new wxBoxSizer(wxVERTICAL);
     sizerFileBtns->AddStretchSpacer(1);
-    sizerFileBtns->Add(new wxButton(this, wxID_VIEW_DETAILS, wxT("&View...")),
+    sizerFileBtns->Add(new wxButton(this, wxID_VIEW_DETAILS, _("&View...")),
                         wxSizerFlags().Border(wxBOTTOM));
-    sizerFileBtns->Add(new wxButton(this, wxID_OPEN, wxT("&Open...")),
+    sizerFileBtns->Add(new wxButton(this, wxID_OPEN, _("&Open...")),
                         wxSizerFlags().Border(wxTOP));
     sizerFileBtns->AddStretchSpacer(1);
 
@@ -431,7 +435,12 @@ void wxDebugReportDialog::OnView(wxCommandEvent& )
     wxFileName fn(m_dbgrpt.GetDirectory(), m_files[sel]);
     wxString str;
 
-    wxFFile file(fn.GetFullPath());
+    const wxString& fullPath = fn.GetFullPath();
+#if wxUSE_FFILE
+    wxFFile file(fullPath);
+#elif wxUSE_FILE
+    wxFile file(fullPath);
+#endif
     if ( file.IsOpened() && file.ReadAll(&str) )
     {
         wxDumpPreviewDlg dlg(this, m_files[sel], str);
@@ -517,6 +526,9 @@ bool wxDebugReportPreviewStd::Show(wxDebugReport& dbgrpt) const
     // before entering the event loop (from ShowModal()), block the event
     // handling for all other windows as this could result in more crashes
     wxEventLoop::SetCriticalWindow(&dlg);
+
+    wxON_BLOCK_EXIT1( wxEventLoop::SetCriticalWindow,
+                        static_cast<wxWindow *>(NULL) );
 #endif // __WXMSW__
 
     return dlg.ShowModal() == wxID_OK && dbgrpt.GetFilesCount() != 0;