X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0e0de6b8aa49309ba439fcfd7251967915749c09..2dfa37d69e81b1ea87f0f2f7b6c2e18776616bd1:/src/univ/dialog.cpp?ds=sidebyside diff --git a/src/univ/dialog.cpp b/src/univ/dialog.cpp index 6a29dbf93d..50fa18cacf 100644 --- a/src/univ/dialog.cpp +++ b/src/univ/dialog.cpp @@ -6,14 +6,29 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ -#pragma implementation "univdialog.h" +// ============================================================================ +// declarations +// ============================================================================ + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop #endif #include "wx/dialog.h" -#include "wx/utils.h" + +#ifndef WX_PRECOMP + #include "wx/utils.h" + #include "wx/app.h" +#endif + #include "wx/evtloop.h" -#include "wx/app.h" //----------------------------------------------------------------------------- // wxDialog @@ -33,7 +48,7 @@ void wxDialog::Init() m_returnCode = 0; m_windowDisabler = NULL; m_eventLoop = NULL; - m_isShowingModal = FALSE; + m_isShowingModal = false; } wxDialog::~wxDialog() @@ -46,7 +61,7 @@ bool wxDialog::Create(wxWindow *parent, const wxPoint &pos, const wxSize &size, long style, const wxString &name) { - SetExtraStyle(GetExtraStyle() | wxTLW_EX_DIALOG); + SetExtraStyle(GetExtraStyle() | wxTOPLEVEL_EX_DIALOG); // all dialogs should have tab traversal enabled style |= wxTAB_TRAVERSAL; @@ -69,7 +84,7 @@ void wxDialog::OnCancel(wxCommandEvent &WXUNUSED(event)) else { SetReturnCode(wxID_CANCEL); - Show(FALSE); + Show(false); } } @@ -84,7 +99,7 @@ void wxDialog::OnOK(wxCommandEvent &WXUNUSED(event)) else { SetReturnCode(wxID_OK); - Show(FALSE); + Show(false); } } } @@ -148,11 +163,6 @@ bool wxDialog::IsModal() const return m_isShowingModal; } -void wxDialog::SetModal(bool WXUNUSED(flag)) -{ - wxFAIL_MSG( wxT("wxDialog:SetModal obsolete now") ); -} - int wxDialog::ShowModal() { if ( IsModal() ) @@ -172,14 +182,17 @@ int wxDialog::ShowModal() } } - wxBusyCursorSuspender cs; // temporarily suppress the busy cursor - - Show(TRUE); + Show(true); - m_isShowingModal = TRUE; + m_isShowingModal = true; wxASSERT_MSG( !m_windowDisabler, _T("disabling windows twice?") ); +#if defined(__WXGTK__) || defined(__WXMGL__) + wxBusyCursorSuspender suspender; + // FIXME (FIXME_MGL) - make sure busy cursor disappears under MSW too +#endif + m_windowDisabler = new wxWindowDisabler(this); if ( !m_eventLoop ) m_eventLoop = new wxEventLoop; @@ -201,9 +214,9 @@ void wxDialog::EndModal(int retCode) return; } - m_isShowingModal = FALSE; - + m_isShowingModal = false; + m_eventLoop->Exit(); - Show(FALSE); + Show(false); }