BlockType
One of the following values (the
EDITOR_BLOCK_TYPES enumeration):
If
BlockType is equal to BTYPE_NONE, other fields of the structure are ignored.
BlockStartLine
First line of the selection. The field can be -1 - current line will be the start of the block.
BlockStartPos
Start position of the selection.
If BlockStartPos = -1, text is deselected.
BlockWidth
Block width. Can be negative.
BlockHeight
Block height, should be >= 1
Stream block from (X1,Y1) to (X2,Y2) can be selected in this way:
es.BlockType=BTYPE_STREAM;
es.BlockStartLine=min(Y2,Y1);
es.BlockStartPos=(Y1 < Y2?X1:X2);
// small correction if positions are equal
if(X1 == X2)
es.BlockStartPos+=(Y1 < Y2?1:-1);
es.BlockHeight=max(Y1,Y2)-min(Y1,Y2)+1;
if(Y1 < Y2)
es.BlockWidth=X2-X1+1;
else
es.BlockWidth=X1-X2+1;
if(X1 == X2)
{
if(Y1 < Y2)
es.BlockStartPos--;
else
es.BlockStartPos++;
}
Info.EditorControl(ECTL_SELECT,(void*)&es);