Example #1
0
 public void setButtonColor(TTButton bt)
 {
     bt.FlatStyle = FlatStyle.Flat;                                               //样式
     bt.FlatAppearance.BorderSize         = 0;                                    //去边线
     bt.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromName("red"); //鼠标经过
     bt.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent;     //鼠标按下
     bt.ForeColor = Color.Transparent;                                            //前景
     bt.BackColor = Color.Transparent;                                            //去背景
     bt.ForeColor = Color.FromName("purple");
     bt.Font      = new Font("行书", 10.2f);
 }
Example #2
0
        public void MainInit()
        {
            ClearBuntton();
            List <ButtonDate> allbtn = new List <ButtonDate>();
            List <ButtonDate> hfbtn  = new List <ButtonDate>();
            List <ButtonDate> list   = PubulicData.sourceData[PubulicData.ClassName.ButtonDate.ToString()] as List <ButtonDate>;

            allbtn = list.Where(c => c.State == "show").OrderBy(c => c.Index).ToList();
            hfbtn  = list.Where(c => c.State == "hiden").ToList();
            int i = 0;
            int j = 0;
            int z = 0;

            foreach (ButtonDate item in allbtn)
            {
                TTButton modle = new TTButton();
                modle.Size     = new System.Drawing.Size(120, 30);
                modle.TabIndex = (int)item.Index + 1;
                modle.UseVisualStyleBackColor = true;
                modle.Text       = item.Name;
                modle.MouseDown += _formHelper.ClikeButton;
                if (item.Type == "网站")
                {
                    modle.Name     = "wbe" + item.ID;
                    modle.Location = new System.Drawing.Point(21, 20 + i * 40);
                    PubulicData.GCFN("panWeb").Controls.Add(modle);
                    i++;
                }
                else
                {
                    if (item.CreateMac == LoacationHelper.GetMac())
                    {
                        modle.Name     = "app" + item.ID;
                        modle.Location = new System.Drawing.Point(21, 20 + j * 40);
                        PubulicData.GCFN("panApp").Controls.Add(modle);
                        j++;
                    }
                }
            }
            foreach (ButtonDate item in hfbtn)
            {
                TTButton modle = new TTButton();
                modle.Name     = "hf" + item.ID;
                modle.Location = new System.Drawing.Point(21, 20 + z * 40);
                modle.Size     = new System.Drawing.Size(120, 30);
                modle.TabIndex = (int)item.Index + 1;
                modle.UseVisualStyleBackColor = true;
                modle.Text       = item.Name;
                modle.MouseDown += _formHelper.hfClike;
                PubulicData.GCFN("panHF").Controls.Add(modle);
                z++;
            }
        }
Example #3
0
        public void hfClike(object sender, EventArgs e)
        {
            TTButton btnow = sender as TTButton;

            if (btnow != null)
            {
                string name = btnow.Name;
                int    id   = 0;
                string sid  = name.Substring(2, name.Length - 2);
                if (Int32.TryParse(sid, out id))
                {
                    ActionHelper.ModifyButton(id, "show");
                    SX();
                }
            }
        }
Example #4
0
 /// <summary>
 /// 添加按钮
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public void CreateButton(TTButton nowbt)
 {
     if (nowbt != null)
     {
         string     name    = nowbt.Name;
         string     btnname = "";
         string     btnllq  = "";
         string     btnurl  = "";
         ButtonDate bd      = new ButtonDate();
         bd.ID = id;
         if (name == "btnWebCreate")
         {
             string url = PubulicData.GCFN("weburl").Text;
             url           = url.Trim('"');
             btnname       = PubulicData.GCFN("webbtn").Text;
             btnllq        = PubulicData.GCFN("webllq").Text;
             btnurl        = url;
             bd.Name       = btnname;
             bd.Url        = btnurl;
             bd.Browser    = btnllq;
             bd.Type       = "网站";
             bd.State      = "show";
             bd.CreateDate = DateTime.Now;
             bd.CreateIP   = LoacationHelper.GetLocalIP();
             bd.CreateMac  = LoacationHelper.GetMac();
         }
         if (name == "btnAppCreate")
         {
             string url = PubulicData.GCFN("appurl").Text;
             url           = url.Trim('"');
             btnname       = PubulicData.GCFN("appname").Text;
             btnurl        = url;
             bd.Name       = btnname;
             bd.Url        = btnurl;
             bd.Type       = "链接";
             bd.State      = "show";
             bd.CreateDate = DateTime.Now;
             bd.CreateIP   = LoacationHelper.GetLocalIP();
             bd.CreateMac  = LoacationHelper.GetMac();
         }
         ActionHelper.saveInfo <ButtonDate>(bd);
         SX();
     }
 }
Example #5
0
 /// <summary>
 /// 清空按钮
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public void EmptButton(TTButton btnow)
 {
     id = 0;
     if (btnow != null)
     {
         string name = btnow.Name;
         if (name == "btnWebClear")
         {
             PubulicData.GCFN("webbtn").Text = "";
             PubulicData.GCFN("webllq").Text = "";
             PubulicData.GCFN("weburl").Text = "";
         }
         if (name == "btnAppClear")
         {
             PubulicData.GCFN("appname").Text = "";
             PubulicData.GCFN("appurl").Text  = "";
         }
     }
     // reSetData();
 }
Example #6
0
        /// <summary>
        /// 右击选中按钮
        /// </summary>
        /// <param name="sender"></param>
        public void SelectButton(object sender)
        {
            TTButton btnow = sender as TTButton;

            if (btnow != null)
            {
                string     name = btnow.Name;
                string     sid  = name.Substring(3, name.Length - 3);
                int        id   = Convert.ToInt32(sid);
                ButtonDate item = ActionHelper.getInfo <ButtonDate>(new KeyValuePair <string, object>("ID", id));
                if (item == null)
                {
                    return;
                }
                if (item.Type == "网站")
                {
                    SelectWebShow(item);
                }
                if (item.Type == "链接")
                {
                    SelectAppShow(item);
                }
            }
        }
Example #7
0
 public void setButtonImage(TTButton bt)
 {
     bt.ForeColor = Color.FromName("black");
     bt.Font      = new Font("行书", 10.2f, FontStyle.Bold);
 }
Example #8
0
        private void onClick(object sender, EventArgs e)
        {
            if (sender is TTButton)
            {
                TTButton btn = sender as TTButton;
                switch (btn.Name)
                {
                case "hf":
                    RestoreButton();
                    break;

                case "sc":
                    DeleteButton();
                    break;

                case "ycxs":
                    ycxs_Click();
                    break;

                case "btnWebClear":
                case "btnAppClear":
                    EmptButton(btn);
                    break;

                case "btnWebCreate":
                case "btnAppCreate":
                    CreateButton(btn);
                    break;

                case "btnClose":
                    formClose();
                    break;

                case "btnWebTop":
                    setButtonTop(BtnType.网站);
                    break;

                case "btnAppTop":
                    setButtonTop(BtnType.链接);
                    break;

                case "btnWebUp":
                    setButtonUpOrDown(BtnType.网站, "上移");
                    break;

                case "btnAppUp":
                    setButtonUpOrDown(BtnType.链接, "上移");
                    break;

                case "btnWebDown":
                    setButtonUpOrDown(BtnType.网站, "下移");
                    break;

                case "btnAppDown":
                    setButtonUpOrDown(BtnType.链接, "下移");
                    break;

                case "btnPT":
                    frmOtherFormMain pro = new frmOtherFormMain(showF);
                    frmClosing();
                    pro.Show();
                    break;
                }
            }
        }