本文整理汇总了C#中Drawable.DrawLine方法的典型用法代码示例。如果您正苦于以下问题:C# Drawable.DrawLine方法的具体用法?C# Drawable.DrawLine怎么用?C# Drawable.DrawLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Drawable
的用法示例。
在下文中一共展示了Drawable.DrawLine方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Render
protected override void Render(Drawable window, Widget widget, Rectangle background_area, Rectangle cell_area, Rectangle expose_area, CellRendererState flags)
{
int width, height;
GetCellSize (widget, (int)(cell_area.Width - this.Xpad * 2), out width, out height);
int x = (int) (cell_area.X + this.Xpad);
int y = cell_area.Y + (cell_area.Height - height) / 2;
StateType state;
if (!sensitive)
state = StateType.Insensitive;
else if ((flags & CellRendererState.Selected) != 0)
state = StateType.Selected;
else
state = StateType.Normal;
if (IsGroup) {
TreeGroup grp = new TreeGroup ();
grp.X = x;
grp.Y = y;
grp.Group = Text;
grp.State = state;
InternalTree tree = (InternalTree) widget;
tree.Groups.Add (grp);
} else {
window.DrawLayout (widget.Style.TextGC (state), x, y, layout);
int bx = background_area.X + background_area.Width - 1;
Gdk.GC gc = new Gdk.GC (window);
gc.RgbFgColor = tree.Style.MidColors [(int)Gtk.StateType.Normal];
window.DrawLine (gc, bx, background_area.Y, bx, background_area.Y + background_area.Height);
}
}