|
|
|
@@ -44704,7 +44704,7 @@ public: |
|
|
|
|
|
|
|
CodeDocument::Iterator::Iterator (CodeDocument* const document_) |
|
|
|
: document (document_), |
|
|
|
currentLine (document_->lines[0]), |
|
|
|
charPointer (0), |
|
|
|
line (0), |
|
|
|
position (0) |
|
|
|
{ |
|
|
|
@@ -44712,7 +44712,7 @@ CodeDocument::Iterator::Iterator (CodeDocument* const document_) |
|
|
|
|
|
|
|
CodeDocument::Iterator::Iterator (const CodeDocument::Iterator& other) |
|
|
|
: document (other.document), |
|
|
|
currentLine (other.currentLine), |
|
|
|
charPointer (other.charPointer), |
|
|
|
line (other.line), |
|
|
|
position (other.position) |
|
|
|
{ |
|
|
|
@@ -44721,7 +44721,7 @@ CodeDocument::Iterator::Iterator (const CodeDocument::Iterator& other) |
|
|
|
CodeDocument::Iterator& CodeDocument::Iterator::operator= (const CodeDocument::Iterator& other) throw() |
|
|
|
{ |
|
|
|
document = other.document; |
|
|
|
currentLine = other.currentLine; |
|
|
|
charPointer = other.charPointer; |
|
|
|
line = other.line; |
|
|
|
position = other.position; |
|
|
|
|
|
|
|
@@ -44734,58 +44734,74 @@ CodeDocument::Iterator::~Iterator() throw() |
|
|
|
|
|
|
|
juce_wchar CodeDocument::Iterator::nextChar() |
|
|
|
{ |
|
|
|
if (currentLine == 0) |
|
|
|
return 0; |
|
|
|
|
|
|
|
jassert (currentLine == document->lines.getUnchecked (line)); |
|
|
|
const juce_wchar result = currentLine->line [position - currentLine->lineStartInFile]; |
|
|
|
|
|
|
|
if (++position >= currentLine->lineStartInFile + currentLine->lineLength) |
|
|
|
for (;;) |
|
|
|
{ |
|
|
|
++line; |
|
|
|
currentLine = document->lines [line]; |
|
|
|
} |
|
|
|
if (charPointer.getAddress() == 0) |
|
|
|
{ |
|
|
|
CodeDocumentLine* const l = document->lines[line]; |
|
|
|
|
|
|
|
return result; |
|
|
|
} |
|
|
|
if (l == 0) |
|
|
|
return 0; |
|
|
|
|
|
|
|
void CodeDocument::Iterator::skip() |
|
|
|
{ |
|
|
|
if (currentLine != 0) |
|
|
|
{ |
|
|
|
jassert (currentLine == document->lines.getUnchecked (line)); |
|
|
|
charPointer = l->line.getCharPointer(); |
|
|
|
} |
|
|
|
|
|
|
|
const juce_wchar result = charPointer.getAndAdvance(); |
|
|
|
|
|
|
|
if (++position >= currentLine->lineStartInFile + currentLine->lineLength) |
|
|
|
if (result == 0) |
|
|
|
{ |
|
|
|
++line; |
|
|
|
currentLine = document->lines [line]; |
|
|
|
charPointer = 0; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
++position; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void CodeDocument::Iterator::skip() |
|
|
|
{ |
|
|
|
nextChar(); |
|
|
|
} |
|
|
|
|
|
|
|
void CodeDocument::Iterator::skipToEndOfLine() |
|
|
|
{ |
|
|
|
if (currentLine != 0) |
|
|
|
if (charPointer.getAddress() == 0) |
|
|
|
{ |
|
|
|
jassert (currentLine == document->lines.getUnchecked (line)); |
|
|
|
CodeDocumentLine* const l = document->lines[line]; |
|
|
|
|
|
|
|
++line; |
|
|
|
currentLine = document->lines [line]; |
|
|
|
if (l == 0) |
|
|
|
return; |
|
|
|
|
|
|
|
if (currentLine != 0) |
|
|
|
position = currentLine->lineStartInFile; |
|
|
|
else |
|
|
|
position = document->getNumCharacters(); |
|
|
|
charPointer = l->line.getCharPointer(); |
|
|
|
} |
|
|
|
|
|
|
|
position += charPointer.length(); |
|
|
|
++line; |
|
|
|
charPointer = 0; |
|
|
|
} |
|
|
|
|
|
|
|
juce_wchar CodeDocument::Iterator::peekNextChar() const |
|
|
|
{ |
|
|
|
if (currentLine == 0 || currentLine->line.isEmpty()) |
|
|
|
return 0; |
|
|
|
if (charPointer.getAddress() == 0) |
|
|
|
{ |
|
|
|
CodeDocumentLine* const l = document->lines[line]; |
|
|
|
|
|
|
|
if (l == 0) |
|
|
|
return 0; |
|
|
|
|
|
|
|
charPointer = l->line.getCharPointer(); |
|
|
|
} |
|
|
|
|
|
|
|
const juce_wchar c = *charPointer; |
|
|
|
|
|
|
|
jassert (currentLine == document->lines.getUnchecked (line)); |
|
|
|
return const_cast <const String&> (currentLine->line) [position - currentLine->lineStartInFile]; |
|
|
|
if (c != 0) |
|
|
|
return c; |
|
|
|
|
|
|
|
CodeDocumentLine* const l = document->lines [line + 1]; |
|
|
|
return l == 0 ? 0 : l->line[0]; |
|
|
|
} |
|
|
|
|
|
|
|
void CodeDocument::Iterator::skipWhitespace() |
|
|
|
@@ -44796,7 +44812,7 @@ void CodeDocument::Iterator::skipWhitespace() |
|
|
|
|
|
|
|
bool CodeDocument::Iterator::isEOF() const throw() |
|
|
|
{ |
|
|
|
return currentLine == 0; |
|
|
|
return charPointer.getAddress() == 0 && line >= document->lines.size(); |
|
|
|
} |
|
|
|
|
|
|
|
CodeDocument::Position::Position() throw() |
|
|
|
@@ -49085,8 +49101,22 @@ bool ListBox::keyStateChanged (const bool isKeyDown) |
|
|
|
|
|
|
|
void ListBox::mouseWheelMove (const MouseEvent& e, float wheelIncrementX, float wheelIncrementY) |
|
|
|
{ |
|
|
|
getHorizontalScrollBar()->mouseWheelMove (e, wheelIncrementX, 0); |
|
|
|
getVerticalScrollBar()->mouseWheelMove (e, 0, wheelIncrementY); |
|
|
|
bool eventWasUsed = false; |
|
|
|
|
|
|
|
if (viewport->getHorizontalScrollBar()->isVisible() && wheelIncrementX != 0) |
|
|
|
{ |
|
|
|
eventWasUsed = true; |
|
|
|
viewport->getHorizontalScrollBar()->mouseWheelMove (e, wheelIncrementX, 0); |
|
|
|
} |
|
|
|
|
|
|
|
if (viewport->getVerticalScrollBar()->isVisible() && wheelIncrementY != 0) |
|
|
|
{ |
|
|
|
eventWasUsed = true; |
|
|
|
viewport->getVerticalScrollBar()->mouseWheelMove (e, 0, wheelIncrementY); |
|
|
|
} |
|
|
|
|
|
|
|
if (! eventWasUsed) |
|
|
|
Component::mouseWheelMove (e, wheelIncrementX, wheelIncrementY); |
|
|
|
} |
|
|
|
|
|
|
|
void ListBox::mouseMove (const MouseEvent& e) |
|
|
|
|