projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added refcounting to wxCharBuffer to fix passing of wxCharBuffer to printf-like functions
[wxWidgets.git]
/
src
/
univ
/
dialog.cpp
diff --git
a/src/univ/dialog.cpp
b/src/univ/dialog.cpp
index 0f5e47b9a4a4cec6fbda67794b0b6579b8248450..c98a5e91ac581b5ac7ca314192e3992417e6d9de 100644
(file)
--- a/
src/univ/dialog.cpp
+++ b/
src/univ/dialog.cpp
@@
-14,10
+14,6
@@
// headers
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
-#ifdef __GNUG__
- #pragma implementation "univdialog.h"
-#endif
-
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
@@
-25,8
+21,9
@@
#pragma hdrstop
#endif
#pragma hdrstop
#endif
+#include "wx/dialog.h"
+
#ifndef WX_PRECOMP
#ifndef WX_PRECOMP
- #include "wx/dialog.h"
#include "wx/utils.h"
#include "wx/app.h"
#endif
#include "wx/utils.h"
#include "wx/app.h"
#endif
@@
-51,11
+48,16
@@
void wxDialog::Init()
m_returnCode = 0;
m_windowDisabler = NULL;
m_eventLoop = NULL;
m_returnCode = 0;
m_windowDisabler = NULL;
m_eventLoop = NULL;
- m_isShowingModal =
FALSE
;
+ m_isShowingModal =
false
;
}
wxDialog::~wxDialog()
{
}
wxDialog::~wxDialog()
{
+ m_isBeingDeleted = true;
+
+ // if the dialog is modal, this will end its event loop
+ Show(false);
+
delete m_eventLoop;
}
delete m_eventLoop;
}
@@
-74,7
+76,7
@@
bool wxDialog::Create(wxWindow *parent,
void wxDialog::OnApply(wxCommandEvent &WXUNUSED(event))
{
void wxDialog::OnApply(wxCommandEvent &WXUNUSED(event))
{
- if ( Validate() )
+ if ( Validate() )
TransferDataFromWindow();
}
TransferDataFromWindow();
}
@@
-87,7
+89,7
@@
void wxDialog::OnCancel(wxCommandEvent &WXUNUSED(event))
else
{
SetReturnCode(wxID_CANCEL);
else
{
SetReturnCode(wxID_CANCEL);
- Show(
FALSE
);
+ Show(
false
);
}
}
}
}
@@
-102,7
+104,7
@@
void wxDialog::OnOK(wxCommandEvent &WXUNUSED(event))
else
{
SetReturnCode(wxID_OK);
else
{
SetReturnCode(wxID_OK);
- Show(
FALSE
);
+ Show(
false
);
}
}
}
}
}
}
@@
-153,9
+155,12
@@
bool wxDialog::Show(bool show)
EndModal(wxID_CANCEL);
}
EndModal(wxID_CANCEL);
}
+ if (show && CanDoLayoutAdaptation())
+ DoLayoutAdaptation();
+
bool ret = wxDialogBase::Show(show);
bool ret = wxDialogBase::Show(show);
- if ( show )
+ if ( show )
InitDialog();
return ret;
InitDialog();
return ret;
@@
-166,11
+171,6
@@
bool wxDialog::IsModal() const
return m_isShowingModal;
}
return m_isShowingModal;
}
-void wxDialog::SetModal(bool WXUNUSED(flag))
-{
- wxFAIL_MSG( wxT("wxDialog:SetModal obsolete now") );
-}
-
int wxDialog::ShowModal()
{
if ( IsModal() )
int wxDialog::ShowModal()
{
if ( IsModal() )
@@
-183,19
+183,24
@@
int wxDialog::ShowModal()
// forbidden
if ( !GetParent() && !(GetWindowStyleFlag() & wxDIALOG_NO_PARENT) )
{
// forbidden
if ( !GetParent() && !(GetWindowStyleFlag() & wxDIALOG_NO_PARENT) )
{
- wxWindow *
parent = wxTheApp->GetTopWindow
();
+ wxWindow *
const parent = GetParentForModalDialog
();
if ( parent && parent != this )
{
m_parent = parent;
}
}
if ( parent && parent != this )
{
m_parent = parent;
}
}
- Show(
TRUE
);
+ Show(
true
);
- m_isShowingModal =
TRUE
;
+ m_isShowingModal =
true
;
wxASSERT_MSG( !m_windowDisabler, _T("disabling windows twice?") );
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;
m_windowDisabler = new wxWindowDisabler(this);
if ( !m_eventLoop )
m_eventLoop = new wxEventLoop;
@@
-217,9
+222,9
@@
void wxDialog::EndModal(int retCode)
return;
}
return;
}
- m_isShowingModal =
FALSE
;
-
+ m_isShowingModal =
false
;
+
m_eventLoop->Exit();
m_eventLoop->Exit();
- Show(
FALSE
);
+ Show(
false
);
}
}