コード例 #1
0
 public override void ApplyStyle(ControlStyle ct)
 {
     base.ApplyStyle(ct);
     if (ct.ForeColor != ControlStyle.NullColor)
     {
         ctlTitle1.ForeColor = ct.ForeColor;
         label9.ForeColor = ct.ForeColor;
         label10.ForeColor = ct.ForeColor;
         label11.ForeColor = ct.ForeColor;
         textRotateX.ForeColor = ct.ForeColor;
         textRotateY.ForeColor = ct.ForeColor;
         textRotateZ.ForeColor = ct.ForeColor;
     }
     if (ct.BackColor != ControlStyle.NullColor)
     {
         BackColor = ct.BackColor;
         flowLayoutPanel2.BackColor = ct.BackColor;
         textRotateX.BackColor = ct.BackColor;
         textRotateY.BackColor = ct.BackColor;
         textRotateZ.BackColor = ct.BackColor;
     }
     if (ct.FrameColor != ControlStyle.NullColor)
     {
         flowLayoutPanel7.BackColor = ct.FrameColor;
         flowLayoutPanel8.BackColor = ct.FrameColor;
         flowLayoutPanel10.BackColor = ct.FrameColor;
     }
 }
コード例 #2
0
 public override void ApplyStyle(ControlStyle ct)
 {
     base.ApplyStyle(ct);
     if (ct.ForeColor != ControlStyle.NullColor)
     {
         label1.ForeColor = ct.ForeColor;
         label2.ForeColor = ct.ForeColor;
         label3.ForeColor = ct.ForeColor;
         label4.ForeColor = ct.ForeColor;
         label5.ForeColor = ct.ForeColor;
         label6.ForeColor = ct.ForeColor;
         label7.ForeColor = ct.ForeColor;
         label9.ForeColor = ct.ForeColor;
         cmbSupType.ForeColor = ct.ForeColor;
         lbSupports.ForeColor = ct.ForeColor;
         cmdRemoveSupports.ForeColor = ct.ForeColor;
     }
     if (ct.BackColor != ControlStyle.NullColor)
     {
         BackColor = ct.BackColor;
         cmbSupType.BackColor = ct.BackColor;
         flowLayoutPanel2.BackColor = ct.BackColor;
     }
     if (ct.FrameColor != ControlStyle.NullColor)
     {
         flowLayoutPanel1.BackColor = ct.FrameColor;
         panel1.BackColor = ct.FrameColor;
         panel2.BackColor = ct.FrameColor;
         panelSuppotShape.BackColor = ct.FrameColor;
         panel3.BackColor = ct.FrameColor;
         lbSupports.BackColor = ct.FrameColor;
         cmdRemoveSupports.BackColor = ct.BackColor;
     }
 }
コード例 #3
0
 public override void ApplyStyle(ControlStyle ct)
 {
     base.ApplyStyle(ct);
     if (ct.ForeColor != ControlStyle.NullColor)
     {
         label8.ForeColor = ct.ForeColor;
         textMoveX.ForeColor = ct.ForeColor;
         textMoveY.ForeColor = ct.ForeColor;
         textMoveZ.ForeColor = ct.ForeColor;
     }
     if (ct.BackColor != ControlStyle.NullColor)
     {
         BackColor = ct.BackColor;
         flowLayoutPanel2.BackColor = ct.BackColor;
         textMoveX.BackColor = ct.BackColor;
         textMoveY.BackColor = ct.BackColor;
         textMoveZ.BackColor = ct.BackColor;
     }
     if (ct.FrameColor != ControlStyle.NullColor)
     {
         flowLayoutPanel1.BackColor = ct.FrameColor;
         flowLayoutPanel7.BackColor = ct.FrameColor;
         flowLayoutPanel8.BackColor = ct.FrameColor;
         flowLayoutPanel10.BackColor = ct.FrameColor;
     }
 }
コード例 #4
0
        public override void ApplyStyle(ControlStyle ct)
#endif
        {
            base.ApplyStyle(ct);
            flowTop.BackColor = ct.BackColor;
            flowData1.BackColor = ct.BackColor;
        }
コード例 #5
0
        public override void ApplyStyle(ControlStyle ct)
        {
            base.ApplyStyle(ct);
            if (ct.ForeColor != ControlStyle.NullColor)
            {
                ctlTitle1.ForeColor = ct.ForeColor;
                treeScene.ForeColor = ct.ForeColor;
                treeScene.LineColor = ct.ForeColor;
                cmdCopy.ForeColor = ct.ForeColor;
                cmdDelete.ForeColor = ct.ForeColor;
            }
            if (ct.BackColor != ControlStyle.NullColor)
            {
                BackColor = ct.BackColor;
                manipObject.BackColor = ct.BackColor;
                cmdCopy.BackColor = ct.BackColor;
                cmdDelete.BackColor = ct.BackColor;

            }
            if (ct.FrameColor != ControlStyle.NullColor)
            {
                treeScene.BackColor = ct.FrameColor;
                flowLayoutPanel1.BackColor = ct.FrameColor;
            }
        }
コード例 #6
0
 public override void ApplyStyle(ControlStyle ct)
 {
     base.ApplyStyle(ct);
     if (ct.ForeColor != ControlStyle.NullColor)
     {
         labelManipType.ForeColor = ct.ForeColor;
         textScaleX.ForeColor = ct.ForeColor;
         textScaleY.ForeColor = ct.ForeColor;
         textScaleZ.ForeColor = ct.ForeColor;
         textScaleAll.ForeColor = ct.ForeColor;
     }
     if (ct.BackColor != ControlStyle.NullColor)
     {
         BackColor = ct.BackColor;
         manipObject.BackColor = ct.BackColor;
         textScaleX.BackColor = ct.BackColor;
         textScaleY.BackColor = ct.BackColor;
         textScaleZ.BackColor = ct.BackColor;
         textScaleAll.BackColor = ct.BackColor;
     }
     if (ct.FrameColor != ControlStyle.NullColor)
     {
         flowLayoutPanel1.BackColor = ct.FrameColor;
         flowLayoutPanel4.BackColor = ct.FrameColor;
         flowLayoutPanel3.BackColor = ct.FrameColor;
         flowLayoutPanel5.BackColor = ct.FrameColor;
     }
 }
コード例 #7
0
 public override void ApplyStyle(ControlStyle ct)
 {
     base.ApplyStyle(ct);
     if (ct.ForeColor != ControlStyle.NullColor)
         ForeColor = ct.ForeColor;
     if (ct.BackColor != ControlStyle.NullColor)
         BackColor = ct.BackColor;
 }
コード例 #8
0
 public override void ApplyStyle(ControlStyle ct)
 {
     //base.ApplyStyle(ct);
     cmdCreate.ApplyStyle(ct);
     cmdRemove.ApplyStyle(ct);
     this.BackColor = Control.DefaultBackColor;
     this.ForeColor = Control.DefaultForeColor;
     if (ct.ForeColor != ControlStyle.NullColor)
     {
     }
 }
コード例 #9
0
 public override void ApplyStyle(ControlStyle ct)
 {
     base.ApplyStyle(ct);
     if (ct.BackColor != null)
     {
         flowLayoutPanel2.BackColor = ct.BackColor;
     }
     if (ct.ForeColor != null)
     {
         flowLayoutPanel2.ForeColor = ct.ForeColor;
     }
 }
コード例 #10
0
 public override void ApplyStyle(ControlStyle ct)
 {
     base.ApplyStyle(ct);
     //Button.ApplyStyle(ct);
     if (ct.ForeColor != ControlStyle.NullColor)
     {
         ForeColor = ct.ForeColor;
         lblTitle.ForeColor = ct.ForeColor;
     }
     if (ct.BackColor != ControlStyle.NullColor)
     {
         BackColor = ct.BackColor;
         lblTitle.BackColor = ct.BackColor;
     }
 }
コード例 #11
0
 public override void ApplyStyle(ControlStyle ct)
 {
     base.ApplyStyle(ct);
     if (ct.BackColor != ControlStyle.NullColor)
     {
         BackColor = ct.BackColor;
         flowLayoutPanel2.BackColor = ct.BackColor;
     }
     if (ct.FrameColor != ControlStyle.NullColor)
     {
         flowLayoutPanel1.BackColor = ct.FrameColor;
         flowLayoutPanel3.BackColor = ct.FrameColor;
         //  flowLayoutPanel4.BackColor = ct.FrameColor;
         //  flowLayoutPanel5.BackColor = ct.FrameColor;
     }
 }
コード例 #12
0
 public override void ApplyStyle(ControlStyle ct)
 {
     base.ApplyStyle(ct);
     if (ct.ForeColor != ControlStyle.NullColor)
     {
         tTitle.ForeColor = ct.ForeColor;
         tName.ForeColor = ct.ForeColor;
     }
     if (ct.BackColor != ControlStyle.NullColor)
     {
         BackColor = ct.BackColor;
         layoutPanel.BackColor = ct.BackColor;
         tTitle.BackColor = ct.BackColor;
         tName.BackColor = ct.BackColor;
     }
 }
コード例 #13
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;
 }
コード例 #14
0
 public override void ApplyStyle(ControlStyle ct)
 {
     base.ApplyStyle(ct);
     if (ct.BackColor != ControlStyle.NullColor)
     {
         BackColor = ct.BackColor;
         flowLayoutPanel2.BackColor = ct.BackColor;
     }
     if (ct.FrameColor != ControlStyle.NullColor)
     {
         flowLayoutPanel1.BackColor = ct.FrameColor;
         flowLayoutPanel3.BackColor = ct.FrameColor;
       //  flowLayoutPanel4.BackColor = ct.FrameColor;
       //  flowLayoutPanel5.BackColor = ct.FrameColor;
     }
 }
コード例 #15
0
 public override void ApplyStyle(ControlStyle ct)
 {
     base.ApplyStyle(ct);
     if (ct.ForeColor != ControlStyle.NullColor)
     {
         lblTitle.ForeColor = ct.ForeColor;
     }
     if (ct.BackColor != ControlStyle.NullColor)
     {
         BackColor = ct.BackColor;
     }
     if (ct.FrameColor != ControlStyle.NullColor)
     {
         flowLayoutPanel5.BackColor = ct.FrameColor;
     }
 }
コード例 #16
0
 public override void ApplyStyle(ControlStyle ct)
 {
     base.ApplyStyle(ct);
     if (ct.ForeColor != ControlStyle.NullColor)
     {
         ctlTitle1.ForeColor = ct.ForeColor;
         tName.ForeColor     = ct.ForeColor;
     }
     if (ct.BackColor != ControlStyle.NullColor)
     {
         BackColor             = ct.BackColor;
         layoutPanel.BackColor = ct.BackColor;
         ctlTitle1.BackColor   = ct.BackColor;
         tName.BackColor       = ct.BackColor;
     }
 }
コード例 #17
0
        public override void ApplyStyle(ControlStyle ct)
        {
            base.ApplyStyle(ct);
            if (ct.ForeColor != ControlStyle.NullColor)
            {
                lblTitle.ForeColor = ct.ForeColor;
            }
            if (ct.BackColor != ControlStyle.NullColor)
            {
                BackColor = ct.BackColor;
            }
            if (ct.FrameColor != ControlStyle.NullColor)
            {
                flowLayoutPanel5.BackColor = ct.FrameColor;
            }

        }
コード例 #18
0
 public override void ApplyStyle(ControlStyle ct)
 {
     base.ApplyStyle(ct);
     if (ct.BackColor != null)
     {
         flowLayoutPanel1.BackColor = ct.BackColor;
     }
     if (ct.ForeColor != null)
     {
         flowLayoutPanel1.ForeColor = ct.ForeColor;
     }
     //this.BackColor = Control.DefaultBackColor;
     //this.ForeColor = Control.DefaultForeColor;
     ctlMachineConfigView.ApplyStyle(ct);
     ctlSliceProfileConfig.ApplyStyle(ct);
     pnlMachineConfig.BackColor = Control.DefaultBackColor;
     pnlMachineConfig.ForeColor = Control.DefaultForeColor;
 }
コード例 #19
0
 public override void ApplyStyle(ControlStyle ct)
 {
     base.ApplyStyle(ct);
     if (ct.BackColor != ControlStyle.NullColor)
     {
         BackColor            = ct.BackColor;
         labelTitle.BackColor = ct.BackColor;
     }
     if (ct.FrameColor != ControlStyle.NullColor)
     {
         labelData.BackColor = ct.FrameColor;
     }
     if (ct.ForeColor != ControlStyle.NullColor)
     {
         labelData.ForeColor  = ct.ForeColor;
         labelTitle.ForeColor = ct.ForeColor;
     }
 }
コード例 #20
0
 public override void ApplyStyle(ControlStyle ct)
 {
     base.ApplyStyle(ct);
     if (ct.ForeColor != ControlStyle.NullColor)
     {
         lblTitle.ForeColor = ct.ForeColor;
         treeScene.ForeColor = ct.ForeColor;
         treeScene.LineColor = ct.ForeColor;
     }
     if (ct.BackColor != ControlStyle.NullColor)
     {
         BackColor = ct.BackColor;
         manipObject.BackColor = ct.BackColor;
     }
     if (ct.FrameColor != ControlStyle.NullColor)
     {
         treeScene.BackColor = ct.FrameColor;
     }
 }
コード例 #21
0
        void UpdateStyle(XmlNode xnode, ControlStyle ct)
        {
            ControlStyle copyFromStyle = GetControlStyle(GetStrParam(xnode, "copyfrom", null));

            if (copyFromStyle != null)
            {
                ct.CopyFrom(copyFromStyle);
            }
            ct.ForeColor            = GetColorParam(xnode, "forecolor", ct.ForeColor);
            ct.BackColor            = GetColorParam(xnode, "backcolor", ct.BackColor);
            ct.FrameColor           = GetColorParam(xnode, "framecolor", ct.BackColor);
            ct.glMode               = GetBoolParam(xnode, "gl", ct.glMode);
            ct.CheckedColor         = GetColorParam(xnode, "checkcolor", ct.CheckedColor);
            ct.HoverColor           = GetColorParam(xnode, "hovercolor", ct.HoverColor);
            ct.PressedColor         = GetColorParam(xnode, "presscolor", ct.PressedColor);
            ct.SubImgCount          = GetIntParam(xnode, "nimages", ct.SubImgCount);
            ct.BackImage            = GetStrParam(xnode, "backimage", ct.BackImage);
            ct.CheckedImage         = GetStrParam(xnode, "checkimage", ct.CheckedImage);
            ct.DisabledColor        = GetColorParam(xnode, "disablecolor", ct.DisabledColor);
            ct.HoverSize            = GetIntParam(xnode, "hoverscale", (int)ct.HoverSize);
            ct.PressedSize          = GetIntParam(xnode, "pressscale", (int)ct.PressedSize);
            ct.BgndImageName        = GetStrParam(xnode, "bgndimage", ct.BgndImageName);
            ct.applySubControls     = GetBoolParam(xnode, "applysubcontrols", ct.applySubControls);
            ct.applyWindowsControls = GetBoolParam(xnode, "applywincontrols", ct.applyWindowsControls);
            int[] sizes = GetIntArrayParam(xnode, "panelpad");
            if (sizes.Length >= 4)
            {
                ct.PanelPad.Left   = sizes[0];
                ct.PanelPad.Right  = sizes[1];
                ct.PanelPad.Top    = sizes[2];
                ct.PanelPad.Bottom = sizes[3];
            }
            else if (sizes.Length >= 1)
            {
                ct.PanelPad.Left   = sizes[0];
                ct.PanelPad.Right  = sizes[0];
                ct.PanelPad.Top    = sizes[0];
                ct.PanelPad.Bottom = sizes[0];
            }
        }
コード例 #22
0
        public void ApplyStyleRecurse(Control ctl, ControlStyle ct)
        {
            if (ct.BackColor != ControlStyle.NullColor)
            {
                ctl.BackColor = ct.BackColor;
            }

            if (ct.BackColor != ControlStyle.NullColor)
            {
                ctl.BackColor = ct.BackColor;
            }

            if (!ct.applySubControls)
            {
                return;
            }

            foreach (Control subctl in ctl.Controls)
            {
                if (subctl is ctlUserPanel)
                {
                    ((ctlUserPanel)subctl).ApplyStyle(ct);
                }
                else
                {
                    if (ct.BackColor != ControlStyle.NullColor)
                    {
                        ctl.BackColor = ct.BackColor;
                    }

                    if (ct.BackColor != ControlStyle.NullColor)
                    {
                        ctl.BackColor = ct.BackColor;
                    }

                    ApplyStyleRecurse(subctl, ct);
                }
            }
        }
コード例 #23
0
 public override void ApplyStyle(ControlStyle ct)
 {
     base.ApplyStyle(ct);
     if (ct.ForeColor != ControlStyle.NullColor)
     {
         ctlTitle1.ForeColor         = ct.ForeColor;
         label1.ForeColor            = ct.ForeColor;
         label2.ForeColor            = ct.ForeColor;
         label3.ForeColor            = ct.ForeColor;
         label4.ForeColor            = ct.ForeColor;
         labelAutoSup.ForeColor      = ct.ForeColor;
         label6.ForeColor            = ct.ForeColor;
         label7.ForeColor            = ct.ForeColor;
         label9.ForeColor            = ct.ForeColor;
         cmbSupType.ForeColor        = ct.ForeColor;
         lbSupports.ForeColor        = ct.ForeColor;
         cmdRemoveSupports.ForeColor = ct.ForeColor;
         progressTitle.ForeColor     = ct.ForeColor;
     }
     if (ct.BackColor != ControlStyle.NullColor)
     {
         ctlTitle1.BackColor  = ct.BackColor;
         BackColor            = ct.BackColor;
         cmbSupType.BackColor = ct.BackColor;
         //flowLayoutPanel2.BackColor = ct.BackColor;
         progressTitle.BackColor = ct.BackColor;
     }
     if (ct.FrameColor != ControlStyle.NullColor)
     {
         flowLayoutPanel1.BackColor  = ct.FrameColor;
         panel1.BackColor            = ct.FrameColor;
         panel2.BackColor            = ct.FrameColor;
         panelSuppotShape.BackColor  = ct.FrameColor;
         panel3.BackColor            = ct.FrameColor;
         lbSupports.BackColor        = ct.FrameColor;
         cmdRemoveSupports.BackColor = ct.BackColor;
     }
 }
コード例 #24
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);
                }
            }
        }
コード例 #25
0
 public override void ApplyStyle(ControlStyle ct)
 {
     base.ApplyStyle(ct);
     if (ct.ForeColor != ControlStyle.NullColor)
     {
         ctlTitle1.ForeColor = ct.ForeColor;
         treeScene.ForeColor = ct.ForeColor;
         treeScene.LineColor = ct.ForeColor;
         cmdCopy.ForeColor   = ct.ForeColor;
         cmdDelete.ForeColor = ct.ForeColor;
     }
     if (ct.BackColor != ControlStyle.NullColor)
     {
         BackColor             = ct.BackColor;
         manipObject.BackColor = ct.BackColor;
         cmdCopy.BackColor     = ct.BackColor;
         cmdDelete.BackColor   = ct.BackColor;
     }
     if (ct.FrameColor != ControlStyle.NullColor)
     {
         treeScene.BackColor        = ct.FrameColor;
         flowLayoutPanel1.BackColor = ct.FrameColor;
     }
 }
コード例 #26
0
        public override void ApplyStyle(ControlStyle ct)
#endif
        {
            base.ApplyStyle(ct);
            ForeColor = ct.ForeColor;
            FrameColor = ct.FrameColor;
            textSetTemp.BackColor = ct.FrameColor;
            textSetTemp.ForeColor = ct.ForeColor;
        }
コード例 #27
0
 /// <summary>
 /// Need to implement this at mainform level too
 /// </summary>
 /// <param name="ct"></param>
 public void ApplyStyle(ControlStyle ct)
 {
     /*
     if(ct.BackColor !=null)
     {
         pnlTopIcons.BackColor = ct.BackColor;
         pnlTopTabs.BackColor = ct.BackColor;
     }
     */
     /*
     mStyle = ct;
     mStyleName = ct.Name;
     ApplyStyleRecurse(this, ct);
     if (ct.BackColor != ControlStyle.NullColor)
         bgndPanel.col = ct.BackColor;
     if (ct.BgndImageName != null)
         bgndPanel.imageName = ct.BgndImageName;
      * */
 }
コード例 #28
0
 public override void ApplyStyle(ControlStyle ct)
 {
     base.ApplyStyle(ct);
     ForeColor  = ct.ForeColor;
     FrameColor = ct.FrameColor;
 }
コード例 #29
0
 void UpdateStyle(XmlNode xnode, ControlStyle ct)
 {
     ControlStyle copyFromStyle = GetControlStyle(GetStrParam(xnode, "copyfrom", null));
     if (copyFromStyle != null)
         ct.CopyFrom(copyFromStyle);
     ct.ForeColor = GetColorParam(xnode, "forecolor", ct.ForeColor);
     ct.BackColor = GetColorParam(xnode, "backcolor", ct.BackColor);
     ct.FrameColor = GetColorParam(xnode, "framecolor", ct.BackColor);
     ct.glMode = GetBoolParam(xnode, "gl", ct.glMode);
     ct.CheckedColor = GetColorParam(xnode, "checkcolor", ct.CheckedColor);
     ct.HoverColor = GetColorParam(xnode, "hovercolor", ct.HoverColor);
     ct.PressedColor = GetColorParam(xnode, "presscolor", ct.PressedColor);
     ct.SubImgCount = GetIntParam(xnode, "nimages", ct.SubImgCount);
     ct.BackImage = GetStrParam(xnode, "backimage", ct.BackImage);
     ct.CheckedImage = GetStrParam(xnode, "checkimage", ct.CheckedImage);
     ct.DisabledColor = GetColorParam(xnode, "disablecolor", ct.DisabledColor);
     ct.HoverSize = GetIntParam(xnode, "hoverscale", (int)ct.HoverSize);
     ct.PressedSize = GetIntParam(xnode, "pressscale", (int)ct.PressedSize);
     ct.BgndImageName = GetStrParam(xnode, "bgndimage", ct.BgndImageName);
     ct.applySubControls = GetBoolParam(xnode, "applysubcontrols", ct.applySubControls);
     ct.applyWindowsControls = GetBoolParam(xnode, "applywincontrols", ct.applyWindowsControls);
     int[] sizes = GetIntArrayParam(xnode, "panelpad");
     if (sizes.Length >= 4)
     {
         ct.PanelPad.Left = sizes[0];
         ct.PanelPad.Right = sizes[1];
         ct.PanelPad.Top = sizes[2];
         ct.PanelPad.Bottom = sizes[3];
     }
     else if (sizes.Length >= 1)
     {
         ct.PanelPad.Left = sizes[0];
         ct.PanelPad.Right = sizes[0];
         ct.PanelPad.Top = sizes[0];
         ct.PanelPad.Bottom = sizes[0];
     }
 }
コード例 #30
0
        public void ApplyStyleRecurse(Control ctl, ControlStyle ct)
        {

            if ((ctl is ctlUserPanel) || ct.applyWindowsControls)
            {
                if (ct.BackColor != ControlStyle.NullColor)
                    ctl.BackColor = ct.BackColor;

                if (ct.ForeColor != ControlStyle.NullColor)
                    ctl.ForeColor = ct.ForeColor;
            }
            if (!ct.applySubControls)
                return;

            foreach (Control subctl in ctl.Controls)
            {
                if (subctl is ctlUserPanel)
                {
                    ((ctlUserPanel)subctl).ApplyStyle(ct);
                }
                else
                {
                    ApplyStyleRecurse(subctl, ct);
                }
            }
        }
コード例 #31
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);
             }
         }
     }
 }
コード例 #32
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);
         }
     }
 }
コード例 #33
0
 void UpdateStyle(XmlNode xnode, ControlStyle ct)
 {
     ct.ForeColor = GetColorParam(xnode, "forecolor", ct.ForeColor);
     ct.BackColor = GetColorParam(xnode, "backcolor", ct.BackColor);
     ct.FrameColor = GetColorParam(xnode, "framecolor", ct.BackColor);
     ct.glMode = GetBoolParam(xnode, "gl", ct.glMode);
 }
コード例 #34
0
        void HandleButton(XmlNode buttnode)
        {
            string name = GetStrParam(buttnode, "name", null);

            if (name == null)
            {
                return;
            }
            if (!Buttons.ContainsKey(name))
            {
                // create a new empty button
                AddButton(name, new ctlImageButton());
                Buttons[name].BringToFront();
            }
            ctlImageButton butt = Buttons[name];

//            butt.Visible = true;
            butt.Visible         = GetBoolParam(buttnode, "visible", true);
            butt.GuiAnchor       = FixDockingVal(GetStrParam(buttnode, "dock", butt.GuiAnchor));
            butt.Gapx            = GetIntParam(buttnode, "x", butt.Gapx);
            butt.Gapy            = GetIntParam(buttnode, "y", butt.Gapy);
            butt.Width           = GetIntParam(buttnode, "w", butt.Width);
            butt.Height          = GetIntParam(buttnode, "h", butt.Height);
            butt.StyleName       = GetStrParam(buttnode, "style", butt.StyleName);
            butt.OnClickCallback = GetStrParam(buttnode, "click", butt.OnClickCallback);
            ControlStyle bstl = GetControlStyle(butt.StyleName);

            if (bstl != null)
            {
                butt.GLVisible = bstl.glMode;
            }
            //butt.GLVisible = GetBoolParam(buttnode, "gl", butt.GLVisible);
            string imgname = GetStrParam(buttnode, "image", null);

            if (imgname != null)
            {
                butt.GLImage = imgname;
                butt.Image   = GetImageParam(buttnode, "image", null);
            }
            butt.CheckImage = GetImageParam(buttnode, "check", butt.CheckImage);


            // add the ability to add buttons in various named parents
            // this will allow adding buttons to toolbar from plugins
            string action = GetStrParam(buttnode, "action", "none"); // telling something to happen to this control

            if (action.Contains("remove"))                           // this handles removing a control from it's parent
            {
                // remove this control from it's parent
                if (butt.Parent != null)
                {
                    butt.Parent.Controls.Remove(butt);
                    butt.Parent = null;
                }
            }
            else if (action.Contains("addto")) // this handles adding a new control to a parent control
            {
                // Get the name of the parent
                string parentname = GetStrParam(buttnode, "parent", "");
                if (parentname == null)
                {
                    return;
                }
                if (parentname.Length == 0)
                {
                    return;
                }
                //find the parent
                Control ctlParent = Controls[parentname];
                if (ctlParent == null)
                {
                    DebugLogger.Instance().LogWarning("Button parent now found: " + parentname);
                    return;
                }
                {
                    ctlParent.Controls.Add(butt);
                }
            }
        }
コード例 #35
0
        Color GetPaintColor(ControlStyle stl)
#endif
        {
            if (Enabled == false)
                return stl.DisabledColor;
            Color col = stl.ForeColor;
            switch (mCtlState)
            {
                case CtlState.Hover:
                    /*if (Checked)
                        col = stl.CheckedColor;
                    else*/
                        col = stl.HoverColor;
                    break;

                case CtlState.Normal:
                    if (Checked)
                        col = stl.CheckedColor;
                    break;

                case CtlState.Pressed:
                    col = stl.PressedColor;
                    break;
            }
            return col;
        }
コード例 #36
0
        void GLPaint1(C2DGraphics gr, ControlStyle stl)
#endif
        {
            gr.SetColor(GetPaintColor(stl));

            float scale = 1;
            if (mCtlState == CtlState.Hover)
                scale = stl.HoverSize / 100;
            if (mCtlState == CtlState.Pressed)
                scale = stl.PressedSize / 100;


            if ((scale < 0.999f) || (scale > 1.001f))
            {
                float w = (float)Width * scale;
                float h = (float)Height * scale;
                float scx = ((float)Width - w) / 2f;
                float scy = ((float)Height - h) / 2f;
                gr.Image(mGLImageCach, 0, 0, mGLImageCach.w, mGLImageCach.h, scx, scy, w, h);
            }
            else
            {
                gr.Image(mGLImageCach, 0, 0, mGLImageCach.w, mGLImageCach.h, 0, 0, Width, Height);
            }
        }
コード例 #37
0
 public override void ApplyStyle(ControlStyle ct)
 {
     base.ApplyStyle(ct);
     if (ct.BackColor != ControlStyle.NullColor)
     {
         BackColor = ct.BackColor;
         labelTitle.BackColor = ct.BackColor;
     }
     if (ct.FrameColor != ControlStyle.NullColor)
         labelData.BackColor = ct.FrameColor;
     if (ct.ForeColor != ControlStyle.NullColor)
     {
         labelData.ForeColor = ct.ForeColor;
         labelTitle.ForeColor = ct.ForeColor;
     }
 }
コード例 #38
0
        void HandleControl(XmlNode ctlnode)
        {
            string name = GetStrParam(ctlnode, "name", null);

            if (name == null)
            {
                return;
            }
            if (!Controls.ContainsKey(name))
            {
                return;
            }

            //ctlUserPanel ctl = Controls[name];
            Control ct = Controls[name];

            if (ctlnode.Attributes.GetNamedItem("visible") != null)
            {
                ct.Visible = GetBoolParam(ctlnode, "visible", ct.Visible);
            }
            ct.Width  = GetIntParam(ctlnode, "w", ct.Width);
            ct.Height = GetIntParam(ctlnode, "h", ct.Height);
            //load some control locations as well,
            int px, py;

            px = GetIntParam(ctlnode, "px", ct.Location.X);
            py = GetIntParam(ctlnode, "py", ct.Location.Y);
            Point pt = new Point(px, py);

            ct.Location = pt;
            // load docking style


            string action = GetStrParam(ctlnode, "action", "none"); // telling something to happen to this control

            if (action.Contains("remove"))                          // this handles removing a control from it's parent
            {
                // remove this control from it's parent
                if (ct.Parent != null)
                {
                    ct.Parent.Controls.Remove(ct);
                    ct.Parent = null;
                }
            }
            else if (action.Contains("hide")) // this handles hiding
            {
                // hide this control
                ct.Hide();
            }
            else if (action.Contains("addto")) // this handles adding a new control to a parent control
            {
                // Get the name of the parent
                string parentname = GetStrParam(ctlnode, "parent", "");
                if (parentname == null)
                {
                    return;
                }
                if (parentname.Length == 0)
                {
                    return;
                }
                //find the parent
                Control ctlParent = Controls[parentname];
                if (ctlParent == null)
                {
                    DebugLogger.Instance().LogWarning("Control parent now found: " + parentname);
                    return;
                }
                {
                    ctlParent.Controls.Add(ct);
                }
            }
            String       styleName = GetStrParam(ctlnode, "style", null);
            ControlStyle style     = GetControlStyle(styleName);

            if (ct is ctlUserPanel)
            {
                ctlUserPanel ctl = (ctlUserPanel)ct;
                ctl.GuiAnchor = FixDockingVal(GetStrParam(ctlnode, "dock", ctl.GuiAnchor));
                ctl.Gapx      = GetIntParam(ctlnode, "x", ctl.Gapx);
                ctl.Gapy      = GetIntParam(ctlnode, "y", ctl.Gapy);
                if (styleName != null)
                {
                    ctl.StyleName = styleName;
                    if (style != null)
                    {
                        ctl.GLVisible = style.glMode;
                        ctl.ApplyStyle(style);
                    }
                }
                //ctl.GLVisible = GetBoolParam(ctlnode, "gl", false);
                if (ctl.GLVisible)
                {
                    ctl.GLBackgroundImage = GetStrParam(ctlnode, "shape", ctl.GLBackgroundImage);
                }
                else
                {
                    ctl.bgndPanel.imageName = GetStrParam(ctlnode, "shape", ctl.bgndPanel.imageName);
                }
            }
            else
            {
                if (style != null)
                {
                    ApplyStyleRecurse(ct, style);
                }
            }
        }
コード例 #39
0
        public void CopyFrom(ControlStyle sctl)
        {
            if (sctl == null)
                return;
            ForeColor = sctl.ForeColor;
            BackColor = sctl.BackColor;
            FrameColor = sctl.FrameColor;
            BackImage = sctl.BackImage;
            glMode = sctl.glMode;

            SubImgCount = sctl.SubImgCount;
            PressedColor = sctl.PressedColor;
            CheckedColor = sctl.CheckedColor;
            DisabledColor = sctl.DisabledColor;
            HoverColor = sctl.HoverColor;
            PressedSize = sctl.PressedSize;
            HoverSize = sctl.HoverSize;
            BgndImageName = sctl.BgndImageName;
            PanelPad = new ControlPad();
            PanelPad.Left = sctl.PanelPad.Left;
            PanelPad.Right = sctl.PanelPad.Right; 
            PanelPad.Top = sctl.PanelPad.Top;
            PanelPad.Bottom = sctl.PanelPad.Bottom;
            applySubControls = sctl.applySubControls;
            applyWindowsControls = sctl.applyWindowsControls;
            CheckedImage = sctl.CheckedImage;
        }
コード例 #40
0
 public override void ApplyStyle(ControlStyle ct)
 {
     base.ApplyStyle(ct);
     ForeColor = ct.ForeColor;
     FrameColor = ct.FrameColor;
 }
コード例 #41
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;
 }
コード例 #42
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);
                }
            }
        }
コード例 #43
0
 public override void ApplyStyle(ControlStyle ct)
 {
     base.ApplyStyle(ct);
     textData.ValidColor = Style.ForeColor;
     textData.BackColor = Style.BackColor;
     /*if (ct.FrameColor != ControlStyle.NullColor)
         BackColor = ct.FrameColor;
     if (ct.ForeColor != ControlStyle.NullColor)
         textData.ForeColor = ct.ForeColor;
     if (ct.BackColor != ControlStyle.NullColor)
         textData.BackColor = ct.BackColor;*/
 }