Ejemplo n.º 1
0
        static void CreateBar(SwapChain parent)
        {
            TextBlock tb = new TextBlock();

            tb.FontStyle    = TextBlock.FontName.SegoeUISymbol;
            tb.Text         = ((char)0xe0d5).ToString();
            tb.SurfaceBrush = BrushManage.GetRadia_A();
            tb.Size         = new Size2F(32, 32);
            tb.FontSize     = 24;
            tb.Alignment    = SharpDX.DirectWrite.TextAlignment.Center;
            tb.PointerEntry = PointerEntry;
            tb.PointerLeave = PointerLeave;
            UIElement.SetClick(tb, Click);
            TextBar[0] = tb;

            tb           = new TextBlock();
            tb.Text      = "1";
            tb.Forground = new RawColor4(1, 1, 1, 1);
            tb.Size      = new Size2F(48, 32);
            tb.FontSize  = 24;
            tb.Alignment = SharpDX.DirectWrite.TextAlignment.Center;
            TextBar[1]   = tb;

            tb              = new TextBlock();
            tb.FontStyle    = TextBlock.FontName.SegoeUISymbol;
            tb.Text         = ((char)0xe0ae).ToString();
            tb.SurfaceBrush = BrushManage.GetRadia_A();
            tb.Size         = new Size2F(32, 32);
            tb.FontSize     = 24;
            tb.Alignment    = SharpDX.DirectWrite.TextAlignment.Center;
            tb.PointerEntry = PointerEntry;
            tb.PointerLeave = PointerLeave;
            UIElement.SetClick(tb, Click);
            TextBar[2] = tb;

            tb              = new TextBlock();
            tb.FontStyle    = TextBlock.FontName.SegoeUISymbol;
            tb.Text         = ((char)0xe181).ToString();
            tb.SurfaceBrush = BrushManage.GetRadia_A();
            tb.Size         = new Size2F(32, 32);
            tb.FontSize     = 24;
            tb.Alignment    = SharpDX.DirectWrite.TextAlignment.Center;
            tb.PointerEntry = PointerEntry;
            tb.PointerLeave = PointerLeave;
            UIElement.SetClick(tb, ShowAbout);
            TextBar[3] = tb;
            lock (parent.DX_Child)
            {
                parent.DX_Child.Add(TextBar[0]);
                parent.DX_Child.Add(TextBar[1]);
                parent.DX_Child.Add(TextBar[2]);
                parent.DX_Child.Add(TextBar[3]);
            }
        }
        static void CreateInfoPanel()
        {
            pic                 = new UIImage();
            titleback           = new RoundBorder();
            titleback.FillBrush = BrushManage.GetLinearA();

            titleback.RoundRect.RadiusX = 8;
            titleback.RoundRect.RadiusY = 8;
            title              = new TextBlock();
            title.Forground    = new RawColor4(0.6f, 0.9f, 0.8f, 1);
            title.Alignment    = SharpDX.DirectWrite.TextAlignment.Center;
            title.PointerEntry = (o, e) =>
            {
                titleback.FillBrush   = BrushManage.GetLinearB();
                titleback.Forground   = new RawColor4(0.96f, 0.98f, 0.48f, 1);
                title.Forground       = new RawColor4(1, 1, 1, 1);
                ThreadManage.UpdateUI = true;
            };
            title.PointerLeave = (o, e) =>
            {
                titleback.FillBrush   = BrushManage.GetLinearA();
                titleback.Forground.A = 0;
                title.Forground       = new RawColor4(0.6f, 0.9f, 0.8f, 1);
                ThreadManage.UpdateUI = true;
            };
            UIElement.SetClick(title, TitleClick);

            detail           = new TextBlock();
            detail.Forground = new RawColor4(1, 1, 1, 1);
            //gb = new GridBox();
            //gb.Forground = new RawColor4(0.8f, 0.8f, 0.8f, 1);
            //gb.BorderColor = new RawColor4(0, 0, 0, 1);
            //gb.ItemWidth = 100;
            //gb.ItemHeight = 18;
            //RoundBorder rb = new RoundBorder();
            //rb.RoundRect.RadiusX = 8;
            //rb.RoundRect.RadiusY = 8;
            //rb.Size = new Size2F(100, 20);
            //rb.FillBrush = BrushManage.GetLinearA();
            //gb.FillTemplate = rb;

            lock (parent.DX_Child)
            {
                parent.DX_Child.Add(pic);
                parent.DX_Child.Add(titleback);
                parent.DX_Child.Add(title);
                parent.DX_Child.Add(detail);
                //parent.DX_Child.Add(gb);
            }
        }
Ejemplo n.º 3
0
 static void CreateAbout(SwapChain p)
 {
     if (about != null)
     {
         about.Visble = true;
         return;
     }
     about              = new UIViewPort();
     about.Size         = new Size2F(240, 240);
     about.GaussianBack = true;
     about.Background   = new RawColor4(0f, 0.1f, 0.2f, 0.4f);
     declare            = new TextBlock();
     declare.Alignment  = SharpDX.DirectWrite.TextAlignment.Center;
     declare.Size       = new Size2F(232, 232);
     declare.Location   = new Vector2(3, 3);
     declare.Text       = aouth;
     declare.Forground  = new RawColor4(1, 1, 1, 1);
     declare.EventCross = true;
     //about.DX_Child.Add(declare);
     close              = new TextBlock();
     close.FontStyle    = TextBlock.FontName.SegoeUISymbol;
     close.Text         = ((char)0xe0a4).ToString();
     close.SurfaceBrush = BrushManage.GetRadia_A();
     close.Size         = new Size2F(20, 20);
     close.Alignment    = SharpDX.DirectWrite.TextAlignment.Center;
     close.PointerEntry = (o, e) => { close.SurfaceBrush = BrushManage.GetRadia_R(); ThreadManage.UpdateUI = true; };
     close.PointerLeave = PointerLeave;
     close.Location     = new Vector2(217, 3);
     about.DX_Child.Add(close);
     UIElement.SetClick(close, (o) => { about.Visble          = false;
                                        declare.Visble        = false;
                                        ThreadManage.UpdateUI = true; });
     lock (p.DX_Child)
     {
         p.DX_Child.Add(about);
         p.DX_Child.Add(declare);
     }
 }
Ejemplo n.º 4
0
        static void CreateBar(SwapChain p)
        {
            if (PSB.border != null)
            {
                PSB.border.Visble    = true;
                PSB.ellipse.Visble   = true;
                PSB.play.Visble      = true;
                PSB.Sharp.Visble     = true;
                PSB.Site.Visble      = true;
                PSB.progressA.Visble = true;
                PSB.progressB.Visble = true;
                PSB.progressC.Visble = true;
                PSB.sharpback.Visble = true;
                PSB.siteback.Visble  = true;
                PSB.Back.Visble      = true;
                return;
            }
            PSB.border            = new DX.Border();
            PSB.border.Background = new RawColor4(0.2f, 0.2f, 0.2f, 0.4f);
            PSB.play              = new DX.TextBlock();
            PSB.play.FontStyle    = DX.TextBlock.FontName.SegoeUISymbol;
            PSB.play.Alignment    = SharpDX.DirectWrite.TextAlignment.Center;
            PSB.play.Text         = ((char)0xe103).ToString();//e103
            PSB.play.FontSize     = 30;
            PSB.play.Size         = new Size2F(40, 40);
            PSB.play.EventCross   = true;
            PSB.play.SurfaceBrush = BrushManage.GetRadia_A();

            PSB.progressA = new RoundBorder();
            PSB.progressA.RoundRect.RadiusX = 2.5f;
            PSB.progressA.RoundRect.RadiusY = 2.5f;
            PSB.progressA.FillBrush         = BrushManage.GetLinearA();
            PSB.progressB = new RoundBorder();
            PSB.progressB.RoundRect.RadiusX = 2.5f;
            PSB.progressB.RoundRect.RadiusY = 2.5f;
            PSB.progressB.FillBrush         = BrushManage.GetLinearG();
            PSB.progressC = new RoundBorder();
            PSB.progressC.RoundRect.RadiusX = 2.5f;
            PSB.progressC.RoundRect.RadiusY = 2.5f;
            PSB.progressC.FillBrush         = BrushManage.GetLinearR();
            DX.UIElement.SetClick(PSB.progressA, ProgressChange);
            DX.UIElement.SetClick(PSB.progressB, ProgressChange);
            DX.UIElement.SetClick(PSB.progressC, ProgressChange);

            PSB.ellipse = new Ellipse();
            PSB.ellipse.ellipse.RadiusX = 20;
            PSB.ellipse.ellipse.RadiusY = 20;
            PSB.ellipse.FillBrush       = BrushManage.GetRadia_C();
            PSB.ellipse.PointerEntry    = (o, e) => {
                PSB.play.SurfaceBrush = BrushManage.GetRadia_B();
                PSB.ellipse.FillBrush = BrushManage.GetRadia_D();
                ThreadManage.UpdateUI = true;
            };
            PSB.ellipse.PointerLeave = (o, e) => {
                PSB.play.SurfaceBrush = BrushManage.GetRadia_A();
                PSB.ellipse.FillBrush = BrushManage.GetRadia_C();
                ThreadManage.UpdateUI = true;
            };
            DX.UIElement.SetClick(PSB.ellipse, PlayOrPause);

            PSB.Sharp                   = new DX.ComboBox();
            PSB.Sharp.Size              = new Size2F(100, 20);
            PSB.Sharp.List.Size         = new Size2F(100, 72);
            PSB.Sharp.Up                = true;
            PSB.Sharp.Content.Forground = new RawColor4(0, 1, 0, 1);
            PSB.Sharp.List.Forground    = new RawColor4(1, 1, 1, 0.8f);
            PSB.Sharp.List.Background   = new RawColor4(0.2f, 0.2f, 0.2f, 0.5f);
            PSB.Sharp.Pop.Forground     = new DX.Color(251, 255, 139, 255);
            PSB.Sharp.SelectChanged     = (o) => {
                int c = (o as DX.ComboBox).List.SelectedIndex;
                SharpChanged(c);
            };
            PSB.Site                   = new DX.ComboBox();
            PSB.Site.Size              = new Size2F(100, 20);
            PSB.Site.List.Size         = new Size2F(100, 72);
            PSB.Site.List.Forground    = new RawColor4(1, 1, 1, 0.8f);
            PSB.Site.Up                = true;
            PSB.Site.Content.Forground = new RawColor4(1, 0, 0, 1);
            PSB.Site.List.Background   = new RawColor4(0.2f, 0.2f, 0.2f, 0.5f);
            PSB.Site.Pop.Forground     = new DX.Color(251, 255, 139, 255);
            PSB.Site.SelectChanged     = (o) => {
                int c = (o as DX.ComboBox).List.SelectedIndex;
                SiteChanged(c);
            };
            PSB.sharpback = new RoundBorder();
            PSB.sharpback.RoundRect.RadiusX = 6;
            PSB.sharpback.RoundRect.RadiusY = 6;
            PSB.sharpback.Size             = new Size2F(100, 20);
            PSB.sharpback.FillBrush        = BrushManage.GetLinearA();
            PSB.siteback                   = new RoundBorder();
            PSB.siteback.RoundRect.RadiusX = 6;
            PSB.siteback.RoundRect.RadiusY = 6;
            PSB.siteback.Size              = new Size2F(100, 20);
            PSB.siteback.FillBrush         = BrushManage.GetLinearA();

            PSB.Back = new DX.Border();
            DX.UIElement.SetClick(PSB.Back, HideOrShow);
            lock (p.DX_Child)
            {
                p.DX_Child.Add(PSB.Back);
                p.DX_Child.Add(PSB.border);
                p.DX_Child.Add(PSB.ellipse);
                p.DX_Child.Add(PSB.play);
                p.DX_Child.Add(PSB.progressA);
                p.DX_Child.Add(PSB.progressB);
                p.DX_Child.Add(PSB.progressC);
                p.DX_Child.Add(PSB.sharpback);
                p.DX_Child.Add(PSB.siteback);
                PSB.Sharp.SetParent(p.DX_Child);
                PSB.Site.SetParent(p.DX_Child);
            }
        }
Ejemplo n.º 5
0
        public static void Create(SwapChain p, RawRectangleF m)//parent,margin
        {
            if (sp != null)
            {
                ReSize(m);
                return;
            }
            SetNav(0);
            Parent = p;

            nav        = new ListBox();
            nav.Hrizon = true;
            int c = nav_data.Length;

            for (int i = 0; i < c; i++)
            {
                nav.Data.Add(nav_data[i].title[0]);
            }
            nav.SelectedIndex = 0;
            nav.ItemWidth     = 60;
            nav.Forground     = new RawColor4(0.8f, 0.8f, 0.8f, 1);
            nav.BorderColor   = new RawColor4(0, 0, 0, 1);
            nav.Background    = new RawColor4(0.6f, 0.4725f, 0.4725f, 0.8f);

            RoundBorder rb = new RoundBorder();

            rb.RoundRect.RadiusX = 8;
            rb.RoundRect.RadiusY = 8;
            rb.Size = new Size2F(60, 20);

            rb.FillBrush      = BrushManage.GetLinearA();
            nav.FillTemplate  = rb;
            nav.SelectChanged = (o) => {
                var lb = o as ListBox;
                if (lb.SelectedIndex < 0)
                {
                    return;
                }
                if (lb.SelectedIndex >= 12)
                {
                    return;
                }
                FilterPanel.Visble = false;
                for (int ss = 0; ss < sp.Data.Count; ss++)
                {
                    (sp.Data[ss] as IDisposable).Dispose();
                }
                sp.Data.Clear();
                part            = 0;
                TextBar[1].Text = "1";
                SetNav(lb.SelectedIndex);
            };
            nav.ItemClick = (o) => {
                ShowOrHideFilter();
            };

            FilterPanel              = new UIViewPort();
            FilterPanel.Visble       = false;
            FilterPanel.GaussianBack = true;
            FilterPanel.Background   = new RawColor4(0, 0.1f, 0.2f, 0.4f);

            sp = new GridPanel();
            sp.ItemTemplate = DataMod.GetTemplate();
            sp.BorderColor  = new RawColor4(0, 0, 0, 1);
            create          = true;
            sp.ItemClick    = (o, e) => {
                if (sp.ClickIndex < 0)
                {
                    return;
                }
                string href = (sp.Data[sp.ClickIndex] as DataMod).href;
                if (href != null)
                {
                    VideoPage.SetAddress(href);
                }
                PageManageEx.CreateNewPage(PageTag.videopage);
            };
            lock (p.DX_Child)
            {
                p.DX_Child.Add(sp);
                p.DX_Child.Add(nav);
                p.DX_Child.Add(FilterPanel);
            }
            CreateBar(p);
            ReSize(m);
            if (load)
            {
                Analyze();
            }
        }
Ejemplo n.º 6
0
 static void PointerLeave(DX.UIElement u, Vector2 dot)
 {
     (u as TextBlock).SurfaceBrush = BrushManage.GetRadia_A();
     ThreadManage.UpdateUI         = true;
 }
Ejemplo n.º 7
0
        static void UpdateFilter()
        {
            Vector2 location  = new Vector2(4, 4);
            Vector2 location2 = new Vector2(60, 0);

            for (int i = 0; i < 8; i++)
            {
                if (OptionTitle[i] != null)
                {
                    if (FilterTitle[i] == null)
                    {
                        var tb = new TextBlock();
                        tb.Forground   = new DX.Color(255, 128, 0, 255);
                        tb.Size        = new Size2F(80, 20);
                        tb.Location    = location;
                        FilterTitle[i] = tb;
                        FilterPanel.DX_Child.Add(tb);
                    }
                    else
                    {
                        FilterTitle[i].Visble = true;
                    }
                    FilterTitle[i].Text = OptionTitle[i];
                    if (FilterList[i] == null)
                    {
                        var lb = new ListBox();
                        lb.Size          = new Size2F(margin.Right - margin.Left - 70, 30);
                        lb.Hrizon        = true;
                        lb.Location      = location2;
                        lb.SelectedIndex = 0;
                        lb.ItemWidth     = 70;
                        lb.Forground     = new DX.Color(255, 255, 193, 255);
                        lb.Context       = i;
                        RoundBorder rb = new RoundBorder();
                        rb.RoundRect.RadiusX = 8;
                        rb.RoundRect.RadiusY = 8;
                        rb.Size          = new Size2F(70, 20);
                        rb.FillBrush     = BrushManage.GetLinearA();
                        lb.FillTemplate  = rb;
                        FilterList[i]    = lb;
                        lb.SelectedIndex = 0;
                        lb.SelectChanged = SelectChanged;
                        FilterPanel.DX_Child.Add(lb);
                    }
                    else
                    {
                        FilterList[i].Visble = true;
                    }
                    FilterList[i].Data.Clear();
                    int c = filter_buff[i].Count;
                    for (int t = 0; t < c; t++)
                    {
                        FilterList[i].Data.Add(filter_buff[i][t].Content);
                    }
                }
                else
                {
                    if (FilterTitle[i] != null)
                    {
                        FilterTitle[i].Visble = false;
                    }
                    if (FilterList[i] != null)
                    {
                        FilterList[i].Visble = false;
                    }
                }
                location.Y  += 24;
                location2.Y += 24;
            }
            ThreadManage.UpdateUI = true;
        }