git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57455
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
// gripper if we have one
void OnWindowCreate(wxWindowCreateEvent& event);
// gripper if we have one
void OnWindowCreate(wxWindowCreateEvent& event);
- bool m_endModalCalled; // allow for closing within InitDialog
-
#if wxUSE_TOOLBAR && defined(__POCKETPC__)
wxToolBar* m_dialogToolBar;
#endif
#if wxUSE_TOOLBAR && defined(__POCKETPC__)
wxToolBar* m_dialogToolBar;
#endif
{
m_isShown = false;
m_modalData = NULL;
{
m_isShown = false;
m_modalData = NULL;
- m_endModalCalled = false;
#if wxUSE_TOOLBAR && defined(__POCKETPC__)
m_dialogToolBar = NULL;
#endif
#if wxUSE_TOOLBAR && defined(__POCKETPC__)
m_dialogToolBar = NULL;
#endif
{
wxASSERT_MSG( !IsModal(), _T("ShowModal() can't be called twice") );
{
wxASSERT_MSG( !IsModal(), _T("ShowModal() can't be called twice") );
- m_endModalCalled = false;
-
Show();
// EndModal may have been called from InitDialog handler (called from
Show();
// EndModal may have been called from InitDialog handler (called from
- // inside Show()), which would cause an infinite loop if we didn't take it
- // into account
- if ( !m_endModalCalled )
+ // inside Show()) and hidden the dialog back again
+ if ( !IsShown() )
{
// enter and run the modal loop
wxDialogModalDataTiedPtr modalData(&m_modalData,
{
// enter and run the modal loop
wxDialogModalDataTiedPtr modalData(&m_modalData,
{
wxASSERT_MSG( IsModal(), _T("EndModal() called for non modal dialog") );
{
wxASSERT_MSG( IsModal(), _T("EndModal() called for non modal dialog") );
- m_endModalCalled = true;
SetReturnCode(retCode);
Hide();
SetReturnCode(retCode);
Hide();