#include "wx/app.h"
#include "wx/gtk/win_gtk.h"
+//-----------------------------------------------------------------------------
+
+extern wxList wxPendingDelete;
+
//-----------------------------------------------------------------------------
// delete
wxDialog::wxDialog( wxWindow *parent,
wxWindowID id, const wxString &title,
const wxPoint &pos, const wxSize &size,
- const long style, const wxString &name )
+ long style, const wxString &name )
{
wxTopLevelWindows.Insert( this );
Create( parent, id, title, pos, size, style, name );
bool wxDialog::Create( wxWindow *parent,
wxWindowID id, const wxString &title,
const wxPoint &pos, const wxSize &size,
- const long style, const wxString &name )
+ long style, const wxString &name )
{
m_needParent = FALSE;
void wxDialog::OnCancel( wxCommandEvent &WXUNUSED(event) )
{
if (IsModal())
+ {
EndModal(wxID_CANCEL);
+ }
else
{
SetReturnCode(wxID_CANCEL);
if ( Validate() && TransferDataFromWindow())
{
if (IsModal())
+ {
EndModal(wxID_OK);
+ }
else
{
SetReturnCode(wxID_OK);
this->Show(FALSE);
};
};
- EndModal( wxID_OK );
};
void wxDialog::OnPaint( wxPaintEvent& WXUNUSED(event) )
static wxList closing;
if (closing.Member(this)) return FALSE; // no loops
-
+
closing.Append(this);
wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
return FALSE;
}
+bool wxDialog::Destroy(void)
+{
+ if (!wxPendingDelete.Member(this))
+ wxPendingDelete.Append(this);
+
+ return TRUE;
+}
+
void wxDialog::OnCloseWindow(wxCloseEvent& event)
{
if (GetEventHandler()->OnClose() || event.GetForce())
};
};
-bool wxDialog::Show( const bool show )
+bool wxDialog::Show( bool show )
{
if (!show && m_modalShowing)
{
void wxDialog::EndModal( int retCode )
{
- gtk_main_quit();
SetReturnCode( retCode );
+ gtk_main_quit();
};
void wxDialog::InitDialog(void)