#include <ctype.h>
-#include <wx/wx.h>
-#include <wx/tokenzr.h>
-#include <wx/mstream.h>
-#include <wx/image.h>
-#include <wx/file.h>
+#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"
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 )
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.
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
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));
}
evt.SetEventType(wxEVT_STC_CALLTIP_CLICK);
break;
+ case SCN_AUTOCSELECTION:
+ evt.SetEventType(wxEVT_STC_AUTOCOMP_SELECTION);
+ break;
+
default:
return;
}