private void UpdatePreviewColors() { CustomColorTable = new Extensions.OverridenColorTable() { UseSystemColors = false, ColorMenuBorder = Color.Black, ColorMenuBarBackground = MenuStripBarBackground, ColorMenuItemSelected = MenuStripBackgroundSelected, ColorMenuBackground = MenuStripBackground, TextColor = MenuStripText }; tableLayoutPanel3.BackColor = FormBackground; tableLayoutPanel3.ForeColor = FormTextColor; menuStrip1.Renderer = new ToolStripProfessionalRenderer(CustomColorTable); menuStrip1.ForeColor = MenuStripBarText; ReColorChildren(menuStrip1); RB_Preview.BackColor = LineColorBackground; RB_Preview.Clear(); AppendChatLine("This is the generic line, which is usually any chat message", LineType.Generic); AppendChatLine("This is the irc command line, which is usually received when receiving information like connection state change / verification / moderation rights", LineType.IrcCommand); AppendChatLine("This is the moderation line, which is when a moderator uses a mod only command (rare one)", LineType.ModCommand); AppendChatLine("This is a sound playback line, which is when a user uses a sound", LineType.SoundCommand); }
private void AddPreviewText(string text, LineType type) { // InvokeRequired required compares the thread ID of the // calling thread to the thread ID of the creating thread. // If these threads are different, it returns true. if (this.RB_Preview.InvokeRequired) { SetPreviewTextDelegate d = new SetPreviewTextDelegate(AddPreviewText); this.Invoke(d, new object[] { text, type }); } else { RB_Preview.AppendText(text + "\n"); RB_Preview.Select(RB_Preview.Text.Length - text.Length - 1, text.Length); switch (type) { case LineType.Generic: RB_Preview.SelectionColor = _programSettings.Colors.LineColorGeneric; break; case LineType.IrcCommand: RB_Preview.SelectionColor = _programSettings.Colors.LineColorIrcCommand; break; case LineType.ModCommand: RB_Preview.SelectionColor = _programSettings.Colors.LineColorModeration; break; case LineType.SoundCommand: RB_Preview.SelectionColor = _programSettings.Colors.LineColorSoundPlayback; break; default: RB_Preview.SelectionColor = _programSettings.Colors.LineColorGeneric; break; } } }
private void UpdateColors() { var CustomColorTable = new Extensions.OverridenColorTable() { UseSystemColors = false, ColorMenuBorder = Color.Black, ColorMenuBarBackground = _programSettings.Colors.MenuStripBarBackground, ColorMenuItemSelected = _programSettings.Colors.MenuStripBackgroundSelected, ColorMenuBackground = _programSettings.Colors.MenuStripBackground, TextColor = _programSettings.Colors.MenuStripText }; this.BackColor = _programSettings.Colors.FormBackground; this.ForeColor = _programSettings.Colors.FormTextColor; menuStrip1.Renderer = new ToolStripProfessionalRenderer(CustomColorTable); menuStrip1.ForeColor = _programSettings.Colors.MenuStripBarText; ReColorChildren(menuStrip1); RB_Preview.BackColor = _programSettings.Colors.LineColorBackground; RB_Preview.Clear(); }
private void AppendChatLine(string text, LineType linetype) { RB_Preview.AppendText(text + "\n"); RB_Preview.Select(RB_Preview.Text.Length - text.Length - 1, text.Length); switch (linetype) { case LineType.IrcCommand: RB_Preview.SelectionColor = LineColorIrcCommand; break; case LineType.ModCommand: RB_Preview.SelectionColor = LineColorModeration; break; case LineType.SoundCommand: RB_Preview.SelectionColor = LineColorSoundPlayback; break; default: RB_Preview.SelectionColor = LineColorGeneric; break; } }
private void RB_Preview_TextChanged(object sender, EventArgs e) { RB_Preview.SelectionStart = RB_Preview.Text.Length; RB_Preview.ScrollToCaret(); }