void MyFrame::OnClose(wxCloseEvent& event) { if ( !event.CanVeto() ) { event.Skip(); return ; } if ( m_children.GetCount () < 1 ) { event.Skip(); return ; } // now try the children wxObjectList::compatibility_iterator pNode = m_children.GetFirst (); wxObjectList::compatibility_iterator pNext ; MyChild * pChild ; while ( pNode ) { pNext = pNode -> GetNext (); pChild = (MyChild*) pNode -> GetData (); if (pChild -> Close ()) { m_children.Erase(pNode) ; } else { event.Veto(); return; } pNode = pNext ; } event.Skip(); }
static void ClearSplineList() { wxList::compatibility_iterator node = ocpn_wx_spline_point_list.GetFirst(); while (node) { wxPoint *point = (wxPoint *)node->GetData(); delete point; ocpn_wx_spline_point_list.Erase(node); node = ocpn_wx_spline_point_list.GetFirst(); } }
static void wx_spline_draw_point_array(wxDCBase *dc) { dc->DrawLines(&wx_spline_point_list, 0, 0 ); wxList::compatibility_iterator node = wx_spline_point_list.GetFirst(); while (node) { wxPoint *point = (wxPoint *)node->GetData(); delete point; wx_spline_point_list.Erase(node); node = wx_spline_point_list.GetFirst(); } }
/// Remove a style bool wxRichTextStyleSheet::RemoveStyle(wxList& list, wxRichTextStyleDefinition* def, bool deleteStyle) { wxList::compatibility_iterator node = list.Find(def); if (node) { wxRichTextStyleDefinition* def = (wxRichTextStyleDefinition*) node->GetData(); list.Erase(node); if (deleteStyle) delete def; return true; } else return false; }