コード例 #1
0
    void updatePosition (CodeEditorComponent& owner)
    {
        startTimer (400);
        setVisible (true);

        const Rectangle pos (owner.getCharacterBounds (owner.getCaretPos()));
        setBounds (pos.getX(), pos.getY(), 2, pos.getHeight());
    }
コード例 #2
0
CodeEditorComponent::State::State (const CodeEditorComponent& editor)
    : lastTopLine (editor.getFirstLineOnScreen()),
      lastCaretPos (editor.getCaretPos().getPosition()),
      lastSelectionEnd (lastCaretPos)
{
    const Range<int> selection (editor.getHighlightedRegion());

    if (lastCaretPos == selection.getStart())
        lastSelectionEnd = selection.getEnd();
    else
        lastSelectionEnd = selection.getStart();
}