本文整理汇总了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();
}
}