本文整理匯總了C#中Mono.TextEditor.DocumentLine.GetVisualColumn方法的典型用法代碼示例。如果您正苦於以下問題:C# DocumentLine.GetVisualColumn方法的具體用法?C# DocumentLine.GetVisualColumn怎麽用?C# DocumentLine.GetVisualColumn使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Mono.TextEditor.DocumentLine
的用法示例。
在下文中一共展示了DocumentLine.GetVisualColumn方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: DrawLinePortion
int DrawLinePortion(Context cr, ChunkStyle style, TextLayout layout, DocumentLine line, int visualOffset, int logicalLength)
{
int logicalColumn = line.GetLogicalColumn(editor, visualOffset);
int logicalEndColumn = logicalColumn + logicalLength;
int visualEndOffset = line.GetVisualColumn(editor, logicalEndColumn);
int visualLength = visualEndOffset - visualOffset;
int indexOffset = visualOffset - 1;
layout.SetFontStyle(style.FontStyle, indexOffset, visualLength);
layout.SetFontWeight(style.FontWeight, indexOffset, visualLength);
if (style.Underline)
layout.SetUnderline(indexOffset, visualLength);
layout.SetForeground(style.Foreground, indexOffset, visualLength);
return visualEndOffset;
}
示例2: ColumnToX
public double ColumnToX(DocumentLine line, int column)
{
int visualColumn = line.GetVisualColumn(editor, column);
return (visualColumn - 1) * CharWidth;
}
示例3: DrawBackground
protected internal override void DrawBackground(Context cr, Xwt.Rectangle area, DocumentLine line, int lineNumber, double x, double y, double height)
{
if (line == null) return;
if (lineNumber == editor.Caret.Line)
{
cr.SetColor(editor.Options.ColorScheme.LineMarker.Color);
cr.Rectangle(x, y, editor.GetWidth(), height);
cr.Fill();
}
var style = SyntaxModeService.DefaultColorStyle;
var selectionStyle = editor.HasFocus ? style.SelectedText : style.SelectedInactiveText;
var selectionSegment = GetSegmentForLine(editor.Selection, line);
if (selectionSegment != null)
{
int logicalStartColumn = selectionSegment.Value.Offset - line.Offset;
int visualStartColumn = line.GetVisualColumn(editor, logicalStartColumn);
if (selectionSegment.Value.Offset == line.Offset)
visualStartColumn = 0;
int logicalEndColumn = selectionSegment.Value.EndOffset - line.Offset;
int visualEndColumn = line.GetVisualColumn(editor, logicalEndColumn);
if (editor.Selection.EndOffset != selectionSegment.Value.EndOffset && visualEndColumn > 0)
visualEndColumn--;
if (editor.Selection.Contains(line.EndOffset))
++visualEndColumn;
cr.SetColor(selectionStyle.Background);
double startX = x + visualStartColumn * CharWidth;
double endX = x + visualEndColumn * CharWidth;
cr.Rectangle(startX, y, endX - startX, LineHeight);
cr.Fill();
}
}