Пример #1
0
InfoWindow::InfoWindow(int W, int H, const char *l) : rkWindow(W,H,l)
{
	begin();
	display = new Fl_Text_Display(INFO_MARGIN,INFO_MARGIN,W-(INFO_MARGIN*3),H-INFO_MARGIN*3,0);
	display->wrap_mode(3,0);
	Fl_Text_Buffer *b = new Fl_Text_Buffer();
	b->insert(0, InfoWindow::info);
	display->buffer(b);
	end();
}
Пример #2
0
void CFLTKEditor::Indent()
{
	bool bChangedBuffer = false;
	int iSelStart = 0, iSelEnd = 0, iCurPos = 0;
	Fl_Text_Buffer *pcBuffer = GetTextBuffer();

	pcBuffer->selection_position(&iSelStart, &iSelEnd);
	if (iSelEnd <= iSelStart)
		return;

	iCurPos = pcBuffer->line_start(iSelStart);
	while (pcBuffer->line_end(iCurPos) < iSelEnd)
	{
		bChangedBuffer = true;
		pcBuffer->insert(iCurPos, "\t");
		iCurPos = pcBuffer->skip_lines(iCurPos, 1);
		++iSelEnd;
	}

	if (bChangedBuffer)
		pcBuffer->select(pcBuffer->line_start(iSelStart), iSelEnd);
}