本文整理汇总了C++中TextEdit::cursor_get_column方法的典型用法代码示例。如果您正苦于以下问题:C++ TextEdit::cursor_get_column方法的具体用法?C++ TextEdit::cursor_get_column怎么用?C++ TextEdit::cursor_get_column使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextEdit
的用法示例。
在下文中一共展示了TextEdit::cursor_get_column方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: reload_text
void TextEditor::reload_text() {
ERR_FAIL_COND(text_file.is_null());
TextEdit *te = code_editor->get_text_edit();
int column = te->cursor_get_column();
int row = te->cursor_get_line();
int h = te->get_h_scroll();
int v = te->get_v_scroll();
te->set_text(text_file->get_text());
te->clear_undo_history();
te->cursor_set_line(row);
te->cursor_set_column(column);
te->set_h_scroll(h);
te->set_v_scroll(v);
te->tag_saved_version();
code_editor->update_line_and_column();
}
示例2: _edit_option
//.........这里部分代码省略.........
case EDIT_INDENT_RIGHT: {
TextEdit *tx = code_editor->get_text_edit();
Ref<Script> scr = get_edited_script();
if (scr.is_null())
return;
tx->begin_complex_operation();
if (tx->is_selection_active())
{
tx->indent_selection_right();
}
else
{
int begin = tx->cursor_get_line();
String line_text = tx->get_line(begin);
line_text = '\t' + line_text;
tx->set_line(begin, line_text);
}
tx->end_complex_operation();
tx->update();
//tx->deselect();
} break;
case EDIT_CLONE_DOWN: {
TextEdit *tx = code_editor->get_text_edit();
Ref<Script> scr = get_edited_script();
if (scr.is_null())
return;
int from_line = tx->cursor_get_line();
int to_line = tx->cursor_get_line();
int column = tx->cursor_get_column();
if (tx->is_selection_active()) {
from_line = tx->get_selection_from_line();
to_line = tx->get_selection_to_line();
column = tx->cursor_get_column();
}
int next_line = to_line + 1;
tx->begin_complex_operation();
for (int i = from_line; i <= to_line; i++) {
if (i >= tx->get_line_count() - 1) {
tx->set_line(i, tx->get_line(i) + "\n");
}
String line_clone = tx->get_line(i);
tx->insert_at(line_clone, next_line);
next_line++;
}
tx->cursor_set_column(column);
if (tx->is_selection_active()) {
tx->select(to_line + 1, tx->get_selection_from_column(), next_line - 1, tx->get_selection_to_column());
}
tx->end_complex_operation();
tx->update();
} break;
case EDIT_TOGGLE_COMMENT: {
TextEdit *tx = code_editor->get_text_edit();
Ref<Script> scr = get_edited_script();