public override void Render(GUIRenderContext Context) { Context.PushClip(new Rectangle(this._Size)); Context.PushTranslate(-new Point(Math.Round(this._Offset.X), Math.Round(this._Offset.Y))); this._Client.Render(Context); Context.Pop(); Context.Pop(); }
public override void Render(GUIRenderContext Context) { Rectangle inner = new Rectangle(new Point(), this.Size); Context.PushClip(inner); foreach (_Child c in this._Children) { Context.PushTranslate(c.Offset); c.Control.Render(Context); Context.Pop(); } Context.Pop(); }
public override void Render(GUIRenderContext Context) { Skin skin = this._Style.Skin; Surface surfback = skin.GetSurface(this._Style.Backing, this.Size); Context.DrawSurface(surfback); double width = this.Size.X * this._Value; Rectangle clip = new Rectangle(0, 0, width, this.Size.Y); Context.PushClip(clip); Surface surfprog = skin.GetSurface(this._Style.Progress, this.Size); Context.DrawSurface(surfprog); Context.Pop(); }
public override void Render(GUIRenderContext Context) { Context.PushClip(new Rectangle(this.Size)); double d = 0.0; foreach (_Child c in this._Children) { Context.PushTranslate(new Point(d, 0.0).SwapIf(this._Direction == Axis.Vertical)); c.Control.Render(Context); Context.Pop(); d += c.Size + this._Seperation; } Context.Pop(); }
public override void Render(GUIRenderContext Context) { if (this._Text != null && this._Text != "") { if (this._Sample == null) { this._CreateSample(); } //Context.DrawText(this._Color, this._Sample, new Rectangle(this.Size)); /* Skin s = this._Style.Skin; Context.DrawSurface(s.GetSurface(this._Style.Textbox, this.Size)); */ Rectangle inner = new Rectangle(this.Size); Context.PushClip(inner); // Draw text Point texloc = new Point(inner.Location.X, inner.Location.Y + inner.Size.Y / 2.0 - this._Sample.Size.Y / 2.0); Context.DrawText(this._Color, this._Sample, texloc); // Draw selection if (this._Selection != null) { int starti; int endi; this._Selection.Order(out starti, out endi); Rectangle[] charbounds = this._Sample.CharacterBounds; if (endi - starti > 0) { double startx = inner.Location.X + Textbox.SelectionX(charbounds, starti); double endx = inner.Location.X + Textbox.SelectionX(charbounds, endi); Rectangle clip = new Rectangle(startx, inner.Location.Y, endx - startx, inner.Size.Y); Context.PushClip(clip); Context.DrawSolid(this._Style.SelectionBackgroundColor, clip); Context.DrawText(this._Style.SelectionTextColor, this._Sample, texloc); Context.Pop(); } } Context.Pop(); } }
public override void Render(GUIRenderContext Context) { Skin s = this._Style.Skin; Context.DrawSurface(s.GetSurface(this._Style.Textbox, this.Size)); Rectangle inner = new Rectangle(this.Size).Margin(this._Style.InteriorMargin); Context.PushClip(inner); // Draw text Point texloc = new Point(inner.Location.X, inner.Location.Y + inner.Size.Y / 2.0 - this._TextSample.Size.Y / 2.0); Context.DrawText(this._Style.TextColor, this._TextSample, texloc); // Draw selection if (this._Selection != null) { int starti; int endi; this._Selection.Order(out starti, out endi); Rectangle[] charbounds = this._TextSample.CharacterBounds; if (endi - starti > 0) { double startx = inner.Location.X + SelectionX(charbounds, starti); double endx = inner.Location.X + SelectionX(charbounds, endi); Rectangle clip = new Rectangle(startx, inner.Location.Y, endx - startx, inner.Size.Y); Context.PushClip(clip); Context.DrawSolid(this._Style.SelectionBackgroundColor, clip); Context.DrawText(this._Style.SelectionTextColor, this._TextSample, texloc); Context.Pop(); } // Draw cursor if (_CursorFlashTime > 0.0) { int curi = this._Selection.Start; double cursx = inner.Location.X + SelectionX(charbounds, curi); Context.DrawSolid(this._Style.CursorColor, new Rectangle(cursx, inner.Location.Y, 1.0, inner.Size.Y)); } } Context.Pop(); }