From db1b49617679e97304ddc36491bfcdc14381d904 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Wed, 9 Dec 1998 12:14:16 +0000 Subject: [PATCH] Clipboard update menuitem->SetName() -> SetText() (or other raound) GetChildren() returns reference this still doesn't compile, I'm waiting git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1140 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/gtk/menuitem.h | 6 +++--- include/wx/gtk/window.h | 2 +- include/wx/gtk1/menuitem.h | 6 +++--- include/wx/gtk1/window.h | 2 +- src/gtk/clipbrd.cpp | 34 +++++++++++++++++++++++++------ src/gtk/dialog.cpp | 4 ++-- src/gtk/frame.cpp | 6 +++--- src/gtk/menu.cpp | 23 ++++++++++++++++++--- src/gtk/window.cpp | 41 ++++++++++++++++++-------------------- src/gtk1/clipbrd.cpp | 34 +++++++++++++++++++++++++------ src/gtk1/dialog.cpp | 4 ++-- src/gtk1/frame.cpp | 6 +++--- src/gtk1/menu.cpp | 23 ++++++++++++++++++--- src/gtk1/window.cpp | 41 ++++++++++++++++++-------------------- 14 files changed, 152 insertions(+), 80 deletions(-) diff --git a/include/wx/gtk/menuitem.h b/include/wx/gtk/menuitem.h index f20657838a..99c0a659d6 100644 --- a/include/wx/gtk/menuitem.h +++ b/include/wx/gtk/menuitem.h @@ -48,9 +48,9 @@ public: int GetId() const { return m_id; } bool IsSeparator() const { return m_id == ID_SEPARATOR; } - // the item's text - void SetText(const wxString& str); - const wxString& GetText() const { return m_text; } + // the item's text = name + void SetName(const wxString& str); + const wxString& GetName() const { return m_text; } // what kind of menu item we are void SetCheckable(bool checkable) { m_isCheckMenu = checkable; } diff --git a/include/wx/gtk/window.h b/include/wx/gtk/window.h index 678c8057df..21a177b91d 100644 --- a/include/wx/gtk/window.h +++ b/include/wx/gtk/window.h @@ -155,7 +155,7 @@ public: virtual bool OnClose(); virtual void AddChild( wxWindow *child ); - wxList *GetChildren(); + wxList& GetChildren() const; virtual void RemoveChild( wxWindow *child ); void SetReturnCode( int retCode ); int GetReturnCode(); diff --git a/include/wx/gtk1/menuitem.h b/include/wx/gtk1/menuitem.h index f20657838a..99c0a659d6 100644 --- a/include/wx/gtk1/menuitem.h +++ b/include/wx/gtk1/menuitem.h @@ -48,9 +48,9 @@ public: int GetId() const { return m_id; } bool IsSeparator() const { return m_id == ID_SEPARATOR; } - // the item's text - void SetText(const wxString& str); - const wxString& GetText() const { return m_text; } + // the item's text = name + void SetName(const wxString& str); + const wxString& GetName() const { return m_text; } // what kind of menu item we are void SetCheckable(bool checkable) { m_isCheckMenu = checkable; } diff --git a/include/wx/gtk1/window.h b/include/wx/gtk1/window.h index 678c8057df..21a177b91d 100644 --- a/include/wx/gtk1/window.h +++ b/include/wx/gtk1/window.h @@ -155,7 +155,7 @@ public: virtual bool OnClose(); virtual void AddChild( wxWindow *child ); - wxList *GetChildren(); + wxList& GetChildren() const; virtual void RemoveChild( wxWindow *child ); void SetReturnCode( int retCode ); int GetReturnCode(); diff --git a/src/gtk/clipbrd.cpp b/src/gtk/clipbrd.cpp index 1ab6f2c545..d029dd027c 100644 --- a/src/gtk/clipbrd.cpp +++ b/src/gtk/clipbrd.cpp @@ -134,22 +134,26 @@ selection_handler( GtkWidget *WXUNUSED(widget), GtkSelectionData *selection_data if (!data_object) return; - if (data_object->GetDataSize() == 0) return; + if (data_object->GetDataSize() == 0) return; + + gint len = data_object->GetDataSize(); guchar *bin_data = (guchar*) malloc( len ); data_object->GetDataHere( (void*)bin_data ); - if (selection_data->target == GDK_SELECTION_TYPE_STRING) + if (selection_data->target == GDK_TARGET_STRING) { gtk_selection_data_set( selection_data, GDK_SELECTION_TYPE_STRING, 8*sizeof(gchar), bin_data, len ); } +/* else if (selection_data->target == g_textAtom) { gtk_selection_data_set( selection_data, g_textAtom, 8*sizeof(gchar), bin_data, len ); } +*/ free( bin_data ); } @@ -162,8 +166,6 @@ IMPLEMENT_DYNAMIC_CLASS(wxClipboard,wxObject) wxClipboard::wxClipboard() { m_data = (wxDataObject*) NULL; - m_clipboardWidget = gtk_window_new( GTK_WINDOW_POPUP ); - gtk_widget_realize( m_clipboardWidget ); gtk_signal_connect( GTK_OBJECT(m_clipboardWidget), "selection_clear_event", @@ -194,8 +196,13 @@ void wxClipboard::Clear() if (m_data) { + if (gdk_selection_owner_get( g_clipboardAtom) == m_clipboardWidget->window) + { + gtk_selection_owner_set( (GtkWidget*) NULL, g_clipboardAtom, GDK_CURRENT_TIME ); + } + delete m_data; - gtk_selection_owner_set( (GtkWidget*) NULL, GDK_SELECTION_PRIMARY, GDK_CURRENT_TIME ); + m_data = (wxDataObject*) NULL; } m_receivedSize = 0; @@ -213,6 +220,20 @@ void wxClipboard::Clear() void wxClipboard::SetData( wxDataObject *data ) { + Clear(); + +/* + GTK 1.0.X cannot remove a target from a widget so if a widget + at first offers text and then a bitmap (and no longer text) to + the clipboard, we seem too have to delete it. +*/ + + if (m_clipboardWidget) gtk_widget_destroy( m_clipboardWidget ); + + m_clipboardWidget = gtk_window_new( GTK_WINDOW_POPUP ); + gtk_widget_realize( m_clipboardWidget ); + + if (m_data) delete m_data; m_data = data; if (!m_data) return; @@ -231,7 +252,8 @@ void wxClipboard::SetData( wxDataObject *data ) case wxDF_TEXT: gtk_selection_add_handler( m_clipboardWidget, g_clipboardAtom, - g_textAtom, + // g_textAtom, + GDK_TARGET_STRING, selection_handler, NULL ); break; diff --git a/src/gtk/dialog.cpp b/src/gtk/dialog.cpp index 0e26ee1808..067aa65fac 100644 --- a/src/gtk/dialog.cpp +++ b/src/gtk/dialog.cpp @@ -254,11 +254,11 @@ 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)) diff --git a/src/gtk/frame.cpp b/src/gtk/frame.cpp index 4c987eacfd..1dfee32d43 100644 --- a/src/gtk/frame.cpp +++ b/src/gtk/frame.cpp @@ -455,11 +455,11 @@ void wxFrame::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) @@ -537,7 +537,7 @@ wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& nam m_frameToolBar = OnCreateToolBar( style, id, name ); - GetChildren()->DeleteObject( m_frameToolBar ); + GetChildren().DeleteObject( m_frameToolBar ); if (m_sizeSet) GtkOnSize( m_x, m_y, m_width, m_height ); diff --git a/src/gtk/menu.cpp b/src/gtk/menu.cpp index 577e5fa2a4..7d8900886e 100644 --- a/src/gtk/menu.cpp +++ b/src/gtk/menu.cpp @@ -203,7 +203,7 @@ static void gtk_menu_hilight_callback( GtkWidget *widget, wxMenu *menu ) } //----------------------------------------------------------------------------- -// wxMenu +// wxMenuItem //----------------------------------------------------------------------------- IMPLEMENT_DYNAMIC_CLASS(wxMenuItem,wxObject) @@ -218,19 +218,28 @@ wxMenuItem::wxMenuItem() m_menuItem = (GtkWidget *) NULL; } -void wxMenuItem::SetText(const wxString& str) +void wxMenuItem::SetName(const wxString& str) { + wxCHECK_RET( m_menuItem, "invalid menu item" ); + m_text = ""; - for ( const char *pc = str; *pc != '\0'; pc++ ) { + for ( const char *pc = str; *pc != '\0'; pc++ ) + { if ( *pc == '&' ) pc++; // skip it m_text << *pc; } + + GtkLabel *label = GTK_LABEL( GTK_BIN(m_menuItem)->child ); + + gtk_label_set( label, m_text.c_str()); } void wxMenuItem::Check( bool check ) { + wxCHECK_RET( m_menuItem, "invalid menu item" ); + wxCHECK_RET( IsCheckable(), "Can't check uncheckable item!" ) m_isChecked = check; @@ -239,12 +248,16 @@ void wxMenuItem::Check( bool check ) void wxMenuItem::Enable( bool enable ) { + wxCHECK_RET( m_menuItem, "invalid menu item" ); + gtk_widget_set_sensitive( m_menuItem, enable ); m_isEnabled = enable; } bool wxMenuItem::IsChecked() const { + wxCHECK_MSG( m_menuItem, FALSE, "invalid menu item" ); + wxCHECK( IsCheckable(), FALSE ); // can't get state of uncheckable item! bool bIsChecked = ((GtkCheckMenuItem*)m_menuItem)->active != 0; @@ -254,6 +267,10 @@ bool wxMenuItem::IsChecked() const return bIsChecked; } +//----------------------------------------------------------------------------- +// wxMenuItem +//----------------------------------------------------------------------------- + IMPLEMENT_DYNAMIC_CLASS(wxMenu,wxEvtHandler) wxMenu::wxMenu( const wxString& title, const wxFunction func ) diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 6de4b2c637..c3eba590fa 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -395,7 +395,7 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton if (!g_capturing) { - wxNode *node = win->GetChildren()->First(); + wxNode *node = win->GetChildren().First(); while (node) { wxWindow *child = (wxWindow*)node->Data(); @@ -468,7 +468,7 @@ static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButto if (!g_capturing) { - wxNode *node = win->GetChildren()->First(); + wxNode *node = win->GetChildren().First(); while (node) { wxWindow *child = (wxWindow*)node->Data(); @@ -531,7 +531,7 @@ static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion if (!g_capturing) { - wxNode *node = win->GetChildren()->First(); + wxNode *node = win->GetChildren().First(); while (node) { wxWindow *child = (wxWindow*)node->Data(); @@ -1308,17 +1308,14 @@ bool wxWindow::Destroy() bool wxWindow::DestroyChildren() { - if (GetChildren()) + wxNode *node; + while ((node = m_children.First()) != (wxNode *)NULL) { - wxNode *node; - while ((node = GetChildren()->First()) != (wxNode *)NULL) + wxWindow *child; + if ((child = (wxWindow *)node->Data()) != (wxWindow *)NULL) { - wxWindow *child; - if ((child = (wxWindow *)node->Data()) != (wxWindow *)NULL) - { - delete child; - if (GetChildren()->Member(child)) delete node; - } + delete child; + if (m_children.Member(child)) delete node; } } return TRUE; @@ -1658,7 +1655,7 @@ void wxWindow::Fit() int maxX = 0; int maxY = 0; - wxNode *node = GetChildren()->First(); + wxNode *node = m_childrenFirst(); while ( node ) { wxWindow *win = (wxWindow *)node->Data(); @@ -1806,9 +1803,9 @@ void wxWindow::AddChild( wxWindow *child ) m_children.Append( child ); } -wxList *wxWindow::GetChildren() +wxList& wxWindow::GetChildren() const { - return (&m_children); + return m_children; } wxWindow *wxWindow::ReParent( wxWindow *newParent ) @@ -1830,7 +1827,7 @@ wxWindow *wxWindow::ReParent( wxWindow *newParent ) void wxWindow::RemoveChild( wxWindow *child ) { - if (GetChildren()) GetChildren()->DeleteObject( child ); + m_children.DeleteObject( child ); child->m_parent = (wxWindow *) NULL; } @@ -2140,7 +2137,7 @@ bool wxWindow::Validate() { wxCHECK_MSG( m_widget != NULL, FALSE, "invalid window" ); - wxNode *node = GetChildren()->First(); + wxNode *node = m_children.First(); while (node) { wxWindow *child = (wxWindow *)node->Data(); @@ -2155,7 +2152,7 @@ bool wxWindow::TransferDataToWindow() { wxCHECK_MSG( m_widget != NULL, FALSE, "invalid window" ); - wxNode *node = GetChildren()->First(); + wxNode *node = m_children.First(); while (node) { wxWindow *child = (wxWindow *)node->Data(); @@ -2174,7 +2171,7 @@ bool wxWindow::TransferDataFromWindow() { wxASSERT_MSG( (m_widget != NULL), "invalid window" ); - wxNode *node = GetChildren()->First(); + wxNode *node = m_children.First(); while (node) { wxWindow *child = (wxWindow *)node->Data(); @@ -2798,7 +2795,7 @@ bool wxWindow::DoPhase(int phase) { noChanges = 0; noFailures = 0; - wxNode *node = GetChildren()->First(); + wxNode *node = m_children.first(); while (node) { wxWindow *child = (wxWindow *)node->Data(); @@ -2843,7 +2840,7 @@ void wxWindow::ResetConstraints() constr->centreX.SetDone(FALSE); constr->centreY.SetDone(FALSE); } - wxNode *node = GetChildren()->First(); + wxNode *node = m_children.First(); while (node) { wxWindow *win = (wxWindow *)node->Data(); @@ -2902,7 +2899,7 @@ void wxWindow::SetConstraintSizes(bool recurse) if (recurse) { - wxNode *node = GetChildren()->First(); + wxNode *node = m_children.First(); while (node) { wxWindow *win = (wxWindow *)node->Data(); diff --git a/src/gtk1/clipbrd.cpp b/src/gtk1/clipbrd.cpp index 1ab6f2c545..d029dd027c 100644 --- a/src/gtk1/clipbrd.cpp +++ b/src/gtk1/clipbrd.cpp @@ -134,22 +134,26 @@ selection_handler( GtkWidget *WXUNUSED(widget), GtkSelectionData *selection_data if (!data_object) return; - if (data_object->GetDataSize() == 0) return; + if (data_object->GetDataSize() == 0) return; + + gint len = data_object->GetDataSize(); guchar *bin_data = (guchar*) malloc( len ); data_object->GetDataHere( (void*)bin_data ); - if (selection_data->target == GDK_SELECTION_TYPE_STRING) + if (selection_data->target == GDK_TARGET_STRING) { gtk_selection_data_set( selection_data, GDK_SELECTION_TYPE_STRING, 8*sizeof(gchar), bin_data, len ); } +/* else if (selection_data->target == g_textAtom) { gtk_selection_data_set( selection_data, g_textAtom, 8*sizeof(gchar), bin_data, len ); } +*/ free( bin_data ); } @@ -162,8 +166,6 @@ IMPLEMENT_DYNAMIC_CLASS(wxClipboard,wxObject) wxClipboard::wxClipboard() { m_data = (wxDataObject*) NULL; - m_clipboardWidget = gtk_window_new( GTK_WINDOW_POPUP ); - gtk_widget_realize( m_clipboardWidget ); gtk_signal_connect( GTK_OBJECT(m_clipboardWidget), "selection_clear_event", @@ -194,8 +196,13 @@ void wxClipboard::Clear() if (m_data) { + if (gdk_selection_owner_get( g_clipboardAtom) == m_clipboardWidget->window) + { + gtk_selection_owner_set( (GtkWidget*) NULL, g_clipboardAtom, GDK_CURRENT_TIME ); + } + delete m_data; - gtk_selection_owner_set( (GtkWidget*) NULL, GDK_SELECTION_PRIMARY, GDK_CURRENT_TIME ); + m_data = (wxDataObject*) NULL; } m_receivedSize = 0; @@ -213,6 +220,20 @@ void wxClipboard::Clear() void wxClipboard::SetData( wxDataObject *data ) { + Clear(); + +/* + GTK 1.0.X cannot remove a target from a widget so if a widget + at first offers text and then a bitmap (and no longer text) to + the clipboard, we seem too have to delete it. +*/ + + if (m_clipboardWidget) gtk_widget_destroy( m_clipboardWidget ); + + m_clipboardWidget = gtk_window_new( GTK_WINDOW_POPUP ); + gtk_widget_realize( m_clipboardWidget ); + + if (m_data) delete m_data; m_data = data; if (!m_data) return; @@ -231,7 +252,8 @@ void wxClipboard::SetData( wxDataObject *data ) case wxDF_TEXT: gtk_selection_add_handler( m_clipboardWidget, g_clipboardAtom, - g_textAtom, + // g_textAtom, + GDK_TARGET_STRING, selection_handler, NULL ); break; diff --git a/src/gtk1/dialog.cpp b/src/gtk1/dialog.cpp index 0e26ee1808..067aa65fac 100644 --- a/src/gtk1/dialog.cpp +++ b/src/gtk1/dialog.cpp @@ -254,11 +254,11 @@ 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)) diff --git a/src/gtk1/frame.cpp b/src/gtk1/frame.cpp index 4c987eacfd..1dfee32d43 100644 --- a/src/gtk1/frame.cpp +++ b/src/gtk1/frame.cpp @@ -455,11 +455,11 @@ void wxFrame::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) @@ -537,7 +537,7 @@ wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& nam m_frameToolBar = OnCreateToolBar( style, id, name ); - GetChildren()->DeleteObject( m_frameToolBar ); + GetChildren().DeleteObject( m_frameToolBar ); if (m_sizeSet) GtkOnSize( m_x, m_y, m_width, m_height ); diff --git a/src/gtk1/menu.cpp b/src/gtk1/menu.cpp index 577e5fa2a4..7d8900886e 100644 --- a/src/gtk1/menu.cpp +++ b/src/gtk1/menu.cpp @@ -203,7 +203,7 @@ static void gtk_menu_hilight_callback( GtkWidget *widget, wxMenu *menu ) } //----------------------------------------------------------------------------- -// wxMenu +// wxMenuItem //----------------------------------------------------------------------------- IMPLEMENT_DYNAMIC_CLASS(wxMenuItem,wxObject) @@ -218,19 +218,28 @@ wxMenuItem::wxMenuItem() m_menuItem = (GtkWidget *) NULL; } -void wxMenuItem::SetText(const wxString& str) +void wxMenuItem::SetName(const wxString& str) { + wxCHECK_RET( m_menuItem, "invalid menu item" ); + m_text = ""; - for ( const char *pc = str; *pc != '\0'; pc++ ) { + for ( const char *pc = str; *pc != '\0'; pc++ ) + { if ( *pc == '&' ) pc++; // skip it m_text << *pc; } + + GtkLabel *label = GTK_LABEL( GTK_BIN(m_menuItem)->child ); + + gtk_label_set( label, m_text.c_str()); } void wxMenuItem::Check( bool check ) { + wxCHECK_RET( m_menuItem, "invalid menu item" ); + wxCHECK_RET( IsCheckable(), "Can't check uncheckable item!" ) m_isChecked = check; @@ -239,12 +248,16 @@ void wxMenuItem::Check( bool check ) void wxMenuItem::Enable( bool enable ) { + wxCHECK_RET( m_menuItem, "invalid menu item" ); + gtk_widget_set_sensitive( m_menuItem, enable ); m_isEnabled = enable; } bool wxMenuItem::IsChecked() const { + wxCHECK_MSG( m_menuItem, FALSE, "invalid menu item" ); + wxCHECK( IsCheckable(), FALSE ); // can't get state of uncheckable item! bool bIsChecked = ((GtkCheckMenuItem*)m_menuItem)->active != 0; @@ -254,6 +267,10 @@ bool wxMenuItem::IsChecked() const return bIsChecked; } +//----------------------------------------------------------------------------- +// wxMenuItem +//----------------------------------------------------------------------------- + IMPLEMENT_DYNAMIC_CLASS(wxMenu,wxEvtHandler) wxMenu::wxMenu( const wxString& title, const wxFunction func ) diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index 6de4b2c637..c3eba590fa 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -395,7 +395,7 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton if (!g_capturing) { - wxNode *node = win->GetChildren()->First(); + wxNode *node = win->GetChildren().First(); while (node) { wxWindow *child = (wxWindow*)node->Data(); @@ -468,7 +468,7 @@ static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButto if (!g_capturing) { - wxNode *node = win->GetChildren()->First(); + wxNode *node = win->GetChildren().First(); while (node) { wxWindow *child = (wxWindow*)node->Data(); @@ -531,7 +531,7 @@ static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion if (!g_capturing) { - wxNode *node = win->GetChildren()->First(); + wxNode *node = win->GetChildren().First(); while (node) { wxWindow *child = (wxWindow*)node->Data(); @@ -1308,17 +1308,14 @@ bool wxWindow::Destroy() bool wxWindow::DestroyChildren() { - if (GetChildren()) + wxNode *node; + while ((node = m_children.First()) != (wxNode *)NULL) { - wxNode *node; - while ((node = GetChildren()->First()) != (wxNode *)NULL) + wxWindow *child; + if ((child = (wxWindow *)node->Data()) != (wxWindow *)NULL) { - wxWindow *child; - if ((child = (wxWindow *)node->Data()) != (wxWindow *)NULL) - { - delete child; - if (GetChildren()->Member(child)) delete node; - } + delete child; + if (m_children.Member(child)) delete node; } } return TRUE; @@ -1658,7 +1655,7 @@ void wxWindow::Fit() int maxX = 0; int maxY = 0; - wxNode *node = GetChildren()->First(); + wxNode *node = m_childrenFirst(); while ( node ) { wxWindow *win = (wxWindow *)node->Data(); @@ -1806,9 +1803,9 @@ void wxWindow::AddChild( wxWindow *child ) m_children.Append( child ); } -wxList *wxWindow::GetChildren() +wxList& wxWindow::GetChildren() const { - return (&m_children); + return m_children; } wxWindow *wxWindow::ReParent( wxWindow *newParent ) @@ -1830,7 +1827,7 @@ wxWindow *wxWindow::ReParent( wxWindow *newParent ) void wxWindow::RemoveChild( wxWindow *child ) { - if (GetChildren()) GetChildren()->DeleteObject( child ); + m_children.DeleteObject( child ); child->m_parent = (wxWindow *) NULL; } @@ -2140,7 +2137,7 @@ bool wxWindow::Validate() { wxCHECK_MSG( m_widget != NULL, FALSE, "invalid window" ); - wxNode *node = GetChildren()->First(); + wxNode *node = m_children.First(); while (node) { wxWindow *child = (wxWindow *)node->Data(); @@ -2155,7 +2152,7 @@ bool wxWindow::TransferDataToWindow() { wxCHECK_MSG( m_widget != NULL, FALSE, "invalid window" ); - wxNode *node = GetChildren()->First(); + wxNode *node = m_children.First(); while (node) { wxWindow *child = (wxWindow *)node->Data(); @@ -2174,7 +2171,7 @@ bool wxWindow::TransferDataFromWindow() { wxASSERT_MSG( (m_widget != NULL), "invalid window" ); - wxNode *node = GetChildren()->First(); + wxNode *node = m_children.First(); while (node) { wxWindow *child = (wxWindow *)node->Data(); @@ -2798,7 +2795,7 @@ bool wxWindow::DoPhase(int phase) { noChanges = 0; noFailures = 0; - wxNode *node = GetChildren()->First(); + wxNode *node = m_children.first(); while (node) { wxWindow *child = (wxWindow *)node->Data(); @@ -2843,7 +2840,7 @@ void wxWindow::ResetConstraints() constr->centreX.SetDone(FALSE); constr->centreY.SetDone(FALSE); } - wxNode *node = GetChildren()->First(); + wxNode *node = m_children.First(); while (node) { wxWindow *win = (wxWindow *)node->Data(); @@ -2902,7 +2899,7 @@ void wxWindow::SetConstraintSizes(bool recurse) if (recurse) { - wxNode *node = GetChildren()->First(); + wxNode *node = m_children.First(); while (node) { wxWindow *win = (wxWindow *)node->Data(); -- 2.45.2