X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1c930beb60f14692321b0f7cf1b6054f93053772..9534d0dfdc3c6fad8ea5d5fd31bbb6f20650929b:/src/stc/stc.cpp.in diff --git a/src/stc/stc.cpp.in b/src/stc/stc.cpp.in index 2a9806a68a..b20db627fa 100644 --- a/src/stc/stc.cpp.in +++ b/src/stc/stc.cpp.in @@ -15,15 +15,29 @@ // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#if wxUSE_STC + +#include "wx/stc/stc.h" +#include "wx/stc/private.h" + +#ifndef WX_PRECOMP + #include "wx/wx.h" +#endif // WX_PRECOMP + #include -#include "wx/wx.h" #include "wx/tokenzr.h" #include "wx/mstream.h" #include "wx/image.h" #include "wx/file.h" -#include "wx/stc/stc.h" #include "ScintillaWX.h" //---------------------------------------------------------------------- @@ -158,9 +172,7 @@ bool wxStyledTextCtrl::Create(wxWindow *parent, long style, const wxString& name) { -#ifdef __WXMAC__ style |= wxVSCROLL | wxHSCROLL; -#endif if (!wxControl::Create(parent, id, pos, size, style | wxWANTS_CHARS | wxCLIP_CHILDREN, wxDefaultValidator, name)) @@ -179,7 +191,7 @@ bool wxStyledTextCtrl::Create(wxWindow *parent, SetCodePage(wxSTC_CP_UTF8); #endif - SetBestFittingSize(size); + SetInitialSize(size); // Reduces flicker on GTK+/X11 SetBackgroundStyle(wxBG_STYLE_CUSTOM); @@ -756,6 +768,13 @@ void wxStyledTextCtrl::OnChar(wxKeyEvent& evt) { #endif bool skip = ((ctrl || alt) && ! (ctrl && alt)); +#if wxUSE_UNICODE + // apparently if we don't do this, Unicode keys pressed after non-char + // ASCII ones (e.g. Enter, Tab) are not taken into account (patch 1615989) + if (m_lastKeyDownConsumed && evt.GetUnicodeKey() > 255) + m_lastKeyDownConsumed = false; +#endif + if (!m_lastKeyDownConsumed && !skip) { #if wxUSE_UNICODE int key = evt.GetUnicodeKey(); @@ -932,10 +951,18 @@ void wxStyledTextCtrl::NotifyParent(SCNotification* _scn) { evt.SetEventType(wxEVT_STC_PAINTED); break; + case SCN_AUTOCSELECTION: + evt.SetEventType(wxEVT_STC_AUTOCOMP_SELECTION); + evt.SetListType(scn.listType); + SetEventText(evt, scn.text, strlen(scn.text)); + evt.SetPosition(scn.lParam); + break; + case SCN_USERLISTSELECTION: evt.SetEventType(wxEVT_STC_USERLISTSELECTION); evt.SetListType(scn.listType); SetEventText(evt, scn.text, strlen(scn.text)); + evt.SetPosition(scn.lParam); break; case SCN_URIDROPPED: @@ -970,11 +997,7 @@ void wxStyledTextCtrl::NotifyParent(SCNotification* _scn) { case SCN_CALLTIPCLICK: evt.SetEventType(wxEVT_STC_CALLTIP_CLICK); break; - - case SCN_AUTOCSELECTION: - evt.SetEventType(wxEVT_STC_AUTOCOMP_SELECTION); - break; - + default: return; } @@ -1051,11 +1074,4 @@ wxStyledTextEvent::wxStyledTextEvent(const wxStyledTextEvent& event): //---------------------------------------------------------------------- //---------------------------------------------------------------------- - - - - - - - - +#endif // wxUSE_STC