diff --git a/src/xmlctrl.cpp b/src/xmlctrl.cpp index 757676d..7e8ed0f 100644 --- a/src/xmlctrl.cpp +++ b/src/xmlctrl.cpp @@ -43,6 +43,7 @@ BEGIN_EVENT_TABLE ( XmlCtrl, wxStyledTextCtrl ) EVT_MIDDLE_DOWN ( XmlCtrl::OnMiddleDown ) EVT_COMMAND(wxID_ANY, wxEVT_COMMAND_VALIDATION_COMPLETED, XmlCtrl::OnValidationCompleted) EVT_NOTIFY ( myEVT_NOTIFY_PROMPT_GENERATED, wxID_ANY, XmlCtrl::OnPromptGenerated ) + EVT_KILL_FOCUS ( XmlCtrl::OnKillFocus ) END_EVENT_TABLE() // global protection for validation threads @@ -2396,3 +2397,9 @@ wxString XmlCtrl::getCurrentXPath() return xpath; } + +void XmlCtrl::OnKillFocus ( wxFocusEvent &event ) +{ + AutoCompCancel(); + event.Skip(); +} diff --git a/src/xmlctrl.h b/src/xmlctrl.h index aea49df..3c1d3f0 100644 --- a/src/xmlctrl.h +++ b/src/xmlctrl.h @@ -209,6 +209,7 @@ class XmlCtrl: public wxStyledTextCtrl void OnMouseRightUp ( wxMouseEvent& event ); void OnMiddleDown ( wxMouseEvent& event ); void OnPromptGenerated ( wxNotifyEvent &event ); + void OnKillFocus ( wxFocusEvent &event ); void insertNewLine(); void adjustNoColumnWidth(); void adjustPosRight();