X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e52f60e65236befe1a509cc3c1823607be0d2b3c..06cfab17389f4bbd38560dd86ee39931e979bb1e:/src/gtk/dialog.cpp?ds=sidebyside diff --git a/src/gtk/dialog.cpp b/src/gtk/dialog.cpp index bde6b7e6b4..ceba496548 100644 --- a/src/gtk/dialog.cpp +++ b/src/gtk/dialog.cpp @@ -14,6 +14,9 @@ #include "wx/dialog.h" #include "wx/frame.h" #include "wx/app.h" + +#include "gdk/gdk.h" +#include "gtk/gtk.h" #include "wx/gtk/win_gtk.h" //----------------------------------------------------------------------------- @@ -74,7 +77,6 @@ wxDialog::wxDialog() { m_title = ""; m_modalShowing = FALSE; - wxTopLevelWindows.Insert( this ); } wxDialog::wxDialog( wxWindow *parent, @@ -83,7 +85,6 @@ wxDialog::wxDialog( wxWindow *parent, long style, const wxString &name ) { m_modalShowing = FALSE; - wxTopLevelWindows.Insert( this ); Create( parent, id, title, pos, size, style, name ); } @@ -92,6 +93,8 @@ bool wxDialog::Create( wxWindow *parent, const wxPoint &pos, const wxSize &size, long style, const wxString &name ) { + wxTopLevelWindows.Append( this ); + m_needParent = FALSE; PreCreation( parent, id, pos, size, style, name ); @@ -245,7 +248,7 @@ void wxDialog::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int heigh void wxDialog::OnSize( wxSizeEvent &WXUNUSED(event) ) { - wxASSERT_MSG( (m_widget != NULL), "invalid frame" ); + wxASSERT_MSG( (m_widget != NULL), "invalid dialog" ); if (GetAutoLayout()) { @@ -254,14 +257,14 @@ void wxDialog::OnSize( wxSizeEvent &WXUNUSED(event) ) else { // no child: go out ! - if (!GetChildren()->First()) return; + if (!GetChildren().First()) return; // do we have exactly one child? wxWindow *child = (wxWindow *) NULL; - for(wxNode *node = GetChildren()->First(); node; node = node->Next()) + for(wxNode *node = GetChildren().First(); node; node = node->Next()) { wxWindow *win = (wxWindow *)node->Data(); - if (!IS_KIND_OF(win,wxFrame) && !IS_KIND_OF(win,wxDialog)) + if (!wxIS_KIND_OF(win,wxFrame) && !wxIS_KIND_OF(win,wxDialog)) { // it's the second one: do nothing if (child) return;