X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0daf5e6be21cf6e491447adff8f3c1aad440c456..3ef595d5f879ec3ed4ef511445487261304313e2:/src/stc/stc.cpp diff --git a/src/stc/stc.cpp b/src/stc/stc.cpp index 3b7d9bfc8f..5f72b1de71 100644 --- a/src/stc/stc.cpp +++ b/src/stc/stc.cpp @@ -15,15 +15,28 @@ // 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" + +#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 +171,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)) @@ -2553,7 +2564,7 @@ void wxStyledTextCtrl::SetLexerLanguage(const wxString& language) { // Retrieve a 'property' value previously set with SetProperty. wxString wxStyledTextCtrl::GetProperty(const wxString& key) { - int len = SendMsg(SCI_GETPROPERTY, (long)(const char*)wx2stc(key), (long)NULL); + int len = SendMsg(SCI_GETPROPERTY, (long)(const char*)wx2stc(key), 0); if (!len) return wxEmptyString; wxMemoryBuffer mbuf(len+1); @@ -2567,7 +2578,7 @@ wxString wxStyledTextCtrl::GetProperty(const wxString& key) { // Retrieve a 'property' value previously set with SetProperty, // with '$()' variable replacement on returned buffer. wxString wxStyledTextCtrl::GetPropertyExpanded(const wxString& key) { - int len = SendMsg(SCI_GETPROPERTYEXPANDED, (long)(const char*)wx2stc(key), (long)NULL); + int len = SendMsg(SCI_GETPROPERTYEXPANDED, (long)(const char*)wx2stc(key), 0); if (!len) return wxEmptyString; wxMemoryBuffer mbuf(len+1); @@ -3118,6 +3129,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(); @@ -3417,11 +3435,4 @@ wxStyledTextEvent::wxStyledTextEvent(const wxStyledTextEvent& event): //---------------------------------------------------------------------- //---------------------------------------------------------------------- - - - - - - - - +#endif // wxUSE_STC