X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3727c043a846bed24554c47b723da9fbe3b9a010..93df3f5f7318c1aa3f930e9e4f631a2569948149:/contrib/src/stc/stc.cpp.in?ds=sidebyside diff --git a/contrib/src/stc/stc.cpp.in b/contrib/src/stc/stc.cpp.in index 989a49401b..2a9806a68a 100644 --- a/contrib/src/stc/stc.cpp.in +++ b/contrib/src/stc/stc.cpp.in @@ -17,11 +17,11 @@ #include -#include -#include -#include -#include -#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" @@ -96,6 +96,7 @@ DEFINE_EVENT_TYPE( wxEVT_STC_ZOOM ) DEFINE_EVENT_TYPE( wxEVT_STC_HOTSPOT_CLICK ) DEFINE_EVENT_TYPE( wxEVT_STC_HOTSPOT_DCLICK ) DEFINE_EVENT_TYPE( wxEVT_STC_CALLTIP_CLICK ) +DEFINE_EVENT_TYPE( wxEVT_STC_AUTOCOMP_SELECTION ) @@ -296,14 +297,14 @@ void wxStyledTextCtrl::StyleSetFont(int styleNum, wxFont& font) { int x, y; GetTextExtent(wxT("X"), &x, &y, NULL, NULL, &font); #endif - int size = font.GetPointSize(); - wxString faceName = font.GetFaceName(); - bool bold = font.GetWeight() == wxBOLD; - bool italic = font.GetStyle() != wxNORMAL; - bool under = font.GetUnderlined(); - - // TODO: add encoding/charset mapping - StyleSetFontAttr(styleNum, size, faceName, bold, italic, under); + int size = font.GetPointSize(); + wxString faceName = font.GetFaceName(); + bool bold = font.GetWeight() == wxBOLD; + bool italic = font.GetStyle() != wxNORMAL; + bool under = font.GetUnderlined(); + wxFontEncoding encoding = font.GetEncoding(); + + StyleSetFontAttr(styleNum, size, faceName, bold, italic, under, encoding); } // Set all font style attributes at once. @@ -402,6 +403,14 @@ void wxStyledTextCtrl::StyleSetCharacterSet(int style, int characterSet) case wxSTC_CHARSET_THAI: encoding = wxFONTENCODING_ISO8859_11; break; + + case wxSTC_CHARSET_CYRILLIC: + encoding = wxFONTENCODING_ISO8859_5; + break; + + case wxSTC_CHARSET_8859_15: + encoding = wxFONTENCODING_ISO8859_15;; + break; } // We just have Scintilla track the wxFontEncoding for us. It gets used @@ -845,12 +854,7 @@ static void SetEventText(wxStyledTextEvent& evt, const char* text, size_t length) { if(!text) return; - // The unicode conversion MUST have a null byte to terminate the - // string so move it into a buffer first and give it one. - wxMemoryBuffer buf(length+1); - buf.AppendData((void*)text, length); - buf.AppendByte(0); - evt.SetText(stc2wx(buf)); + evt.SetText(stc2wx(text, length)); } @@ -967,6 +971,10 @@ void wxStyledTextCtrl::NotifyParent(SCNotification* _scn) { evt.SetEventType(wxEVT_STC_CALLTIP_CLICK); break; + case SCN_AUTOCSELECTION: + evt.SetEventType(wxEVT_STC_AUTOCOMP_SELECTION); + break; + default: return; }