Logo Search packages:      
Sourcecode: codeblocks version File versions  Download package

void cbEditor::GotoLine ( int  line,
bool  centerOnScreen = true 
) [virtual]

Move the caret at the specified line.

line Line to move caret to.
centerOnScreen If true (default), tries to bring the specified line to the centre of the editor.

Reimplemented from EditorBase.

Definition at line 1671 of file cbeditor.cpp.

References GetControl(), and UnfoldBlockFromLine().

Referenced by wxsEventsEditor::CreateNewFunction(), and wxsEventsEditor::GotoHandler().

    cbStyledTextCtrl* control = GetControl();
    if (centerOnScreen)
        int onScreen = control->LinesOnScreen() >> 1;
        control->GotoLine(line - onScreen);
        control->GotoLine(line + onScreen);
    UnfoldBlockFromLine(line); // make sure it's visible (not folded)

Generated by  Doxygen 1.6.0   Back to index