Fixed an updating problem

This commit is contained in:
Zane U. Ji 2014-04-27 22:14:08 +08:00
parent 87eac6e5aa
commit b12b7fadc4
3 changed files with 9 additions and 7 deletions

View File

@ -71,7 +71,8 @@ InsertPanel::InsertPanel (
void InsertPanel::update ( void InsertPanel::update (
XmlDoc *docParameter, XmlDoc *docParameter,
const wxString& parentParameter, const wxString& parentParameter,
const wxString& grandparentParameter ) const wxString& grandparentParameter,
bool forced )
{ {
doc = docParameter; doc = docParameter;
parent = parentParameter; parent = parentParameter;
@ -89,7 +90,7 @@ void InsertPanel::update (
return; return;
} }
bool refreshEntities = false; bool refreshEntities = forced;
if ( doc != lastDoc ) if ( doc != lastDoc )
{ {
refreshEntities = true; refreshEntities = true;
@ -109,7 +110,7 @@ void InsertPanel::update (
return; return;
} }
if ( parent == lastParent && !list->IsEmpty() ) if ( parent == lastParent && !refreshEntities )
return; return;
lastParent = parent; lastParent = parent;

View File

@ -41,7 +41,8 @@ class InsertPanel : public wxPanel
void update ( void update (
XmlDoc *doc, XmlDoc *doc,
const wxString& parent = wxEmptyString, const wxString& parent = wxEmptyString,
const wxString& grandparent = wxEmptyString ); const wxString& grandparent = wxEmptyString,
bool forced = false );
void OnEnter ( wxCommandEvent& event ); void OnEnter ( wxCommandEvent& event );
void OnDoubleClick ( wxCommandEvent& event ); void OnDoubleClick ( wxCommandEvent& event );
void OnListSelection ( wxCommandEvent& event ); void OnListSelection ( wxCommandEvent& event );

View File

@ -6018,9 +6018,9 @@ void MyFrame::OnPromptGenerated ( wxNotifyEvent &event )
{ {
XmlDoc *doc = this->getActiveDocument(); XmlDoc *doc = this->getActiveDocument();
locationPanel->update ( doc, lastParent ); locationPanel->update ( doc, lastParent );
insertChildPanel->update ( doc, lastParent ); insertChildPanel->update ( doc, lastParent, wxEmptyString, true );
insertSiblingPanel->update ( doc, lastParent ); insertSiblingPanel->update ( doc, lastParent, wxEmptyString, true );
insertEntityPanel->update ( doc ); insertEntityPanel->update ( doc, wxEmptyString, wxEmptyString, true );
} }
wxString MyFrame::getAuxPath ( const wxString& fileName ) wxString MyFrame::getAuxPath ( const wxString& fileName )