// 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 <ctype.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 )
+DEFINE_EVENT_TYPE( wxEVT_STC_AUTOCOMP_SELECTION )
+DEFINE_EVENT_TYPE( wxEVT_STC_INDICATOR_CLICK )
+DEFINE_EVENT_TYPE( wxEVT_STC_INDICATOR_RELEASE )
}
+// Get the font of a style
+wxFont wxStyledTextCtrl::StyleGetFont(int style) {
+ wxFont font;
+ font.SetPointSize(StyleGetSize(style));
+ font.SetFaceName(StyleGetFaceName(style));
+ if( StyleGetBold(style) )
+ font.SetWeight(wxFONTWEIGHT_BOLD);
+ else
+ font.SetWeight(wxFONTWEIGHT_NORMAL);
+
+ if( StyleGetItalic(style) )
+ font.SetStyle(wxFONTSTYLE_ITALIC);
+ else
+ font.SetStyle(wxFONTSTYLE_NORMAL);
+
+ return font;
+}
+
+
// Set style size, face, bold, italic, and underline attributes from
// a wxFont's attributes.
void wxStyledTextCtrl::StyleSetFont(int styleNum, wxFont& font) {
bool italic = font.GetStyle() != wxNORMAL;
bool under = font.GetUnderlined();
wxFontEncoding encoding = font.GetEncoding();
-
+
StyleSetFontAttr(styleNum, size, faceName, bold, italic, under, encoding);
}
case wxSTC_CHARSET_CYRILLIC:
encoding = wxFONTENCODING_ISO8859_5;
break;
-
+
case wxSTC_CHARSET_8859_15:
encoding = wxFONTENCODING_ISO8859_15;;
break;
if (!len) {
wxCharBuffer empty;
return empty;
- }
+ }
wxCharBuffer buf(len);
SendMsg(SCI_GETSELTEXT, 0, (long)buf.data());
if (!len) {
wxCharBuffer empty;
return empty;
- }
+ }
wxCharBuffer buf(len);
TextRange tr;
}
#endif
}
-
+
evt.Skip();
}
SetEventText(evt, scn.text, strlen(scn.text));
evt.SetPosition(scn.lParam);
break;
-
+
case SCN_USERLISTSELECTION:
evt.SetEventType(wxEVT_STC_USERLISTSELECTION);
evt.SetListType(scn.listType);
case SCN_CALLTIPCLICK:
evt.SetEventType(wxEVT_STC_CALLTIP_CLICK);
break;
-
+
+ case SCN_INDICATORCLICK:
+ evt.SetEventType(wxEVT_STC_INDICATOR_CLICK);
+ break;
+
+ case SCN_INDICATORRELEASE:
+ evt.SetEventType(wxEVT_STC_INDICATOR_RELEASE);
+ break;
+
default:
return;
}
//----------------------------------------------------------------------
//----------------------------------------------------------------------
-
-
-
-
-
-
-
-
+#endif // wxUSE_STC