public override void Render(G3Canvas g) { if (Text == null) Text = string.Empty; g.BeginDrawing(); Rectangle r = this.Bound; g.FillRectangle(r, G3Color.WHITE); g.Rectangle(r, G3Color.GRAY); byte[] chars; if (Focused) { chars = Parent.Encoding.GetBytes(Text + "\u25cf"); } else { chars = Parent.Encoding.GetBytes(Text); } chars = CropText(chars, Size.Width); g._DrawTextC(chars, FontStyle.Font, Location.X + 2 + (FontStyle.Font.TextWidth(chars) / 2), Location.Y + (Size.Height / 2), FontStyle.FontColor, FontStyle.HaloColor); g.EndDrawing(); }
public void Draw(G3Canvas g, Rectangle bound) { if (Enabled) g.Rectangle(bound, Color); }
public override void Render(G3Canvas g) { // IMPROVE: Bu kod UIElement içine yapılacak bir eklenti ile BeforeAdd ve AfterRemove işlemleri // içerisine taşınacak. Parent.UICanvas.DisableAll(); this.Enable = true; g.BeginDrawing(); g.DarkBox(0, 0, System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width, System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height, 10); int w = this.Size.Width; int h = this.Size.Height; int x = this.Location.X; int y = this.Location.Y; // MessageBox this.Gradient.Draw(g, x, y + 30, w, h); // Title this.TitleGradient.Draw(g, x, y, w, 30); // Title Text g.DrawText(Title, Parent.Encoding, TitleFont, G3Color.BLACK, G3Color.WHITE, TextAlign.Center, new Rectangle(x, y, w, 30)); // Message Text g.DrawText(Text, Parent.Encoding, Font, G3Color.GRAY, G3Color.WHITE, TextAlign.Center, new Rectangle(x, y + 30, w, h)); // Border g.Rectangle(x, y, w, h + 30, G3Color.GRAY); g.EndDrawing(); }
public override void Render(G3Canvas g) { if (!_layoutCreated) { _layoutCreated = true; CreateLayout(); } g.BeginDrawing(); g.FillRectangle(Location.X, Location.Y, Size.Width, Size.Height, G3Color.FromRGB(49, 52, 49)); g.Rectangle(Location.X, Location.Y, Size.Width - 1, Size.Height, G3Color.GRAY); g.EndDrawing(); if (NumericKeyboard) { _canvasNum.Render(g); } else { _canvasAlfa.Render(g); } }