本文整理匯總了C#中MonoDevelop.Ide.Gui.TextEditor.ColumnToX方法的典型用法代碼示例。如果您正苦於以下問題:C# TextEditor.ColumnToX方法的具體用法?C# TextEditor.ColumnToX怎麽用?C# TextEditor.ColumnToX使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類MonoDevelop.Ide.Gui.TextEditor
的用法示例。
在下文中一共展示了TextEditor.ColumnToX方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1:
void IActionTextLineMarker.MouseHover (TextEditor editor, MarginMouseEventArgs args, TextLineMarkerHoverResult result)
{
if (args.Button != 0)
return;
var line = editor.GetLine (loc.Line);
if (line == null)
return;
var x = editor.ColumnToX (line, loc.Column) - editor.HAdjustment.Value + editor.TextViewMargin.TextStartPosition;
var y = editor.LineToY (line.LineNumber + 1) - editor.VAdjustment.Value;
if (args.X - x >= 0 * editor.Options.Zoom &&
args.X - x < tagMarkerWidth * editor.Options.Zoom &&
args.Y - y < (editor.LineHeight / 2) * editor.Options.Zoom) {
result.Cursor = null;
Popup ();
} else {
codeActionEditorExtension.CancelSmartTagPopupTimeout ();
}
}
示例2: Draw
public override void Draw (TextEditor editor, Cairo.Context cr, Pango.Layout layout, bool selected, int startOffset, int endOffset, double y, double startXPos, double endXPos)
{
var line = editor.GetLine (loc.Line);
var x = editor.ColumnToX (line, loc.Column) - editor.HAdjustment.Value + editor.TextViewMargin.XOffset + editor.TextViewMargin.TextStartPosition;
cr.Rectangle (Math.Floor (x) + 0.5, Math.Floor (y) + 0.5 + (line == editor.GetLineByOffset (startOffset) ? editor.LineHeight - tagMarkerHeight - 1 : 0), tagMarkerWidth * cr.LineWidth, tagMarkerHeight * cr.LineWidth);
if (HslColor.Brightness (editor.ColorStyle.PlainText.Background) < 0.5) {
cr.SetSourceRGBA (0.8, 0.8, 1, 0.9);
} else {
cr.SetSourceRGBA (0.2, 0.2, 1, 0.9);
}
cr.Stroke ();
}