示例#1
0
        protected virtual void ApplySkin(object sender, EventArgs e)
        {
            CurrentBaseSkin = SkinHandler.GetCurrentSkin();
            ApplyControlSkins(Controls);

            BackColor = CurrentBaseSkin.BackColor;
        }
示例#2
0
        public ListTestGump() : base(0, 0)
        {
            SkillSettings.DoTell("Setting up new ListTestGump.");
            BaseSkin skin = SkinHelper.getSkin(SkillSettings.ControlSkinName);

            this.AddBackground(0, 0, 500, 500, 9270);
            GumpList list = new GumpList(this, "details", skin);

            SkillSettings.DoTell("List Created.");
            GumpListEntry e1 = new GumpListEntry(0, 0, list, skin.EntryDefaultWidth, skin.EntryDefaultHeight);

            e1.AddColumn("This is a column.");
            e1.AddColumn("This is a 2nd column.");
            e1.AddColumn("This is the 3rd column.");
            SkillSettings.DoTell("Entry 1 Created.");
            GumpListEntry e2 = new GumpListEntry(0, 0, list, skin.EntryDefaultWidth, skin.EntryDefaultHeight);

            e2.AddColumn("This is r2 c1.");
            e2.AddColumn("this is r2 c2.");
            e2.AddColumn("this is r2 c3.");
            SkillSettings.DoTell("Entry 2 Created.");
            list.Add(e1);
            list.Add(e2);
            SkillSettings.DoTell("Entries added to list.");
            list.AddColumn("1st column.");
            list.AddColumn("2nd column.");
            list.AddColumn("3rd column.");
            SkillSettings.DoTell("List columns added.");
            list.columns = 3;
            list.CommitList();
        }
示例#3
0
 public void ApplySkin(BaseSkin skin)
 {
     FlatStyle                  = skin.ButtonFlatStyle;
     ForeColor                  = skin.ButtonForeColor;
     BackColor                  = skin.ButtonBackColor;
     DisabledForeColor          = skin.ButtonDisabledForeColor;
     FlatAppearance.BorderColor = skin.ButtonFlatBorderColor;
 }
示例#4
0
 public void ApplySkin(BaseSkin skin)
 {
     FlatStyle                    = skin.TrackBarFlatStyle;
     FlatThumbBackColor           = skin.TrackBarThumbBackColor;
     FlatThumbDisabledBackColor   = skin.TrackBarThumbDisabledBackColor;
     FlatThumbBorderColor         = skin.TrackBarThumbBorderColor;
     FlatThumbDisabledBorderColor = skin.TrackBarThumbDisabledBorderColor;
     FlatTrackColor               = skin.TrackBarTrackColor;
 }
示例#5
0
 public void ApplySkin(BaseSkin skin)
 {
     UseExplorerStyle    = skin.ListViewUseExplorerStyle;
     BorderStyle         = skin.ListViewBorderStyle;
     BackColor           = skin.ListViewBackColor;
     ForeColor           = skin.ListViewForeColor;
     BorderColor         = skin.ListViewBorderColor;
     BorderFocusedColor  = skin.ListViewBorderFocusedColor;
     BorderDisabledColor = skin.ListViewBorderDisabledColor;
 }
示例#6
0
 public void ApplySkin(BaseSkin skin)
 {
     BorderStyle         = skin.TextBoxBorderStyle;
     BackColor           = skin.TextBoxBackColor;
     ReadOnlyBackColor   = skin.TextBoxReadOnlyBackColor;
     BorderColor         = skin.TextBoxBorderColor;
     BorderFocusedColor  = skin.TextBoxBorderFocusedColor;
     BorderDisabledColor = skin.TextBoxBorderDisabledColor;
     ForeColor           = skin.TextBoxForeColor;
 }
示例#7
0
        public static void LMS_OnCommand(CommandEventArgs e)
        {
            string which = "";

            if (e.Arguments.Length > 0)
            {
                try { which = e.Arguments[0]; }
                catch (Exception ex)
                { Console.WriteLine("Invalid arguments. " + ex); }
            }
            if (which != "")
            {
                try { SkinHelper.LoadSkin(which, typeof(TMSS4Skin), true); }
                catch (Exception ex) { Console.WriteLine("Invalid skin name argument: " + ex); }
            }
            else
            {
                try
                {
                    DirectoryInfo di = new DirectoryInfo("TMSS/Data/Skins");
                    foreach (FileInfo f in di.GetFiles())
                    {
                        if (f.Extension == ".tskn")
                        {
                            string skname = f.Name.Remove(f.Name.IndexOf(".tskn"), 5);
                            try
                            {
                                BaseSkin sk = SkinHelper.skList[skname];
                                try
                                {
                                    TMSS4Skin skfour = (TMSS4Skin)sk;
                                    SkinHelper.LoadSkin(skname, typeof(TMSS4Skin), true);
                                }
                                catch
                                {
                                    SkillSkin skskill = (SkillSkin)sk;
                                    SkinHelper.LoadSkin(skname, typeof(SkillSkin), true);
                                }
                                finally
                                {
                                    DoTell("Attempted reload of skin. Filename: " + f.FullName);
                                }
                            }
                            catch
                            { DoTell("Unable to load skin: " + skname + ". Please use the function provided by the creating class to load it."); }
                        }
                    }
                }
                catch (Exception ex)
                {
                    SystemWrite("Error when reloading a skin. " + ex);
                }
            }
            //LoadSkin(SkillSettings.CCSkinName, true);
        }
示例#8
0
 public void ApplySkin(BaseSkin skin)
 {
     FlatStyle                    = skin.ComboBoxFlatStyle;
     BackColor                    = skin.ComboBoxBackColor;
     ForeColor                    = skin.ComboBoxForeColor;
     FlatButtonBackColor          = skin.ComboBoxButtonBackColor;
     FlatButtonForeColor          = skin.ComboboxButtonForeColor;
     FlatButtonDisabledForeColor  = skin.ComboBoxDisabledForeColor;
     FlatButtonBorderColor        = skin.ComboBoxButtonBorderColor;
     FlatButtonBorderFocusedColor = skin.ComboBoxButtonBorderFocusedColor;
 }
 public void ApplySkin(BaseSkin skin)
 {
     FlatStyle               = skin.ListViewFlatStyle;
     FlatHeaderBackColor     = skin.ListViewHeaderBackColor;
     FlatHeaderForeColor     = skin.ListViewHeaderForeColor;
     BackColor               = skin.ListViewBackColor;
     ForeColor               = skin.ListViewForeColor;
     FlatBorderColor         = skin.ListViewBorderColor;
     FlatBorderFocusedColor  = skin.ListViewBorderFocusedColor;
     FlatBorderDisabledColor = skin.ListViewBorderDisabledColor;
 }
示例#10
0
        public void ApplySkin(BaseSkin skin)
        {
            FlatStyle = skin.TabControlFlatStyle;
            FlatTabSelectedBackColor = skin.TabControlSelectedTabBackColor;
            FlatTabSelectedForeColor = skin.TabControlSelectedTabForeColor;
            FlatTabBorderColor       = skin.TabControlTabBorderColor;

            foreach (Control c in Controls)
            {
                SkinUtils.ApplySkinToControl(skin, c);
            }
        }
        /// <summary>
        ///     Applies the specified skin on the specified control and all of its childs.
        /// </summary>
        internal static void ApplySkinToControl(BaseSkin skin, Control control)
        {
            var skinnableControl = control as ISkinnableControl;

            if (skinnableControl != null)
            {
                skinnableControl.ApplySkin(skin);
                return;
            }

            //Recursive loop that applies the skin to controls inside controls. At this
            //point, the control is not a handled skinnable control so it is likely to be just
            //a container that contains more controls.
            foreach (Control c in control.Controls)
            {
                ApplySkinToControl(skin, c);
            }
        }
示例#12
0
 public void ApplySkin(BaseSkin skin)
 {
     if (Appearance == Appearance.Button)
     {
         FlatStyle                  = skin.ButtonFlatStyle;
         ForeColor                  = skin.ButtonForeColor;
         BackColor                  = skin.ButtonBackColor;
         DisabledForeColor          = skin.ButtonDisabledForeColor;
         FlatAppearance.BorderColor = skin.ButtonFlatBorderColor;
     }
     else
     {
         //We treat checkboxes and radiobutton like labels (their Fore/Back colors
         //are ambiant) so there is no need to apply skin properties manually. The
         //only exceptions are FlatStyle and DisabledForeColor, which are not ambiant
         //and specific to ISkinnableButton in the case of FlatStyle.
         FlatStyle         = skin.ButtonFlatStyle;
         DisabledForeColor = skin.DisabledForeColor;
     }
 }
        private void UpdateSkin()
        {
            BaseSkin skin = SkinHandler.DefaultSkin;

            if (darkSkinToolStripMenuItem.Checked)
            {
                skin = new DarkSkin();
            }

            try
            {
                Config.Instance.LastSkin = skin.GetType().Name;
                Config.Instance.SaveConfig();
            }
            catch
            {
                //ignore
            }

            SkinHandler.SetCurrentSkin(skin);
        }
示例#14
0
 internal ToolStripSystemColorTable(BaseSkin pSkin)
 {
     skin = pSkin;
 }
示例#15
0
 public void UpdateSkinColors(BaseSkin currentBaseSkin)
 {
     _currentBaseSkin     = currentBaseSkin;
     lblUnsaved.ForeColor = _currentBaseSkin.ErrorForeColor;
     UpdatePictureBoxBackColors();
 }
示例#16
0
 public static void SetCurrentSkin(BaseSkin baseSkin)
 {
     _currentBaseSkin          = baseSkin;
     ToolStripManager.Renderer = new ToolStripSystemRendererEx(baseSkin);
     SkinChanged?.Invoke(null, null);
 }
示例#17
0
 public static void SetCurrentSkin(BaseSkin baseSkin)
 {
     _currentBaseSkin = baseSkin;
     SkinChanged?.Invoke(null, null);
 }
 public ToolStripSystemRendererEx(BaseSkin skin)
 {
     colorTable = new ToolStripSystemColorTable(skin);
 }
示例#19
0
 public void ApplySkin(BaseSkin skin)
 {
     BackColor = skin.BackColor;
 }