summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
809ca83)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54328
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
bool Show(bool show);
/**
bool Show(bool show);
/**
- Shows a modal dialog. Program flow does not return until the dialog has
- been dismissed with EndModal().
+ Shows a modal dialog.
+
+ Program flow does not return until the dialog has been dismissed with
+ EndModal().
+
+ Notice that it is possible to call ShowModal() for a dialog which had
+ been previously shown with Show(), this allows to make an existing
+ modeless dialog modal. However ShowModal() can't be called twice
+ without intervening EndModal() calls.
@return The value set with SetReturnCode().
@return The value set with SetReturnCode().
int wxDialog::ShowModal()
{
wxASSERT_MSG( !IsModal(), "ShowModal() can't be called twice" );
int wxDialog::ShowModal()
{
wxASSERT_MSG( !IsModal(), "ShowModal() can't be called twice" );
- wxASSERT_MSG( !IsShown(), "ShowModal() can't be called after Show()" );
// release the mouse if it's currently captured as the window having it
// will be disabled when this dialog is shown -- but will still keep the
// release the mouse if it's currently captured as the window having it
// will be disabled when this dialog is shown -- but will still keep the
// show dialog modally
int wxDialog::ShowModal()
{
// show dialog modally
int wxDialog::ShowModal()
{
- wxASSERT_MSG(!IsShown(),
- _T("ShowModal() can't be called for an already shown dialog"));
+ wxASSERT_MSG( !IsModal(), _T("ShowModal() can't be called twice") );
m_endModalCalled = false;
m_endModalCalled = false;
if ( !m_isModalStyle )
SetModal(true);
if ( !m_isModalStyle )
SetModal(true);
+ if ( IsShown() )
+ DoShowModal();
+ else
+ Show(true);
return GetReturnCode();
}
return GetReturnCode();
}