void TMemo::set_line_colour(int line, int colour) { int old = current_pos(); int ofs1 = line_offset(line-1), ofs2 = line_offset(line); set_selection(ofs1,ofs2); set_text_colour(colour); set_selection(old,old); }
/** * Place a new line into the buffer, deleting existing line and so forth. * @param line The line to insert. */ void CVue::place() { CARIBOU::CString skipchars; skipchars.append(TOKEN_CR); skipchars.append("0123456789 \t"); /* delete existing? */ delete_line(line_offset(m_command.toInt())); /* any content after line#? */ if ( m_command.skip(skipchars.data()) < m_command.length() ) { /* insert */ inherited::program().insert( m_command.data(), insert_offset(m_command.toInt()), inherited::program().length() ? m_command.length() : m_command.size() ); } }
int TMemo::get_line_colour(int l) { int offs = line_offset(l); set_selection(offs,offs); return get_text_colour(); }
void TMemo::go_to_line(int line) { int ofs = line_offset(line-1); go_to(ofs,-1,current_line() > line ? -10 : +10); }