本文整理汇总了C++中Accessor::SetFlags方法的典型用法代码示例。如果您正苦于以下问题:C++ Accessor::SetFlags方法的具体用法?C++ Accessor::SetFlags怎么用?C++ Accessor::SetFlags使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Accessor
的用法示例。
在下文中一共展示了Accessor::SetFlags方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ColouriseSolDoc
static void ColouriseSolDoc(unsigned int startPos, int length, int initStyle,
WordList *keywordlists[], Accessor &styler)
{
int lengthDoc = startPos + length;
char stringType = '\"';
if (startPos > 0)
{
int lineCurrent = styler.GetLine(startPos);
if (lineCurrent > 0)
{
startPos = styler.LineStart(lineCurrent-1);
if (startPos == 0) initStyle = SCE_SCRIPTOL_DEFAULT;
else initStyle = styler.StyleAt(startPos-1);
}
}
styler.StartAt(startPos, 127);
WordList &keywords = *keywordlists[0];
int whingeLevel = styler.GetPropertyInt("tab.timmy.whinge.level");
char prevWord[200];
prevWord[0] = '\0';
if (length == 0) return;
int state = initStyle & 31;
int nextIndex = 0;
char chPrev = ' ';
char chPrev2 = ' ';
char chNext = styler[startPos];
styler.StartSegment(startPos);
bool atStartLine = true;
int spaceFlags = 0;
for (int i = startPos; i < lengthDoc; i++)
{
if (atStartLine)
{
char chBad = static_cast<char>(64);
char chGood = static_cast<char>(0);
char chFlags = chGood;
if (whingeLevel == 1)
{
chFlags = (spaceFlags & wsInconsistent) ? chBad : chGood;
}
else if (whingeLevel == 2)
{
chFlags = (spaceFlags & wsSpaceTab) ? chBad : chGood;
}
else if (whingeLevel == 3)
{
chFlags = (spaceFlags & wsSpace) ? chBad : chGood;
}
else if (whingeLevel == 4)
{
chFlags = (spaceFlags & wsTab) ? chBad : chGood;
}
styler.SetFlags(chFlags, static_cast<char>(state));
atStartLine = false;
}
char ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
if ((ch == '\r' && chNext != '\n') || (ch == '\n') || (i == lengthDoc))
{
if ((state == SCE_SCRIPTOL_DEFAULT) ||
(state == SCE_SCRIPTOL_TRIPLE) ||
(state == SCE_SCRIPTOL_COMMENTBLOCK))
{
styler.ColourTo(i, state);
}
atStartLine = true;
}
if (styler.IsLeadByte(ch))
{
chNext = styler.SafeGetCharAt(i + 2);
chPrev = ' ';
chPrev2 = ' ';
i += 1;
continue;
}
if (state == SCE_SCRIPTOL_STRINGEOL)
{
if (ch != '\r' && ch != '\n')
{
styler.ColourTo(i - 1, state);
state = SCE_SCRIPTOL_DEFAULT;
}
}
if (state == SCE_SCRIPTOL_DEFAULT)
{
if (IsSolWordStart(ch))
//.........这里部分代码省略.........