示例#1
0
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);
}
示例#2
0
	/**
	 * 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() );
		}
	}
示例#3
0
int TMemo::get_line_colour(int l)
{
    int offs = line_offset(l);
    set_selection(offs,offs);
    return get_text_colour();
}
示例#4
0
void TMemo::go_to_line(int line)
{
	int ofs = line_offset(line-1);
	go_to(ofs,-1,current_line() > line ? -10 : +10);
}