private void setColor(CodeVendor.Controls.Grouper p, LyricsType item) { switch (item) { case LyricsType.Verse: p.BackgroundColor = Color.AliceBlue; p.BackgroundGradientColor = Color.LightBlue; break; case LyricsType.Chorus: p.BackgroundColor = Color.LightGoldenrodYellow; //Color.LightYellow; p.BackgroundGradientColor = Color.Moccasin; break; case LyricsType.Other: p.BackgroundColor = Color.MintCream; p.BackgroundGradientColor = Color.LightGreen; break; } }
/// <summary>Initialization</summary> private void InitializeComponent() { System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(TestHarness)); this.groupBox1 = new CodeVendor.Controls.Grouper(); this.label2 = new System.Windows.Forms.Label(); this.Visit = new System.Windows.Forms.Button(); this.groupBox2 = new CodeVendor.Controls.Grouper(); this.label3 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); this.pictureBox2 = new System.Windows.Forms.PictureBox(); this.linkLabel1 = new System.Windows.Forms.LinkLabel(); this.pictureBox3 = new System.Windows.Forms.PictureBox(); this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); this.SuspendLayout(); // // groupBox1 // this.groupBox1.BackgroundColor = System.Drawing.Color.White; this.groupBox1.BackgroundGradientColor = System.Drawing.SystemColors.Desktop; this.groupBox1.BackgroundGradientMode = CodeVendor.Controls.Grouper.GroupBoxGradientMode.Vertical; this.groupBox1.BorderColor = System.Drawing.SystemColors.Desktop; this.groupBox1.BorderThickness = 1F; this.groupBox1.Controls.Add(this.label2); this.groupBox1.Controls.Add(this.Visit); this.groupBox1.Controls.Add(this.groupBox2); this.groupBox1.Controls.Add(this.pictureBox1); this.groupBox1.CustomGroupBoxColor = System.Drawing.Color.White; this.groupBox1.DockPadding.All = 20; this.groupBox1.GroupImage = ((System.Drawing.Image)(resources.GetObject("groupBox1.GroupImage"))); this.groupBox1.GroupTitle = "The Grouper"; this.groupBox1.Location = new System.Drawing.Point(24, 16); this.groupBox1.Name = "groupBox1"; this.groupBox1.PaintGroupBox = false; this.groupBox1.RoundCorners = 15; this.groupBox1.ShadowColor = System.Drawing.Color.DarkGray; this.groupBox1.ShadowControl = true; this.groupBox1.ShadowThickness = 5; this.groupBox1.Size = new System.Drawing.Size(488, 240); this.groupBox1.TabIndex = 1; // // label2 // this.label2.BackColor = System.Drawing.Color.Transparent; this.label2.Location = new System.Drawing.Point(368, 16); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(100, 16); this.label2.TabIndex = 1; this.label2.Text = "Version: 1.0a"; this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // Visit // this.Visit.BackColor = System.Drawing.SystemColors.Desktop; this.Visit.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.Visit.ForeColor = System.Drawing.Color.White; this.Visit.Location = new System.Drawing.Point(320, 176); this.Visit.Name = "Visit"; this.Visit.Size = new System.Drawing.Size(96, 23); this.Visit.TabIndex = 2; this.Visit.Text = "Visit Website"; this.Visit.Click += new System.EventHandler(this.Visit_Click); // // groupBox2 // this.groupBox2.BackgroundColor = System.Drawing.Color.White; this.groupBox2.BackgroundGradientColor = System.Drawing.Color.White; this.groupBox2.BackgroundGradientMode = CodeVendor.Controls.Grouper.GroupBoxGradientMode.None; this.groupBox2.BorderColor = System.Drawing.Color.Black; this.groupBox2.BorderThickness = 1F; this.groupBox2.Controls.Add(this.label3); this.groupBox2.Controls.Add(this.label1); this.groupBox2.Controls.Add(this.pictureBox2); this.groupBox2.Controls.Add(this.linkLabel1); this.groupBox2.Controls.Add(this.pictureBox3); this.groupBox2.CustomGroupBoxColor = System.Drawing.Color.White; this.groupBox2.DockPadding.All = 20; this.groupBox2.GroupImage = null; this.groupBox2.GroupTitle = ""; this.groupBox2.Location = new System.Drawing.Point(16, 32); this.groupBox2.Name = "groupBox2"; this.groupBox2.PaintGroupBox = false; this.groupBox2.RoundCorners = 10; this.groupBox2.ShadowColor = System.Drawing.SystemColors.Desktop; this.groupBox2.ShadowControl = true; this.groupBox2.ShadowThickness = 3; this.groupBox2.Size = new System.Drawing.Size(232, 184); this.groupBox2.TabIndex = 0; // // label3 // this.label3.Location = new System.Drawing.Point(96, 88); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(128, 64); this.label3.TabIndex = 2; this.label3.Text = "The control can paint borders, dropshadows, gradient and solid backgrounds, custo" + "m text and custom icons."; // // label1 // this.label1.Location = new System.Drawing.Point(96, 24); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(128, 56); this.label1.TabIndex = 0; this.label1.Text = "The grouper is a special groupbox control that is rounded and fully customizable." + ""; // // pictureBox2 // this.pictureBox2.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox2.Image"))); this.pictureBox2.Location = new System.Drawing.Point(8, 16); this.pictureBox2.Name = "pictureBox2"; this.pictureBox2.Size = new System.Drawing.Size(85, 160); this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; this.pictureBox2.TabIndex = 1; this.pictureBox2.TabStop = false; // // linkLabel1 // this.linkLabel1.Location = new System.Drawing.Point(120, 160); this.linkLabel1.Name = "linkLabel1"; this.linkLabel1.Size = new System.Drawing.Size(100, 16); this.linkLabel1.TabIndex = 1; this.linkLabel1.TabStop = true; this.linkLabel1.Text = "Read More..."; this.linkLabel1.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked_1); // // pictureBox3 // this.pictureBox3.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox3.Image"))); this.pictureBox3.Location = new System.Drawing.Point(99, 80); this.pictureBox3.Name = "pictureBox3"; this.pictureBox3.Size = new System.Drawing.Size(110, 4); this.pictureBox3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; this.pictureBox3.TabIndex = 1; this.pictureBox3.TabStop = false; // // pictureBox1 // this.pictureBox1.BackColor = System.Drawing.Color.Transparent; this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image"))); this.pictureBox1.Location = new System.Drawing.Point(248, 40); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new System.Drawing.Size(230, 120); this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; this.pictureBox1.TabIndex = 1; this.pictureBox1.TabStop = false; // // TestHarness // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(534, 279); this.Controls.Add(this.groupBox1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.Name = "TestHarness"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "The Grouper Test Harness (Beta)"; this.groupBox1.ResumeLayout(false); this.groupBox2.ResumeLayout(false); this.ResumeLayout(false); }
private void Update() { WhatChanged(); int i = 0; int totalrows = 0; int blankrows = 1; if (verseSeparator == SongVerseSeparator.TwoBlankLines) { blankrows = 2; } try { if (renew) { #region renew RemoveBackground(); foreach (string line in oldLines) { string[] mystringarr = line.Split("\n".ToCharArray()); int rows = mystringarr.Length; // Background Panel CodeVendor.Controls.Grouper p = new CodeVendor.Controls.Grouper(); p.Height = (rows * textHeight) + 14; p.Width = rtePanel.Width + 1; p.Location = new Point(-1, (totalrows * textHeight) - 11); p.BackgroundGradientMode = CodeVendor.Controls.Grouper.GroupBoxGradientMode.ForwardDiagonal; //p.BackgroundColor = GetColor((SongListItem)Typelist[i]); //p.BackgroundGradientColor = Color.LightBlue; setColor(p, (LyricsType)Typelist[i]); p.GroupTitle = ""; p.BorderColor = Color.White; p.RoundCorners = 0; p.Hide(); rtePanel.Controls.Add(p); p.Name = i.ToString(); p.SendToBack(); p.Show(); //Button RibbonStyle.RibbonMenuButton b = new RibbonStyle.RibbonMenuButton(); b.SetBounds(0, (totalrows * textHeight), 30, (rows * textHeight) + 4); b.Text = ""; //b.Click += new System.EventHandler(this.TextButton_Click); b.MouseDown += new MouseEventHandler(b_MouseDown); b.ColorBase = System.Drawing.Color.FromArgb(((int)(((byte)(186)))), ((int)(((byte)(209)))), ((int)(((byte)(240))))); b.ColorBaseStroke = System.Drawing.Color.FromArgb(((int)(((byte)(152)))), ((int)(((byte)(187)))), ((int)(((byte)(213))))); b.ColorOn = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(240)))), ((int)(((byte)(255))))); b.ColorOnStroke = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(153)))), ((int)(((byte)(255))))); b.ColorPress = System.Drawing.Color.FromArgb(((int)(((byte)(194)))), ((int)(((byte)(224)))), ((int)(((byte)(255))))); b.ColorPressStroke = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(153)))), ((int)(((byte)(255))))); b.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; b.ImageLocation = RibbonStyle.RibbonMenuButton.e_imagelocation.Left; b.ImageOffset = 2; b.KeepPress = false; b.SinglePressButton = false; b.FadingSpeed = 35; b.Name = i.ToString(); b.ContextMenuStrip = this.contextMenuStrip; b.Arrow = RibbonStyle.RibbonMenuButton.e_arrow.ToDown; b.SplitButton = RibbonStyle.RibbonMenuButton.e_splitbutton.Yes; b.SplitDistance = b.Width; if ((LyricsType)Typelist[i] == LyricsType.Verse) { b.Image = global::DreamBeam.Properties.Resources.verse; } else if ((LyricsType)Typelist[i] == LyricsType.Chorus) { b.Image = global::DreamBeam.Properties.Resources.chorus; } else { b.Image = global::DreamBeam.Properties.Resources.Other; } b.MaxImageSize = new Point(16, 16); ButtonPanel.Controls.Add(b); if (verseSeparator == SongVerseSeparator.OneBlankLine) { separator = "\n\n"; } totalrows = rows + blankrows + totalrows; i++; } renew = false; #endregion } else { #region refresh while (i < Typelist.Count) { foreach (Control c in ButtonPanel.Controls) { if (c.Name == i.ToString()) { string[] mystringarr = oldLines[i].Split("\n".ToCharArray()); int rows = mystringarr.Length; ((RibbonStyle.RibbonMenuButton)c).SetBounds(0, (totalrows * textHeight), 30, (rows * textHeight) + 4); if ((LyricsType)Typelist[i] == LyricsType.Verse) { ((RibbonStyle.RibbonMenuButton)c).Image = global::DreamBeam.Properties.Resources.verse; } else if ((LyricsType)Typelist[i] == LyricsType.Chorus) { ((RibbonStyle.RibbonMenuButton)c).Image = global::DreamBeam.Properties.Resources.chorus; } else { ((RibbonStyle.RibbonMenuButton)c).Image = global::DreamBeam.Properties.Resources.Other; } totalrows = rows + blankrows + totalrows; i++; } } } totalrows = 0; i = 0; while (i < Typelist.Count) { foreach (Control c in rtePanel.Controls) { if (c.Name == i.ToString() && c.Visible) { string[] mystringarr = oldLines[i].Split("\n".ToCharArray()); int rows = mystringarr.Length; c.Hide(); setColor((CodeVendor.Controls.Grouper)c, (LyricsType)Typelist[i]); c.Location = new Point(-1, (totalrows * textHeight) - 11); c.Height = (rows * textHeight) + 14; c.Width = rtePanel.Width + 1; totalrows = rows + blankrows + totalrows; c.SendToBack(); c.Show(); rte.BringToFront(); i++; } } } #endregion } }catch (Exception e) {} }
public Form_Login() { this.Grouper1 = new CodeVendor.Controls.Grouper(); InitializeComponent(); this.ControlBox = false; }