/// <summary> /// Renders the control to a Cairo context. /// </summary> /// <remarks>Calls Render() internally.</remarks> public void RenderCairo(RenderContext context) { if (IsDirty) ComputeGeometry(); context.Cairo.RelMoveTo(Origin.X, Origin.Y); var point = context.Cairo.CurrentPoint; LastPosition = new Coord(point.X, point.Y); context.Decorator.Decorate(this); if (BackgroundColor != null) { context.Cairo.Save(); context.Cairo.Color = BackgroundColor.ToCairo(); context.Cairo.Rectangle(Origin.X, Origin.Y, RenderWidth, RenderHeight); context.Cairo.Fill(); context.Cairo.Restore(); } Render(context); context.Cairo.RelMoveTo(-Origin.X, -Origin.Y); }
protected override void Render(RenderContext context) { base.Render(context); if (IsDirty) ComputeGeometry(); }
protected override void Render(RenderContext rc) { rc.Push(); rc.Cairo.Color = new Cairo.Color(1, 1, 1); rc.Cairo.Rectangle(-0.5, -0.5, RenderWidth, RenderHeight); rc.Cairo.Fill(); rc.Cairo.Color = new Cairo.Color(0, 0, 0); rc.Cairo.LineWidth = 4; rc.Cairo.Rectangle(-0.5, -0.5, RenderWidth, RenderHeight); rc.Cairo.Stroke(); rc.Pop(); base.Render(rc); }
protected override void Render(RenderContext context) { base.Render(context); Color.Setup(); // if (ShowMarker) // { // PointPlot.SetupShape(MarkerShape); // gl.glPointSize(MarkerSize * 2); // gl.glBegin(gl.GL_POINTS); // (size / 2).glVertex(); // gl.glEnd(); // } // // if (ShowLine) // { // gl.glLineWidth(LineWidth); // gl.glBegin(gl.GL_LINES); // double y = Height / 2; // gl.glVertex2d(0 , y); // gl.glVertex2d(Width , y); // gl.glEnd(); // } }
protected override void Render(RenderContext context) { base.Render(context); if (Label != null && Label.IsVisible) Label.RenderCairo(context); if (Image != null && Image.IsVisible) Image.RenderCairo(context); if (IsSelected && !IsTogglable && _justKeyActivated) { _justKeyActivated = false; IsSelected = false; MakeDirty(); } }
protected override void Render(RenderContext context) { base.Render(context); if (Image1 != null) Image1.RenderCairo(context); if (Image2 != null) Image2.RenderCairo(context); }
protected override void Render(RenderContext context) { base.Render(context); }
protected override void Render(RenderContext context) { base.Render(context); button.RenderCairo(context); if (Content != null) Content.RenderCairo(context); }
protected override void Render(RenderContext context) { base.Render(context); _textBox.RenderCairo(context); _upButton.RenderCairo(context); _downButton.RenderCairo(context); }
protected override void Render(RenderContext context) { base.Render(context); // render the text context.Cairo.SetFontSize(_lastFontSize); context.Cairo.Color = new Cairo.Color(0, 0, 0); var point = context.Cairo.CurrentPoint; context.Cairo.Color = context.Decorator.GetColor(ColorType.Text, HitState.None).ToCairo(); context.Cairo.MoveTo(point.X + Padding, point.Y + Padding + _lastFontSize - 2); context.Cairo.ShowText(Text); // highlight if the user is hovering if (IsHovering) { context.Cairo.Color = context.Decorator.SelectionColor.ToCairo(); context.Cairo.Rectangle(point, RenderWidth, RenderHeight); context.Cairo.Fill(); } context.Cairo.MoveTo(point); }
/// <summary> /// Performs the 2D rendering of the control. /// </summary> protected virtual void Render(RenderContext rc) { }
/// <summary> /// Renders the image at the current position in the context. /// </summary> public void RenderHere(RenderContext context) { var pos = context.Cairo.CurrentPoint; context.Cairo.Save(); context.Cairo.SetSourceSurface(surface, (int)pos.X, (int)pos.Y); context.Cairo.Paint(); context.Cairo.Restore(); }
protected override void Render(RenderContext rc) { base.Render(rc); rc.Cairo.Save(); rc.Cairo.SetSourceSurface(surface, (int)LastPosition.X, (int)LastPosition.Y); if (IsGrayed) rc.Cairo.PaintWithAlpha(0.5); else rc.Cairo.Paint(); rc.Cairo.Restore(); }
protected override void Render(RenderContext context) { // render the decorations CloseButton.RenderCairo(context); _titleLabel.RenderCairo(context); // render the content context.Cairo.RelMoveTo(0, TitleHeight); context.Push(); base.Render(context); context.Pop(); }