]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/dialog.cpp
added "access" parameter to wxFile::Create and Open. The default value is
[wxWidgets.git] / src / gtk1 / dialog.cpp
index 0c63e39f11f4eaf864dfa20286ef457d66a3eed8..f472f31e6c3e6a66976492b7f2d8f6c451263a8f 100644 (file)
 #include "wx/app.h"
 #include "wx/gtk/win_gtk.h"
 
 #include "wx/app.h"
 #include "wx/gtk/win_gtk.h"
 
+//-----------------------------------------------------------------------------
+
+extern wxList wxPendingDelete;
+
 //-----------------------------------------------------------------------------
 // delete
 
 //-----------------------------------------------------------------------------
 // delete
 
@@ -57,7 +61,7 @@ wxDialog::wxDialog(void)
 wxDialog::wxDialog( wxWindow *parent, 
       wxWindowID id, const wxString &title,
       const wxPoint &pos, const wxSize &size, 
 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 );
 {
   wxTopLevelWindows.Insert( this );
   Create( parent, id, title, pos, size, style, name );
@@ -66,7 +70,7 @@ wxDialog::wxDialog( wxWindow *parent,
 bool wxDialog::Create( wxWindow *parent,
       wxWindowID id, const wxString &title,
       const wxPoint &pos, const wxSize &size, 
 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;
   
 {
   m_needParent = FALSE;
   
@@ -120,7 +124,9 @@ void wxDialog::OnApply( wxCommandEvent &WXUNUSED(event) )
 void wxDialog::OnCancel( wxCommandEvent &WXUNUSED(event) )
 {
   if (IsModal())
 void wxDialog::OnCancel( wxCommandEvent &WXUNUSED(event) )
 {
   if (IsModal())
+  {
     EndModal(wxID_CANCEL);
     EndModal(wxID_CANCEL);
+  }
   else
   {
     SetReturnCode(wxID_CANCEL);
   else
   {
     SetReturnCode(wxID_CANCEL);
@@ -133,14 +139,15 @@ void wxDialog::OnOk( wxCommandEvent &WXUNUSED(event) )
   if ( Validate() && TransferDataFromWindow())
   {
     if (IsModal()) 
   if ( Validate() && TransferDataFromWindow())
   {
     if (IsModal()) 
+    {
       EndModal(wxID_OK);
       EndModal(wxID_OK);
+    }
     else
     {
       SetReturnCode(wxID_OK);
       this->Show(FALSE);
     };
   };
     else
     {
       SetReturnCode(wxID_OK);
       this->Show(FALSE);
     };
   };
-  EndModal( wxID_OK );
 };
 
 void wxDialog::OnPaint( wxPaintEvent& WXUNUSED(event) )
 };
 
 void wxDialog::OnPaint( wxPaintEvent& WXUNUSED(event) )
@@ -153,7 +160,7 @@ bool wxDialog::OnClose(void)
   static wxList closing;
 
   if (closing.Member(this)) return FALSE;   // no loops
   static wxList closing;
 
   if (closing.Member(this)) return FALSE;   // no loops
-
+  
   closing.Append(this);
 
   wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
   closing.Append(this);
 
   wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
@@ -164,6 +171,14 @@ bool wxDialog::OnClose(void)
   return FALSE;
 }
 
   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())
 void wxDialog::OnCloseWindow(wxCloseEvent& event)
 {
   if (GetEventHandler()->OnClose() || event.GetForce())
@@ -172,7 +187,7 @@ void wxDialog::OnCloseWindow(wxCloseEvent& event)
   };
 };
 
   };
 };
 
-bool wxDialog::Show( const bool show )
+bool wxDialog::Show( bool show )
 {
   if (!show && m_modalShowing)
   {
 {
   if (!show && m_modalShowing)
   {
@@ -201,8 +216,8 @@ int wxDialog::ShowModal(void)
 
 void wxDialog::EndModal( int retCode )
 {
 
 void wxDialog::EndModal( int retCode )
 {
-  gtk_main_quit();
   SetReturnCode( retCode );
   SetReturnCode( retCode );
+  gtk_main_quit();
 };
 
 void wxDialog::InitDialog(void)
 };
 
 void wxDialog::InitDialog(void)