From 89be46ab2f2f221789d041ba30d1cfc54f5d0457 Mon Sep 17 00:00:00 2001 From: "Zane U. Ji" Date: Fri, 8 Aug 2014 23:26:52 +0800 Subject: [PATCH] Bug #211 Tag-completion remains on-top when XML-Copy-Editor looses focus --- src/xmlctrl.cpp | 7 +++++++ src/xmlctrl.h | 1 + 2 files changed, 8 insertions(+) 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();