本文整理汇总了C++中wxStyledTextEvent::GetLinesAdded方法的典型用法代码示例。如果您正苦于以下问题:C++ wxStyledTextEvent::GetLinesAdded方法的具体用法?C++ wxStyledTextEvent::GetLinesAdded怎么用?C++ wxStyledTextEvent::GetLinesAdded使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxStyledTextEvent
的用法示例。
在下文中一共展示了wxStyledTextEvent::GetLinesAdded方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnTextModified
void TextFrame::OnTextModified(wxStyledTextEvent& event)
{
wxStyledTextCtrl* txt = getCurrentTextCtrl();
if(txt)
{
int line = txt->LineFromPosition(event.GetPosition()),
lines = event.GetLinesAdded(),
linecount = txt->GetLineCount();
getDocument()->setModified(txt->IsModified());
if(lines!=0)
{
// Add or remove lines
updateLineNbMargin();
_fastFindLine->SetRange(1, linecount);
// Bookmarks
if(getDocument()->getBookmarks().addLines(line, lines))
UpdateBookmarkPanel();
// Markers
_markbar->SetMax(linecount);
_markbar->MoveMarkers(line, lines);
}
}
event.Skip();
}
示例2: OnModified
void CodeEdit::OnModified(wxStyledTextEvent& event)
{
event.Skip();
int linesAdded = event.GetLinesAdded();
// If we're inserting new lines before a line, so we need to move the
// markers down. STCntilla doesn't do this automatically for the current line.
if (linesAdded > 0)
{
unsigned int position = event.GetPosition();
unsigned int line = LineFromPosition(position);
unsigned int lineStartPosition = PositionFromLine(line);
if (position == lineStartPosition)
{
int markers = MarkerGet(line);
// Delete all of the markers from the line.
for (int i = 0; i < 32; ++i)
{
MarkerDelete(line, i);
}
// Add the markers back on the new line.
MarkerAddSet(line + linesAdded, markers);
}
}
}