Ejemplo n.º 1
0
        protected void UpdateWindowListMenu()
        {
            if (_windowListToolStripMenuItem == null)
            {
                return;
            }
            _windowListToolStripMenuItem.DropDownItems.Clear();
            ToolStripMenuItem mi;
            Form   f;
            string s;

            for (int i = 0; i < _myChildren.Count; i++)
            {
                f  = _myChildren[i];
                s  = string.Format("{0}: {1}", i, f.Text);
                mi = new ToolStripMenuItem(s);
                if (f == ActiveMdiChild)
                {
                    mi.Checked = true;
                }
                mi.Tag = i;
                _windowListToolStripMenuItem.DropDownItems.Add(mi);
            }
            ColorThemeHelper.ApplyToControlA(_windowListToolStripMenuItem, MyColorTheme);
        }
Ejemplo n.º 2
0
        public void CheckMyFontAndColors()
        {
            this.Font = Settings.FormFont;
            foreach (Control c in this.Controls)
            {
                if (c is ToolStrip || c is MenuStrip)
                {
                    c.Font = this.Font;
                    foreach (var ti in (c as ToolStrip).Items)
                    {
                        if (ti is ToolStripComboBox)
                        {
                            (ti as ToolStripComboBox).Font = this.Font;
                        }
                    }
                }
                else
                {
                    if (!c.Font.Equals(this.Font))
                    {
                        c.Font = new Font(
                            this.Font.FontFamily,
                            this.Font.SizeInPoints,
                            c.Font.Style);
                    }
                }
            }
            MyColorTheme cth = Settings.ColorTheme;

            ColorThemeHelper.ApplyToForm(this, cth);
        }
Ejemplo n.º 3
0
        protected void UpdateWindowListToolStrip()
        {
            if (_windowListToolStrip == null)
            {
                return;
            }
            ToolStripItem mi;
            Form          f;
            string        s;

            if (_windowListToolStrip.Items.Count > _myChildren.Count)
            {
                for (int i = 0; i < _windowListToolStrip.Items.Count - _myChildren.Count; i++)
                {
                    _windowListToolStrip.Items.RemoveAt(_windowListToolStrip.Items.Count - 1);
                }
            }
            if (_windowListToolStrip.Items.Count < _myChildren.Count)
            {
                for (int i = 0; i < _myChildren.Count - _windowListToolStrip.Items.Count; i++)
                {
                    mi = _windowListToolStrip.Items.Add("");
                    mi.DisplayStyle = ToolStripItemDisplayStyle.Text;
                }
            }
            for (int i = 0; i < _myChildren.Count; i++)
            {
                f = _myChildren[i];
                //⬜ ❏
                //s = string.Format("{0}: {1}", i, f.Text);
                s  = string.Format("❏ {0}", f.Text);
                mi = _windowListToolStrip.Items[i];
                if (mi.Text != s)
                {
                    mi.Text = s;
                }
                mi.Tag = i;
                if (f == ActiveMdiChild)
                {
                    mi.Font = new Font(_windowListToolStrip.Font, FontStyle.Underline);
                }
                else
                {
                    mi.Font = _windowListToolStrip.Font;
                }
            }
            ColorThemeHelper.ApplyToControlA(_windowListToolStrip, MyColorTheme);
        }
Ejemplo n.º 4
0
 public void UseSystemColors()
 {
     WindowColor = SystemColors.Window;
     WindowTextColor = SystemColors.WindowText;
     ControlColor = SystemColors.Control;
     ControlTextColor = SystemColors.ControlText;
     ControlColorLight = SystemColors.ControlLight;
     ControlColorDark = SystemColors.ControlDark;
     ControlColorDarkDark = SystemColors.ControlDarkDark;
     //MenuHighlight = SystemColors.MenuHighlight;
     MenuHighlight = ColorThemeHelper.ColorBetween(WindowColor, WindowTextColor, 0.2f);
     
     BorderColor = ControlColorDarkDark;
     UsingSystemColors = true;
     MakeTables();
 }
Ejemplo n.º 5
0
 protected void SetColorTheme(MyColorTheme theme)
 {
     ColorThemeHelper.ApplyToForm(this, theme);
 }