コード例 #1
0
        public static void AddPalItem()
        {
            if (PublicStatic.LiuXingNav == null) return;
            PublicStatic.LiuXingNav.Controls.Clear();

            #region 添加面板

            // 总面板
            AddPal = new LPanel
                (
                PublicStatic.LiuXingNav,
                0,
                new Size(PublicStatic.LiuXingNav.Width, PublicStatic.LiuXingNav.Height),
                new Point(0, 0),
                Color.Transparent,
                Color.Transparent, //System.Drawing.Color.FromArgb(255, 255, 255)
                AnchorStyles.Left | AnchorStyles.Right |
                AnchorStyles.Top
                );
            // 应用名字
            AppName = new InputBoxWithDesc(
                AddPal,
                1,
                2,
                @"链接命名",
                AppNameTip,
                new Font(PublicStatic.SegoeFont, 12.5F),
                new Size(104, 34),
                new Font(PublicStatic.SegoeFont, 12F),
                new Size(444, 34),
                new Point(8, 8 + (34 + 8)*0),
                Color.FromArgb(248, 248, 248),
                PublicStatic.SouSouColor[PublicStatic.SouSouIndex],
                Color.FromArgb(220, 220, 220),
                PublicStatic.SouSouColor[PublicStatic.SouSouIndex],
                Color.FromArgb(248, 248, 248),
                Color.FromArgb(248, 248, 248),
                Color.FromArgb(75, 75, 75),
                Color.FromArgb(25, 25, 25),
                AnchorStyles.Left | AnchorStyles.Top
                ) {TabIndex = 1};

            // 应用链接
            AppUrl = new InputBoxWithDesc(
                AddPal,
                1,
                2,
                @"链接地址",
                AppUrlTip,
                new Font(PublicStatic.SegoeFont, 12.5F),
                new Size(104, 34),
                new Font(PublicStatic.SegoeFont, 12F),
                new Size(444, 34),
                new Point(8, 8 + (34 + 8)*1),
                Color.FromArgb(248, 248, 248),
                PublicStatic.SouSouColor[PublicStatic.SouSouIndex],
                Color.FromArgb(220, 220, 220),
                PublicStatic.SouSouColor[PublicStatic.SouSouIndex],
                Color.FromArgb(248, 248, 248),
                Color.FromArgb(248, 248, 248),
                Color.FromArgb(75, 75, 75),
                Color.FromArgb(25, 25, 25),
                AnchorStyles.Left | AnchorStyles.Top
                ) {TabIndex = 2};

            // 应用宽度
            AppWidth = new InputBoxWithDesc(
                AddPal,
                1,
                2,
                @"链接宽度",
                AppWidthTip,
                new Font(PublicStatic.SegoeFont, 12.5F),
                new Size(104, 34),
                new Font(PublicStatic.SegoeFont, 12F),
                new Size(165, 34),
                new Point(8 + 84 + 464 + 8, 8 + (34 + 8)*0),
                Color.FromArgb(248, 248, 248),
                PublicStatic.SouSouColor[PublicStatic.SouSouIndex],
                Color.FromArgb(220, 220, 220),
                PublicStatic.SouSouColor[PublicStatic.SouSouIndex],
                Color.FromArgb(248, 248, 248),
                Color.FromArgb(248, 248, 248),
                Color.FromArgb(75, 75, 75),
                Color.FromArgb(25, 25, 25),
                AnchorStyles.Left | AnchorStyles.Top
                ) {TabIndex = 3};

            // 应用高度
            AppHeight = new InputBoxWithDesc(
                AddPal,
                1,
                2,
                @"链接高度",
                AppHeightTip,
                new Font(PublicStatic.SegoeFont, 12.5F),
                new Size(104, 34),
                new Font(PublicStatic.SegoeFont, 12F),
                new Size(165, 34),
                new Point(8 + 84 + 464 + 8, 8 + (34 + 8)*1),
                Color.FromArgb(248, 248, 248),
                PublicStatic.SouSouColor[PublicStatic.SouSouIndex],
                Color.FromArgb(220, 220, 220),
                PublicStatic.SouSouColor[PublicStatic.SouSouIndex],
                Color.FromArgb(248, 248, 248),
                Color.FromArgb(248, 248, 248),
                Color.FromArgb(75, 75, 75),
                Color.FromArgb(25, 25, 25),
                AnchorStyles.Left | AnchorStyles.Top
                ) {TabIndex = 4};

            // 重填按钮
            AppCancel = new LButton
                (
                AddPal,
                1,
                "重 填",
                new Font(PublicStatic.SegoeFont, 12.5F),
                new Size(BtnWidth, 32),
                new Point(8 + (BtnWidth + 8)*0, 8 + (34 + 8)*2),
                PublicStatic.SouSouColor[1],
                PublicStatic.SouSouColor[1],
                PublicStatic.SouSouColor[1],
                Color.FromArgb(248, 248, 248),
                Color.FromArgb(248, 248, 248),
                PublicStatic.SouSouColor[PublicStatic.SouSouIndex],
                AnchorStyles.Left | AnchorStyles.Top
                ) {TabIndex = 5};
            AppCancel.MouseClick += AppCancel_MouseClick;

            // 预览按钮
            AppPreview = new LButton
                (
                AddPal,
                1,
                "预 览",
                new Font(PublicStatic.SegoeFont, 12.5F),
                new Size(BtnWidth, 32),
                new Point(8 + (BtnWidth + 8)*1, 8 + (34 + 8)*2),
                PublicStatic.SouSouColor[2],
                PublicStatic.SouSouColor[2],
                PublicStatic.SouSouColor[2],
                Color.FromArgb(248, 248, 248),
                Color.FromArgb(248, 248, 248),
                PublicStatic.SouSouColor[PublicStatic.SouSouIndex],
                AnchorStyles.Left | AnchorStyles.Top
                ) {TabIndex = 7};
            AppPreview.MouseClick += AppPreview_MouseClick;

            // 添加
            AppAddItem = new LButton
                (
                AddPal,
                1,
                "添 加",
                new Font(PublicStatic.SegoeFont, 12.5F),
                new Size(BtnWidth, 32),
                new Point(8 + (BtnWidth + 8)*2, 8 + (34 + 8)*2),
                PublicStatic.SouSouColor[0],
                PublicStatic.SouSouColor[0],
                PublicStatic.SouSouColor[0],
                Color.FromArgb(248, 248, 248),
                Color.FromArgb(248, 248, 248),
                PublicStatic.SouSouColor[PublicStatic.SouSouIndex],
                AnchorStyles.Left | AnchorStyles.Top
                ) {TabIndex = 6};
            AppAddItem.MouseClick += AppAddItem_MouseClick;

            // 删除按钮
            AppDelete = new LButton
                (
                AddPal,
                1,
                "删 除",
                new Font(PublicStatic.SegoeFont, 12.5F),
                new Size(BtnWidth, 32),
                new Point(8 + (BtnWidth + 8)*3, 8 + (34 + 8)*2),
                PublicStatic.SouSouColor[3],
                PublicStatic.SouSouColor[3],
                PublicStatic.SouSouColor[3],
                Color.FromArgb(248, 248, 248),
                Color.FromArgb(248, 248, 248),
                PublicStatic.SouSouColor[PublicStatic.SouSouIndex],
                AnchorStyles.Left | AnchorStyles.Top
                ) {TabIndex = 7};
            AppDelete.MouseClick += AppDelete_MouseClick;

            // 返回按钮
            AppSaveBack = new LButton
                (
                AddPal,
                1,
                "返 回",
                new Font(PublicStatic.SegoeFont, 12.5F),
                new Size(BtnWidth, 32),
                new Point(8 + (BtnWidth + 8)*4, 8 + (34 + 8)*2),
                PublicStatic.SouSouColor[4],
                PublicStatic.SouSouColor[4],
                PublicStatic.SouSouColor[4],
                Color.FromArgb(248, 248, 248),
                Color.FromArgb(248, 248, 248),
                PublicStatic.SouSouColor[PublicStatic.SouSouIndex],
                AnchorStyles.Left | AnchorStyles.Top
                ) {TabIndex = 7};
            AppSaveBack.MouseClick += AppSaveBack_MouseClick;

            #endregion

            UserItemLists = ReadByLocalPath();
        }
コード例 #2
0
 /// <summary>
 /// 逐个加载应用
 /// </summary>
 private static void LoadNavItems()
 {
     // 加载应用
     var index = 0;
     var count = 0;
     foreach (var dic in PublicStatic.Dics)
     {
         for (int j = 0; j < dic.Value.Count; j++)
         {
             // 限定显示这么多应用
             if (count <= XianDing)
             {
                 WatchTvData vk = dic.Value[j];
                 // 加载
                 var btn = new LButton
                     (
                     PublicStatic.LiuXingNav,
                     1,
                     vk.Name,
                     new Font(PublicStatic.SegoeFont, 12.5F),
                     new Size(115, 32),
                     new Point(8 + (101 + 8)*0, 6),
                     PublicStatic.SouSouColor[index],
                     PublicStatic.SouSouColor[index],
                     Color.FromArgb(248, 248, 248),
                     PublicStatic.SouSouColor[index],
                     PublicStatic.SouSouColor[index],
                     Color.FromArgb(248, 248, 248),
                     AnchorStyles.Left | AnchorStyles.Top
                     ) {Tag = vk};
                 btn.MouseClick += btn_MouseClick;
                 // 发现第一个应用的时候加载下
                 if (count == 0)
                 {
                     if (ChangeUi)
                     {
                         ChangeUi = false;
                     }
                     else
                     {
                         PublicStatic.NowPlayWatch = vk;
                         PublicStatic.LiuXingCon.Navigate(vk.Url);
                     }
                 }
                 // 继续下一个
                 count++;
             }
         }
         // 控制颜色序号
         index++;
     }
 }
コード例 #3
0
        public InputSearch(
            System.Windows.Forms.Control parentpal,
            int lineint,
            int lineflo,
            string predesc,
            string preword,
            System.Drawing.Font descfont,
            System.Drawing.Size descsize,
            System.Drawing.Font font,
            System.Drawing.Size size,
            System.Drawing.Point point,
            System.Drawing.Color defrcolor,
            System.Drawing.Color debkcolor,
            System.Drawing.Color linecolor,
            System.Drawing.Color linelight,
            System.Drawing.Color backcolor,
            System.Drawing.Color backlight,
            System.Drawing.Color forecolor,
            System.Drawing.Color forelight,
            System.Windows.Forms.MouseEventHandler searchEnter,
            System.Windows.Forms.KeyEventHandler searchEnterKey,
            System.Windows.Forms.AnchorStyles anchorstyle
            )
        {
            Linecolor = linecolor;
            Linelight = linelight;
            Backcolor = backcolor;
            Backlight = backlight;
            Forecolor = forecolor;
            Forelight = forelight;

            var inputPal = new LPanel
                (
                parentpal,
                lineint,
                size,
                point,
                Linecolor,
                Backcolor,
                anchorstyle
                );

            var inputdesc = new LButton
                (
                inputPal,
                0,
                predesc,
                descfont,
                descsize,
                new System.Drawing.Point(size.Width - descsize.Width, -1),
                debkcolor,
                debkcolor,
                debkcolor,
                System.Drawing.Color.FromArgb(51, debkcolor),
                defrcolor,
                defrcolor,
                System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Top
                );
            inputdesc.MouseClick += searchEnter;

            Text = preword;
            Multiline = false;
            Size = new System.Drawing.Size(inputPal.Size.Width - 8*lineint - descsize.Width,
                                           inputPal.Size.Height - 4*lineint);
            Location = new System.Drawing.Point(4*lineint, (4 + lineflo)*lineint);
            BackColor = Backcolor;
            ForeColor = Forecolor;
            Font = font;
            Anchor = anchorstyle;

            Leave += LInput_Leave;
            Enter += LInput_Enter;
            KeyDown += searchEnterKey;
            inputPal.Controls.Add(this);
        }