Пример #1
0
 private void DefaultTile_MouseDown(object sender, MouseEventArgs e)
 {
     try
     {
         choosetile = (SGModernButton)sender;
     }
     catch { }
 }
Пример #2
0
        private void DefaultTile_OnButtonClick(object sender, EventArgs e)
        {
            SGModernButton my = (SGModernButton)sender;
            bool           k  = SGFunction.RunCommand.ShellSGFunction(this, this.sgstyfrm, my.Tag, out this.sgstyfrm);

            if (k == true)
            {
                this.Hide();
            }
        }
Пример #3
0
        public void Allfuntionbutton_click(object sender, EventArgs e)
        {
            SGModernButton s   = (SGModernButton)sender;
            string         cmd = "MA,2,1,1";

            cmd = (string)s.Tag;
            bool k = SGFunction.RunCommand.ShellSGFunction(this, this.sgstyfrm, cmd, out this.sgstyfrm);

            if (k == true)
            {
                this.Hide();
            }
        }
Пример #4
0
 public static void DrawAllClassFunctionsTile(SGForm_Main m)
 {
     //O
     foreach (Control con in m.flowLayoutPanel_allfuction_system.Controls)
     {
         if (con is SGModernButton)
         {
             SGModernButton my = (SGModernButton)con;
             my.ButtonBackColor  = SGFunction.Skins.Skins_GetControlColorSetting("sgtab_allfunctions", "tile_bk");
             my.ButtonForceColor = SGFunction.Skins.Skins_GetControlColorSetting("sgtab_allfunctions", "tile_fr");
         }
     }
     //O
     foreach (Control con in m.flowLayoutPanel_allfunction_adv.Controls)
     {
         if (con is SGModernButton)
         {
             SGModernButton my = (SGModernButton)con;
             my.ButtonBackColor  = SGFunction.Skins.Skins_GetControlColorSetting("sgtab_allfunctions", "tile_bk");
             my.ButtonForceColor = SGFunction.Skins.Skins_GetControlColorSetting("sgtab_allfunctions", "tile_fr");
         }
     }
     //O
     foreach (Control con in m.flowLayoutPanel_allfunction_others.Controls)
     {
         if (con is SGModernButton)
         {
             SGModernButton my = (SGModernButton)con;
             my.ButtonBackColor  = SGFunction.Skins.Skins_GetControlColorSetting("sgtab_allfunctions", "tile_bk");
             my.ButtonForceColor = SGFunction.Skins.Skins_GetControlColorSetting("sgtab_allfunctions", "tile_fr");
         }
     }
     //O
     foreach (Control con in m.flowLayoutPanel_allfunction_style.Controls)
     {
         if (con is SGModernButton)
         {
             SGModernButton my = (SGModernButton)con;
             my.ButtonBackColor  = SGFunction.Skins.Skins_GetControlColorSetting("sgtab_allfunctions", "tile_bk");
             my.ButtonForceColor = SGFunction.Skins.Skins_GetControlColorSetting("sgtab_allfunctions", "tile_fr");
         }
     }
 }
Пример #5
0
            private static bool _ISLOADALLFUNCTION_OTHERS = false; //用于记录OTHERS是否已被加载
            public static void LoadClassFunctions(string type, SGForm_Main m)
            {
                try
                {
                    FlowLayoutPanel flo;
                    string[]        keys, values;
                    string          cfg = SGFunction.SpecialFoldersOrFile.GetSystemGearSpecialFolderOrFile("config") + "\\SGFunctionsClassify.sgcf";
                    Color           backcolor;
                    switch (type.ToUpper())
                    {
                    case "STYLE":
                        if (_ISLOADALLFUNCTION_STYLE == false)
                        {
                            _ISLOADALLFUNCTION_STYLE = true;
                        }
                        else
                        {
                            return;
                        }
                        flo = m.flowLayoutPanel_allfunction_style;
                        SGFunction.ConfigFileOperate.CFGOperate_GetAllKeyValues("belong_style", out keys, out values, cfg, true);
                        backcolor = Color.FromArgb(255, 128, 0);

                        break;

                    case "SYSTEM":
                        if (_ISLOADALLFUNCTION_SYSTEM == false)
                        {
                            _ISLOADALLFUNCTION_SYSTEM = true;
                        }
                        else
                        {
                            return;
                        }
                        flo = m.flowLayoutPanel_allfuction_system;
                        SGFunction.ConfigFileOperate.CFGOperate_GetAllKeyValues("Belong_SystemTool", out keys, out values, cfg, true);
                        backcolor = Color.FromArgb(241, 196, 15);

                        break;

                    case "OTHERS":
                        if (_ISLOADALLFUNCTION_OTHERS == false)
                        {
                            _ISLOADALLFUNCTION_OTHERS = true;
                        }
                        else
                        {
                            return;
                        }
                        flo = m.flowLayoutPanel_allfunction_others;
                        SGFunction.ConfigFileOperate.CFGOperate_GetAllKeyValues("Belong_SGTools", out keys, out values, cfg, true);
                        backcolor = Color.Green;

                        break;

                    default:
                        if (_ISLOADALLFUNCTION_ADV == false)
                        {
                            _ISLOADALLFUNCTION_ADV = true;
                        }
                        else
                        {
                            return;
                        }
                        flo = m.flowLayoutPanel_allfunction_adv;
                        SGFunction.ConfigFileOperate.CFGOperate_GetAllKeyValues("belong_ADV", out keys, out values, cfg, true);
                        backcolor = Color.FromArgb(195, 57, 37);

                        break;
                    }
                    for (int j = 1; j <= keys.Length; j++)
                    {
                        //GET INFO
                        string   readcode = values[j - 1];
                        string[] args = SGFunction.ApplicationSetting.GetSGFunctionInfo(readcode, true, false);
                        string   name = args[0]; string infotip = args[1]; string cmd = args[2]; string logo36 = args[3];
                        //控件
                        SGModernButton my = new SGModernButton();
                        my.ButtonType          = SGModernButton.ButtonStyle.NormalWithoutBackPage;
                        my.ButtonText          = name;
                        my.ButtonBackImage     = SGFunction.Resources.GetImageFromResourcesCode(logo36);
                        my.ButtonTextAlignment = ContentAlignment.MiddleCenter;
                        my.Size           = new Size(100, 75);
                        my.Tag            = cmd;
                        my.OnButtonClick += new EventHandler(m.Allfuntionbutton_click);
                        m.toolTip1.SetToolTip(my, infotip);
                        my.ButtonBackColor  = SGFunction.Skins.Skins_GetControlColorSetting("sgtab_allfunctions", "tile_bk");
                        my.ButtonForceColor = SGFunction.Skins.Skins_GetControlColorSetting("sgtab_allfunctions", "tile_fr");
                        flo.Controls.Add(my);
                    }
                }
                catch { }
            }
Пример #6
0
            /// <summary>
            /// 加载主界面磁铁设置
            /// </summary>
            /// <param name="m">按钮实例</param>
            /// <param name="type">磁铁的样式 [L]大 [K]宽 [Z]中 [X]小</param>
            /// <param name="read">从注册表中读取的文字</param>
            /// <param name="ma">主界面实例</param>
            public static void LoadMainTile(SGModernButton m, string type, string read, SGForm_Main ma)
            {
                try
                {
                    string[] re         = read.Split('|');
                    string   name       = "";
                    string   infotip    = "";
                    string   shellindex = "";
                    string   backcolor  = "0,148,255";
                    string   logo72     = "";
                    string   logo36     = "";
                    string   backimage  = "";
                    //读取
                    switch (type.ToUpper())
                    {
                    case "L":
                        if (re.Length == 7)
                        {
                            name       = re[0];
                            infotip    = re[1];
                            shellindex = re[2];
                            backcolor  = re[3];
                            logo36     = re[5];
                            backimage  = re[6];
                            name       = SGFunction.PathOperate.ConvertStringToTurePath(name, name);
                            infotip    = SGFunction.PathOperate.ConvertStringToTurePath(infotip, infotip);
                            if (name != "")
                            {
                                m.ButtonText = name;
                            }
                            if (infotip != "")
                            {
                                ma.toolTip1.SetToolTip(m, infotip);
                            }
                            if (shellindex != "")
                            {
                                m.Tag = shellindex;
                            }
                            if (backcolor != "")
                            {
                                m.ButtonBackColor = m.ButtonBackPageColor = SGFunction.ColorOperate.GetColorFromStr(backcolor);
                            }
                            if (logo36 != "")
                            {
                                m.ButtonSmallLogo = SGFunction.Resources.GetImageFromResourcesCode(logo36);
                            }
                            m.ButtonType = SGModernButton.ButtonStyle.NormalWithLogo;
                            if (backimage != "")
                            {
                                m.ButtonBackImage = SGFunction.Resources.GetImageFromResourcesCode(backimage); m.BackgroundImageLayout = ImageLayout.Stretch;
                            }
                        }
                        break;

                    case "Z":
                    case "K":
                        if (re.Length == 6)
                        {
                            name       = re[0];
                            infotip    = re[1];
                            shellindex = re[2];
                            backcolor  = re[3];
                            logo72     = re[5];
                            name       = SGFunction.PathOperate.ConvertStringToTurePath(name, name);
                            infotip    = SGFunction.PathOperate.ConvertStringToTurePath(infotip, infotip);
                            if (name != "")
                            {
                                m.ButtonText = name;
                            }
                            if (infotip != "")
                            {
                                ma.toolTip1.SetToolTip(m, infotip);
                            }
                            if (shellindex != "")
                            {
                                m.Tag = shellindex;
                            }
                            if (backcolor != "")
                            {
                                m.ButtonBackColor = SGFunction.ColorOperate.GetColorFromStr(backcolor);
                            }
                            //bMessageBox.Show(m.ButtonBackColor.ToString());
                            //if (backimage != "") { m.ButtonBackImage = SGFunction.Resources.GetImageFromResourcesCode(backimage); m.BackgroundImageLayout = ImageLayout.Stretch; } else { m.ButtonBackImage = SGFunction.Resources.GetImageFromResourcesCode("IconAndLinkMgr_72x72"); m.BackgroundImageLayout = ImageLayout.Center; }
                            if (logo72 != "")
                            {
                                m.ButtonBackImage = SGFunction.Resources.GetImageFromResourcesCode(logo72); m.BackgroundImageLayout = ImageLayout.Center;
                            }
                        }
                        break;

                    case "X":
                        if (re.Length == 6)
                        {
                            name       = re[0];
                            infotip    = re[1];
                            shellindex = re[2];
                            backcolor  = re[3];
                            logo36     = re[5];
                            //name = SGFunction.PathOperate.ConvertStringToTurePath(name, name);
                            infotip = SGFunction.PathOperate.ConvertStringToTurePath(infotip, infotip);
                            //if (name != "") { m.ButtonText = name; }
                            if (infotip != "")
                            {
                                ma.toolTip1.SetToolTip(m, infotip);
                            }
                            if (shellindex != "")
                            {
                                m.Tag = shellindex;
                            }
                            if (backcolor != "")
                            {
                                m.ButtonBackColor = m.ButtonBackPageColor = SGFunction.ColorOperate.GetColorFromStr(backcolor);
                            }
                            //if (logo36 != "") { m.ButtonSmallLogo = SGFunction.Resources.GetImageFromResourcesCode(logo36); }
                            m.ButtonType = SGModernButton.ButtonStyle.NormalWithoutBackPage;
                            if (logo36 != "")
                            {
                                m.ButtonBackImage = SGFunction.Resources.GetImageFromResourcesCode(logo36); m.BackgroundImageLayout = ImageLayout.Center;
                            }
                        }
                        break;
                    }
                }
                catch { }
            }
        public SGUserControl_EditMainTile(string h, string jie, string tiletype, SGModernButton b, SystemGear.窗体.SGForm_Main m)
        {
            InitializeComponent();
            //SKIN
            SGFunction.Skins.DrawAllControlInUserControl(this, SGFunction.Skins.Skins_GetControlColorSetting("DIALOG_STANDARD", "BK"));
            //MyNormalButton2.ForeColor = MyNormalButton3.ForeColor = MyNormalButton4.ForeColor = MyNormalButton5.ForeColor = MyNormalButton6.ForeColor = MyNormalButton1.ForeColor = MyNormalButton11.ForeColor = SGFunction.Skins.Skins_GetControlColorSetting("btn_other", "fr");
            //MyNormalButton2.BackColor = MyNormalButton3.BackColor = MyNormalButton4.BackColor = MyNormalButton5.BackColor = MyNormalButton6.BackColor =MyNormalButton1.BackColor =MyNormalButton11.BackColor =SGFunction.Skins.Skins_GetControlColorSetting("btn_other", "bk");
            // this.BackColor = SGFunction.Skins.Skins_GetControlColorSetting("dialog_standard", "bk");
            // sgLabel2.ForeColor = sgLabel3.ForeColor = sgLabel4.ForeColor = sgLabel4.ForeColor  = sgLabel5.ForeColor = sgLabel6.ForeColor = sgLabel7.ForeColor = sgLabel8.ForeColor = sgLabel9.ForeColor = SGFunction.Skins.Skins_GetControlColorSetting("LAB_MAININFO", "FR");
            // sgLabel1.ForeColor = SGFunction.Skins.Skins_GetControlColorSetting("LABEL_FUNINFO", "FR");
            // MyNormalButton132.BackColor = SGFunction.Skins.Skins_GetControlColorSetting("btn_other1", "bk");
            // sgTextBox_bakcimge.ForeColor = sgTextBox_infotip.ForeColor = sgTextBox_logo36.ForeColor = sgTextBox_logo36_x.ForeColor = sgTextBox_logo72.ForeColor = sgTextBox_name.ForeColor = sgTextBox_shell.ForeColor = SGFunction.Skins.Skins_GetControlColorSetting("TEXTBOX", "FR");
            //COIDE
            this.h        = h;
            this.jie      = jie;
            this.tiletype = tiletype;
            btn           = b;
            main          = m;
            //读取信息
            //定义样式
            string cfg  = SGFunction.SpecialFoldersOrFile.GetSystemGearSpecialFolderOrFile("config") + "\\MainTile.sgcf";
            string read = SGFunction.ConfigFileOperate.SGCFFileOperate_GetValue(h, jie, "", cfg, false);

            /////
            switch (tiletype)
            {
            case "L":
                myModernButton_L.Visible  = true;
                myModernButton_L.Location = new Point(7, 29);
                panel_L.Visible           = true;
                panel_L.Location          = panel_usu.Location;
                panel_usu.Visible         = false;
                LoadMainTile(myModernButton_L, tiletype, read);
                selectbtn = myModernButton_L;
                break;

            case "K":
                myModernButton_K.Visible  = true;
                myModernButton_K.Location = new Point(7, 29);
                panel_usu.Visible         = true;
                panel_L.Visible           = false;
                LoadMainTile(myModernButton_K, tiletype, read);
                selectbtn = myModernButton_K;
                break;

            case "Z":
                myModernButton_Z.Visible  = true;
                myModernButton_Z.Location = new Point(7, 29);
                panel_usu.Visible         = true;
                panel_L.Visible           = false;
                LoadMainTile(myModernButton_Z, tiletype, read);
                selectbtn = myModernButton_Z;
                break;

            case "X":
                myModernButton_X.Visible  = true;
                myModernButton_X.Location = new Point(7, 29);
                panel_usu.Visible         = false; panel_X.Visible = true;
                panel_X.Location          = panel_usu.Location;
                panel_L.Visible           = false;
                LoadMainTile(myModernButton_X, tiletype, read);
                selectbtn = myModernButton_X;
                break;
            }
        }