X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0e974385f6ab66910ee42ca287fbf9ada2392dc1..8e5ec9cc58bc1508aadf5bc2387609b245358a74:/contrib/src/stc/ScintillaWX.cpp diff --git a/contrib/src/stc/ScintillaWX.cpp b/contrib/src/stc/ScintillaWX.cpp index 163a89afb4..6acb7805d1 100644 --- a/contrib/src/stc/ScintillaWX.cpp +++ b/contrib/src/stc/ScintillaWX.cpp @@ -136,6 +136,7 @@ END_EVENT_TABLE() ScintillaWX::ScintillaWX(wxStyledTextCtrl* win) { capturedMouse = false; + focusEvent = false; wMain = win; stc = win; wheelRotation = 0; @@ -333,6 +334,18 @@ void ScintillaWX::NotifyParent(SCNotification scn) { } +// This method is overloaded from ScintillaBase in order to prevent the +// AutoComplete window from being destroyed when it gets the focus. There is +// a side effect that the AutoComp will also not be destroyed when switching +// to another window, but I think that is okay. +void ScintillaWX::CancelModes() { + if (! focusEvent) + AutoCompleteCancel(); + ct.CallTipCancel(); + Editor::CancelModes(); +} + + void ScintillaWX::Copy() { if (currentPos != anchor) { @@ -409,7 +422,7 @@ void ScintillaWX::AddToPopUp(const char *label, int cmd, bool enabled) { if (!label[0]) ((wxMenu*)popup.GetID())->AppendSeparator(); else - ((wxMenu*)popup.GetID())->Append(cmd, stc2wx(label)); + ((wxMenu*)popup.GetID())->Append(cmd, wxGetTranslation(stc2wx(label))); if (!enabled) ((wxMenu*)popup.GetID())->Enable(cmd, enabled); @@ -606,11 +619,15 @@ void ScintillaWX::DoSize(int WXUNUSED(width), int WXUNUSED(height)) { } void ScintillaWX::DoLoseFocus(){ + focusEvent = true; SetFocusState(false); + focusEvent = false; } void ScintillaWX::DoGainFocus(){ + focusEvent = true; SetFocusState(true); + focusEvent = false; } void ScintillaWX::DoSysColourChange() { @@ -730,7 +747,8 @@ int ScintillaWX::DoKeyDown(int key, bool shift, bool ctrl, bool alt, bool WXUNU case 'A': // Select All ctrl = true; break; - } + } + } #endif int rv = KeyDown(key, shift, ctrl, alt, consumed);