From be9a863efa68a5bba71d7054aed106298fcf0aa1 Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 18 Jul 2008 16:23:54 +0000 Subject: [PATCH] Patch level : 10.0 Files correlati : xvaga.dll Ricompilazione Demo : [ ] Commento : Risolto Errore 000826 Corretta gestione notifiche di cancellamento il librerira di gestione alberi git-svn-id: svn://10.65.10.50/trunk@16899 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- xvaga/xvtctl.cpp | 15 ++++++++++++--- xvaga/xvtwin.cpp | 9 +++++++-- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/xvaga/xvtctl.cpp b/xvaga/xvtctl.cpp index 4fcc847c6..6c93be9d8 100755 --- a/xvaga/xvtctl.cpp +++ b/xvaga/xvtctl.cpp @@ -860,7 +860,7 @@ XVT_TREEVIEW_NODE xvt_treeview_get_child_node(WINDOW win, XVT_TREEVIEW_NODE pare if (!parent.IsOk()) parent = tv.GetRootItem(); - if (position < (int)tv.GetChildrenCount(parent)) + if (parent.IsOk() && position < (int)tv.GetChildrenCount(parent)) { wxTreeItemIdValue cookie; wxTreeItemId id; @@ -940,7 +940,14 @@ BOOLEAN xvt_treeview_remove_child_node(WINDOW win, XVT_TREEVIEW_NODE node) { CAST_TREEVIEW(win, tv); const wxTreeItemId id(node); - tv.Delete(id); + if (id == tv.GetRootItem()) + tv.DeleteAllItems(); + else + { + tv.Suspend(); + tv.Delete(id); + tv.Resume(); + } } return ok; } @@ -951,10 +958,12 @@ BOOLEAN xvt_treeview_remove_node_children(WINDOW win, XVT_TREEVIEW_NODE node) if (win != NULL_WIN) { CAST_TREEVIEW(win, tv); + tv.Suspend(); wxTreeItemId id(node); - if (!id.IsOk()) + if (!id.IsOk()) id = tv.GetRootItem(); tv.DeleteChildren(id); + tv.Resume(); ok = TRUE; } return ok; diff --git a/xvaga/xvtwin.cpp b/xvaga/xvtwin.cpp index 39f9bd8a4..1e6fd8a47 100755 --- a/xvaga/xvtwin.cpp +++ b/xvaga/xvtwin.cpp @@ -938,10 +938,15 @@ TwxWindow::TwxWindow(wxWindow *parent, wxWindowID id, const wxString& title, TwxWindow::~TwxWindow() { + _nice_windows.Delete((WINDOW)this); + + EVENT e; memset(&e, 0, sizeof(EVENT)); + e.type = E_DESTROY; + DoXvtEvent(e); + // Rendo praticamente impossibile risalire a questo oggetto d'ora in poi _eh = NULL; _app_data = 0L; - _nice_windows.Delete((WINDOW)this); if (HasCapture()) { @@ -1124,12 +1129,12 @@ TTaskWin::TTaskWin(wxWindowID id, const wxString& title, TTaskWin::~TTaskWin() { + _nice_windows.Delete((WINDOW)this); if (m_menu) { xvt_res_free_menu_tree(m_menu); m_menu = NULL; } - _nice_windows.Delete((WINDOW)this); } ///////////////////////////////////////////////////////////