Пример #1
0
        private Control.RichLabel CreateLabel(ControlBase parent)
        {
            Control.RichLabel label = new Control.RichLabel(parent);
            label.Dock         = Dock.Fill;
            label.LinkClicked += OnLinkClicked;

            Document document = new Document();

            document.Paragraph().
            Font(f1).
            Text("This test uses Arial 15, Red. Padding. ", Color.Red).
            Font(f2).
            Text("This text uses Times New Roman Bold 20, Green. Padding. ", Color.Green).
            Font(f3).
            Text("This text uses Courier New Italic 15, Blue. Padding. ", Color.Blue).
            Font().
            Text("Test link (").
            Link("Test Link 1", "Test Link 1", Color.Blue, new Color(0xFFADD8E6)).
            Text("). ").
            Font(f2).
            Text("Test link custom font (", new Color(0xFFFF00FF)).
            Link("Test Link 2", "Test Link 2", Color.Blue, new Color(0xFFADD8E6), f4).
            Text(").", new Color(0xFFFF00FF));

            document.Paragraph().
            Font(f5).
            Text("\n").
            Text("document.Paragraph().").LineBreak().LineBreak().
            Text("\tFont(f1).").LineBreak().
            Text("\t\tText(\"This test uses Arial 15, Red. Padding. \", Color.Red).").LineBreak().
            Text("\tFont(f2).").LineBreak().
            Text("\t\tText(\"This text uses Times New Roman Bold 20, Green. Padding. \", Color.Green).").LineBreak().
            Text("\tFont(f3).").LineBreak().
            Text("\t\tText(\"This text uses Courier New Italic 15, Blue. Padding. \", Color.Blue).\n\n").
            Text("\tFont().\n").
            Text("\t\tText(\"Test link (\").\n").
            Text("\t\tLink(\"Test Link 1\", \"Test Link 1\", Color.Blue, new Color(0xFFADD8E6)).\n").
            Text("\t\tText(\"). \").\n\n\n").
            Text("\tFont(f2).\n").
            Text("\t\tText(\"Test link custom font (\", new Color(0xFFFF00FF)).\n").
            Text("\t\tLink(\"Test Link 2\", \"Test Link 2\", Color.Blue, new Color(0xFFADD8E6), f4).\n").
            Text("\t\tText(\").\", new Color(0xFFFF00FF));");

            document.Image("gwen.png", new Size(100, 100));

            label.Document = document;

            return(label);
        }
Пример #2
0
        public RichLabel(ControlBase parent) : base(parent)
        {
            Control.RichLabel label = new Control.RichLabel(this);
            label.SetBounds(10, 10, 400, 200);

            f1 = new Font(Skin.Renderer, "Arial", 15);
            label.AddText("This test uses Arial 15, Red. Padding. ", Color.Red, f1);

            f2 = new Font(Skin.Renderer, "Times New Roman Bold", 20);
            label.AddText("This text uses Times New Roman Bold 20, Green. Padding. ", Color.Green, f2);

            f3 = new Font(Skin.Renderer, "Courier New Italic", 15);
            label.AddText("This text uses Courier New Italic 15, Blue. Padding. ", Color.Blue, f3);

            label.AddLineBreak();

            label.AddText("This test uses Arial 15, Magenta. Padding. ", Color.Magenta, f1);
        }
Пример #3
0
        public RichLabel(ZGE.Components.ZComponent parent) : base(parent)
        {
            Control.RichLabel label = new Control.RichLabel(this);
            label.SetBounds(10, 10, 400, 200);

            f1 = new Font(Skin.Renderer, "Arial", 15);
            label.AddText("This test uses Arial 15, Red. Padding. ", Color.Red, f1);
            
            f2 = new Font(Skin.Renderer, "Times New Roman Bold", 20);
            label.AddText("This text uses Times New Roman Bold 20, Green. Padding. ", Color.Green, f2);

            f3 = new Font(Skin.Renderer, "Courier New Italic", 15);
            label.AddText("This text uses Courier New Italic 15, Blue. Padding. ", Color.Blue, f3);

            label.AddLineBreak();

            label.AddText("This test uses Arial 15, Magenta. Padding. ", Color.Magenta, f1);
        }
Пример #4
0
        private void OpenWindow(ControlBase control, EventArgs args)
        {
            Control.Window window = new Control.Window(GetCanvas());
            window.Padding       = Padding.Three;
            window.Title         = String.Format("RichLabel Window");
            window.DeleteOnClose = true;
            window.Size          = new Size(500, 300);
            window.Left          = 200; window.Top = 100;

            Control.ScrollControl scroll = new Control.ScrollControl(window);
            scroll.Dock = Dock.Fill;
            scroll.EnableScroll(false, true);
            scroll.AutoHideBars = false;

            Control.RichLabel label = new Control.RichLabel(scroll);
            label.Dock     = Dock.Fill;
            label.Document = LongDocument();
        }
        public RichLabel(Base parent) : base(parent)
        {
            Control.RichLabel label = new Control.RichLabel(this);
            label.SetBounds(10, 10, 400, 200);

            f1 = new Font(Skin.Renderer, "Arial", 15);
            label.AddText("This test uses Arial 15, Red. Padding. ", Color.Red, f1);

            f2 = new Font(Skin.Renderer, "Times New Roman", 20, FontStyle.Bold);
            label.AddText("This text uses Times New Roman Bold 20, Green. Padding. ", Color.Green, f2);

            f3 = new Font(Skin.Renderer, "Courier New", 15, FontStyle.Italic);
            label.AddText("This text uses Courier New Italic 15, Blue. Padding. ", Color.Blue, f3);

            label.AddLineBreak();

            label.AddText("This test uses Arial 15 Bold Italic Strikethrough, Magenta. Padding. ", Color.Magenta, new Font(Skin.Renderer, "Arial", 15, FontStyle.Bold | FontStyle.Italic | FontStyle.StrikeThrough));
        }
Пример #6
0
        public RichLabel(ControlBase parent) : base(parent)
        {
            Control.RichLabel label = new Control.RichLabel(this);
            label.SetBounds(10, 10, 600, 400);

            f1 = new Font(Skin.Renderer, "Arial", 15);
            label.AddText("This test uses Arial 15, Red. Padding.\n", Color.Red, f1);

            f2 = new Font(Skin.Renderer, "Times New Roman", 20, FontStyle.Bold);
            label.AddText("This text uses Times New Roman Bold 20, Green. Padding.\n", Color.Green, f2);

            f3 = new Font(Skin.Renderer, "Courier New", 15, FontStyle.Italic);
            label.AddText("This text uses Courier New Italic 15, Blue. Padding.\n", Color.Blue, f3);

            f4 = new Font(Skin.Renderer, "Arial", 15, FontStyle.Underline);
            label.AddText("This text uses Arial Underline 15, Red. Padding.\n", Color.Red, f4);

            f5 = new Font(Skin.Renderer, "Times New Roman", 15, FontStyle.Strikeout);
            label.AddText("This text uses Times New Roman Strikeout 15, Green. Padding.\n", Color.Green, f5);

            f6 = new Font(Skin.Renderer, "Courier New", 15, FontStyle.Italic | FontStyle.Bold | FontStyle.Underline | FontStyle.Strikeout);
            label.AddText("This text uses Courier New <All Styles> 15, Blue. Padding.\n", Color.Blue, f6);
        }
Пример #7
0
        public RichLabel(ControlBase parent) : base(parent)
        {
            f1 = new Font(Skin.Renderer, "Arial", 15);

            f2      = new Font(Skin.Renderer, "Times New Roman", 20);
            f2.Bold = true;

            f3        = new Font(Skin.Renderer, "Courier New", 15);
            f3.Italic = true;

            f4           = new Font(Skin.Renderer, "Times New Roman", 20);
            f4.Bold      = true;
            f4.Underline = true;

            f5 = new Font(Skin.Renderer, "Courier New", 10);

            Control.RichLabel label = CreateLabel(this);

            Control.Button button = new Control.Button(this);
            button.Dock     = Dock.Bottom;
            button.Width    = 150;
            button.Text     = "Open a Window";
            button.Clicked += OpenWindow;
        }