コード例 #1
0
        void HandleControlStyle(XmlNode xnode)
        {
            string       name = GetStrParam(xnode, "name", "DefaultControl");
            ControlStyle ct   = GetControlStyle(name);

            if (ct == null)
            {
                ct                  = new ControlStyle();
                ct.Name             = name;
                ControlStyles[name] = ct;
                ct.SetDefault();
            }
            UpdateStyle(xnode, ct);
            if (name == "DefaultControl")
            {
                //foreach (KeyValuePair<String, ctlUserPanel> pair in Controls)
                foreach (KeyValuePair <String, Control> pair in Controls)
                {
                    if (pair.Value is ctlUserPanel)
                    {
                        ctlUserPanel ctl = (ctlUserPanel)pair.Value;
                        ctl.ApplyStyle(DefaultControlStyle);
                    }
                    else
                    {
                        // apply the style by recursing through the object
                        ApplyStyleRecurse(pair.Value, DefaultControlStyle);
                    }
                }
            }
        }
コード例 #2
0
 public GuiConfig()
 {
     BgndDecorList = new List <DecorItem>();
     FgndDecorList = new List <DecorItem>();
     //Controls = new Dictionary<string, ctlUserPanel>();
     Controls                 = new Dictionary <string, Control>();
     Buttons                  = new Dictionary <string, ctlImageButton>();
     ControlStyles            = new Dictionary <string, ControlStyle>();
     DecorItems               = new Dictionary <string, DecorItem>();
     Res                      = global::UV_DLP_3D_Printer.Properties.Resources.ResourceManager;
     Plugin                   = null;
     DefaultControlStyle      = new ControlStyle();
     DefaultControlStyle.Name = "DefaultControl";
     DefaultControlStyle.SetDefault();
     ControlStyles[DefaultControlStyle.Name] = DefaultControlStyle;
 }
コード例 #3
0
        void HandleButtonStyle(XmlNode xnode)
        {
            string       name = GetStrParam(xnode, "name", "DefaultButton");
            ControlStyle bt   = GetControlStyle(name);

            if (bt == null)
            {
                bt                  = new ControlStyle();
                bt.Name             = name;
                ControlStyles[name] = bt;
                bt.SetDefault();
            }
            UpdateStyle(xnode, bt);

            if (name == "DefaultButton")
            {
                foreach (KeyValuePair <String, ctlImageButton> pair in Buttons)
                {
                    ctlImageButton butt = pair.Value;
                    butt.ApplyStyle(bt);
                }
            }
        }
コード例 #4
0
 void HandleControlStyle(XmlNode xnode)
 {
     string name = GetStrParam(xnode, "name", "DefaultControl");
     ControlStyle ct = GetControlStyle(name);
     if (ct == null)
     {
         ct = new ControlStyle();
         ct.Name = name;
         ControlStyles[name] = ct;
         ct.SetDefault();
     }
     UpdateStyle(xnode, ct);
     if (name == "DefaultControl")
     {
         //foreach (KeyValuePair<String, ctlUserPanel> pair in Controls)
         foreach (KeyValuePair<String, Control> pair in Controls)
         {
             if (pair.Value is ctlUserPanel)
             {
                 ctlUserPanel ctl = (ctlUserPanel)pair.Value;
                 ctl.ApplyStyle(DefaultControlStyle);
             }
             else 
             {
                 // apply the style by recursing through the object
                 ApplyStyleRecurse(pair.Value, DefaultControlStyle);
             }
         }
     }
 }
コード例 #5
0
        void HandleButtonStyle(XmlNode xnode)
        {
            string name = GetStrParam(xnode, "name", "DefaultButton");
            ControlStyle bt = GetControlStyle(name);
            if (bt == null)
            {
                bt = new ControlStyle();
                bt.Name = name;
                ControlStyles[name] = bt;
                bt.SetDefault();
            }
            UpdateStyle(xnode, bt);

            if (name == "DefaultButton")
            {
                foreach (KeyValuePair<String, ctlImageButton> pair in Buttons)
                {
                    ctlImageButton butt = pair.Value;
                    butt.ApplyStyle(bt);
                }
            }
        }
コード例 #6
0
 public GuiConfig()
 {
     BgndDecorList = new List<DecorItem>();
     FgndDecorList = new List<DecorItem>();
     //Controls = new Dictionary<string, ctlUserPanel>();
     Controls = new Dictionary<string, Control>();
     Buttons = new Dictionary<string, ctlImageButton>();
     ControlStyles = new Dictionary<string, ControlStyle>();
     DecorItems = new Dictionary<string,DecorItem>();
     Res = global::UV_DLP_3D_Printer.Properties.Resources.ResourceManager;
     Plugin = null;
     DefaultControlStyle = new ControlStyle();
     DefaultControlStyle.Name = "DefaultControl";
     DefaultControlStyle.SetDefault();
     ControlStyles[DefaultControlStyle.Name] = DefaultControlStyle;
 }
コード例 #7
0
 void HandleControlStyle(XmlNode xnode)
 {
     string name = GetStrParam(xnode, "name", "DefaultControl");
     ControlStyle ct = GetControlStyle(name);
     if (ct == null)
     {
         ct = new ControlStyle();
         ct.Name = name;
         ControlStyles[name] = ct;
         ct.SetDefault();
     }
     UpdateStyle(xnode, ct);
     if (name == "DefaultControl")
     {
         foreach (KeyValuePair<String, ctlUserPanel> pair in Controls)
         {
             ctlUserPanel ctl = pair.Value;
             ctl.ApplyStyle(DefaultControlStyle);
         }
     }
 }