Fixed error indicators for wxWidgets 2.9+

This commit is contained in:
Zane U. Ji 2013-11-27 22:44:24 +08:00
parent 411c3d26a0
commit 35385f971a
1 changed files with 13 additions and 0 deletions

View File

@ -125,6 +125,9 @@ XmlCtrl::XmlCtrl (
IndicatorSetStyle ( i, wxSTC_INDIC_HIDDEN ); IndicatorSetStyle ( i, wxSTC_INDIC_HIDDEN );
IndicatorSetStyle ( 2, wxSTC_INDIC_SQUIGGLE ); IndicatorSetStyle ( 2, wxSTC_INDIC_SQUIGGLE );
IndicatorSetForeground ( 2, *wxRED ); IndicatorSetForeground ( 2, *wxRED );
#if wxCHECK_VERSION(2,9,0)
SetIndicatorCurrent ( 2 );
#endif
} }
@ -2004,8 +2007,12 @@ void XmlCtrl::setErrorIndicator ( int line, int column )
int length = endPos - startPos; int length = endPos - startPos;
if ( length > 0 && length + startPos < GetLength() ) if ( length > 0 && length + startPos < GetLength() )
{ {
#if wxCHECK_VERSION(2,9,0)
IndicatorFillRange ( startPos, length );
#else
StartStyling ( startPos, wxSTC_INDIC2_MASK ); StartStyling ( startPos, wxSTC_INDIC2_MASK );
SetStyling ( length, wxSTC_INDIC2_MASK ); SetStyling ( length, wxSTC_INDIC2_MASK );
#endif
} }
} }
@ -2022,8 +2029,12 @@ void XmlCtrl::clearErrorIndicators ( int maxLine )
length = ( maxLine ) ? GetLineEndPosition ( maxLine ) : length; length = ( maxLine ) ? GetLineEndPosition ( maxLine ) : length;
if ( end > 0 && length > end ) length = end; if ( end > 0 && length > end ) length = end;
#if wxCHECK_VERSION(2,9,0)
IndicatorClearRange ( 0, length );
#else
StartStyling ( 0, wxSTC_INDIC2_MASK ); StartStyling ( 0, wxSTC_INDIC2_MASK );
SetStyling ( length, 0 ); SetStyling ( length, 0 );
#endif
} }
bool XmlCtrl::getValidationRequired() bool XmlCtrl::getValidationRequired()
@ -2080,7 +2091,9 @@ int XmlCtrl::getTagType ( int pos )
int XmlCtrl::getLexerStyleAt ( int pos ) int XmlCtrl::getLexerStyleAt ( int pos )
{ {
int style = GetStyleAt ( pos ); int style = GetStyleAt ( pos );
#if !wxCHECK_VERSION(2,9,0)
style &= ~wxSTC_INDIC2_MASK; style &= ~wxSTC_INDIC2_MASK;
#endif
return style; return style;
} }