Generate wxDialogInit event for wxDialog under wxQT
This commit is contained in:
@@ -34,6 +34,7 @@ public:
|
|||||||
virtual int ShowModal() wxOVERRIDE;
|
virtual int ShowModal() wxOVERRIDE;
|
||||||
virtual void EndModal(int retCode) wxOVERRIDE;
|
virtual void EndModal(int retCode) wxOVERRIDE;
|
||||||
virtual bool IsModal() const wxOVERRIDE;
|
virtual bool IsModal() const wxOVERRIDE;
|
||||||
|
virtual bool Show(bool show) wxOVERRIDE;
|
||||||
|
|
||||||
QDialog *GetDialogHandle() const;
|
QDialog *GetDialogHandle() const;
|
||||||
|
|
||||||
|
@@ -74,7 +74,12 @@ int wxDialog::ShowModal()
|
|||||||
WX_HOOK_MODAL_DIALOG();
|
WX_HOOK_MODAL_DIALOG();
|
||||||
wxCHECK_MSG( GetHandle() != NULL, -1, "Invalid dialog" );
|
wxCHECK_MSG( GetHandle() != NULL, -1, "Invalid dialog" );
|
||||||
|
|
||||||
bool ret = GetDialogHandle()->exec();
|
QDialog *qDialog = GetDialogHandle();
|
||||||
|
qDialog->setModal(true);
|
||||||
|
|
||||||
|
Show(true);
|
||||||
|
|
||||||
|
bool ret = qDialog->exec();
|
||||||
if ( GetReturnCode() == 0 )
|
if ( GetReturnCode() == 0 )
|
||||||
return ret ? wxID_OK : wxID_CANCEL;
|
return ret ? wxID_OK : wxID_CANCEL;
|
||||||
return GetReturnCode();
|
return GetReturnCode();
|
||||||
@@ -95,6 +100,25 @@ bool wxDialog::IsModal() const
|
|||||||
return GetDialogHandle()->isModal();
|
return GetDialogHandle()->isModal();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool wxDialog::Show(bool show)
|
||||||
|
{
|
||||||
|
if ( show == IsShown() )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if ( !show && IsModal() )
|
||||||
|
EndModal(wxID_CANCEL);
|
||||||
|
|
||||||
|
if ( show && CanDoLayoutAdaptation() )
|
||||||
|
DoLayoutAdaptation();
|
||||||
|
|
||||||
|
const bool ret = wxDialogBase::Show(show);
|
||||||
|
|
||||||
|
if (show)
|
||||||
|
InitDialog();
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
QDialog *wxDialog::GetDialogHandle() const
|
QDialog *wxDialog::GetDialogHandle() const
|
||||||
{
|
{
|
||||||
return static_cast<QDialog*>(m_qtWindow);
|
return static_cast<QDialog*>(m_qtWindow);
|
||||||
|
Reference in New Issue
Block a user