From b12b7fadc4286c60d586f66430c91ccf1a46adf0 Mon Sep 17 00:00:00 2001 From: "Zane U. Ji" Date: Sun, 27 Apr 2014 22:14:08 +0800 Subject: [PATCH] Fixed an updating problem --- src/insertpanel.cpp | 7 ++++--- src/insertpanel.h | 3 ++- src/xmlcopyeditor.cpp | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/insertpanel.cpp b/src/insertpanel.cpp index 3560ca7..c8171b0 100644 --- a/src/insertpanel.cpp +++ b/src/insertpanel.cpp @@ -71,7 +71,8 @@ InsertPanel::InsertPanel ( void InsertPanel::update ( XmlDoc *docParameter, const wxString& parentParameter, - const wxString& grandparentParameter ) + const wxString& grandparentParameter, + bool forced ) { doc = docParameter; parent = parentParameter; @@ -89,7 +90,7 @@ void InsertPanel::update ( return; } - bool refreshEntities = false; + bool refreshEntities = forced; if ( doc != lastDoc ) { refreshEntities = true; @@ -109,7 +110,7 @@ void InsertPanel::update ( return; } - if ( parent == lastParent && !list->IsEmpty() ) + if ( parent == lastParent && !refreshEntities ) return; lastParent = parent; diff --git a/src/insertpanel.h b/src/insertpanel.h index 114bbfe..5900d8c 100644 --- a/src/insertpanel.h +++ b/src/insertpanel.h @@ -41,7 +41,8 @@ class InsertPanel : public wxPanel void update ( XmlDoc *doc, const wxString& parent = wxEmptyString, - const wxString& grandparent = wxEmptyString ); + const wxString& grandparent = wxEmptyString, + bool forced = false ); void OnEnter ( wxCommandEvent& event ); void OnDoubleClick ( wxCommandEvent& event ); void OnListSelection ( wxCommandEvent& event ); diff --git a/src/xmlcopyeditor.cpp b/src/xmlcopyeditor.cpp index 0e23581..c1e3c76 100644 --- a/src/xmlcopyeditor.cpp +++ b/src/xmlcopyeditor.cpp @@ -6018,9 +6018,9 @@ void MyFrame::OnPromptGenerated ( wxNotifyEvent &event ) { XmlDoc *doc = this->getActiveDocument(); locationPanel->update ( doc, lastParent ); - insertChildPanel->update ( doc, lastParent ); - insertSiblingPanel->update ( doc, lastParent ); - insertEntityPanel->update ( doc ); + insertChildPanel->update ( doc, lastParent, wxEmptyString, true ); + insertSiblingPanel->update ( doc, lastParent, wxEmptyString, true ); + insertEntityPanel->update ( doc, wxEmptyString, wxEmptyString, true ); } wxString MyFrame::getAuxPath ( const wxString& fileName )