Exemplo n.º 1
0
        protected override void OnMouseMove(MouseEventArgs e)
        {
            mouseover = true;
            FadeScheduler.SetFadeType(overfade, FadeType.In);

            base.OnMouseMove(e);
        }
Exemplo n.º 2
0
        protected override void ControlStyleChanged()
        {
            theme = (ThemeLabelTabElements)GetStyle();

            if (!theme.OverFade)
            {
                theme.OverFadeMin   = 0f;
                theme.OverFadeMax   = 1f;
                theme.OverFadeSteps = 1;
                overfadeprogress    = 0f;
            }

            if (!theme.SelectFade)
            {
                theme.SelectFadeMin   = 0f;
                theme.SelectFadeMax   = 1f;
                theme.SelectFadeSteps = 1;
                selectfadeprogress    = 0f;
            }

            FadeScheduler.UpdateFade(overfadeid, ((theme.OverFadeMax - theme.OverFadeMin) / theme.OverFadeSteps), theme.OverFadeMin, theme.OverFadeMax);
            FadeScheduler.UpdateFade(selectfadeid, ((theme.SelectFadeMax - theme.SelectFadeMin) / theme.SelectFadeSteps), theme.SelectFadeMin, theme.SelectFadeMax);

            if (this.Parent is ThemeTabControl)
            {
                ((ThemeTabControl)this.Parent).tabbar.Invalidate();
            }
        }
Exemplo n.º 3
0
        protected override void OnMouseUp(MouseEventArgs e)
        {
            mousedown = false;
            FadeScheduler.SetFadeType(downfade, FadeType.Out);

            base.OnMouseUp(e);
        }
Exemplo n.º 4
0
        public ThemeTab(string Text)
        {
            this.text = Text;

            overfadeid   = FadeScheduler.CreateFade(new EventHandler <FadeEventArgs>(this.FadeChanged), 0.2f, 0f, 1f);
            selectfadeid = FadeScheduler.CreateFade(new EventHandler <FadeEventArgs>(this.FadeChanged), 0.2f, 0f, 1f);
        }
Exemplo n.º 5
0
        protected override void OnMouseDown(MouseEventArgs e)
        {
            mousedown = true;
            FadeScheduler.SetFadeType(downfade, FadeType.In);

            base.OnMouseDown(e);
        }
Exemplo n.º 6
0
        protected override void OnMouseLeave(EventArgs e)
        {
            mouseover = false;
            FadeScheduler.SetFadeType(overfade, FadeType.Out);

            base.OnMouseLeave(e);
        }
Exemplo n.º 7
0
        protected override void OnMouseLeave(EventArgs e)
        {
            isoverdropdown = false;

            FadeScheduler.SetFadeType(overfadeid, FadeType.Out);

            base.OnMouseLeave(e);
        }
Exemplo n.º 8
0
        public ThemeCaptionButton(CapBtnType type, object Parent)
        {
            this.type   = type;
            this.Parent = Parent;

            overfadeid = FadeScheduler.CreateFade(new EventHandler <FadeEventArgs>(this.FadeChanged), 0.2f, 0f, 1f);
            downfadeid = FadeScheduler.CreateFade(new EventHandler <FadeEventArgs>(this.FadeChanged), 0.2f, 0f, 1f);
        }
Exemplo n.º 9
0
        protected override void ControlStyleChanged()
        {
            elements = (ThemeTabBarElements)GetStyle();

            if (!elements.NavButtonOverFade)
            {
                elements.NavButtonOverFadeMin   = 0f;
                elements.NavButtonOverFadeMax   = 1f;
                elements.NavButtonOverFadeSteps = 1;
                navbtnbackoverfadeprogress      = 0f;
                navbtnfwdoverfadeprogress       = 0f;
            }

            btnclose.Bounds = elements.CloseButtonRect(this.ClientRectangle);
            btnmax.Bounds   = elements.MaximizeButtonRect(this.ClientRectangle);
            btnmin.Bounds   = elements.MinimizeButtonRect(this.ClientRectangle);

            FadeScheduler.UpdateFade(navbtnbackoverfadeid, ((elements.NavButtonOverFadeMax - elements.NavButtonOverFadeMin) / elements.NavButtonOverFadeSteps), elements.NavButtonOverFadeMin, elements.NavButtonOverFadeMax);
            FadeScheduler.UpdateFade(navbtnfwdoverfadeid, ((elements.NavButtonOverFadeMax - elements.NavButtonOverFadeMin) / elements.NavButtonOverFadeSteps), elements.NavButtonOverFadeMin, elements.NavButtonOverFadeMax);
        }
Exemplo n.º 10
0
        public ThemeTabBar(ThemeTabControl parent)
        {
            this.parent = parent;

            this.Margin = new Padding(0, 0, 0, 0);

            btnclose         = new ThemeCaptionButton(ThemeCaptionButton.CapBtnType.Close, this);
            btnclose.Parent  = this;
            btnclose.Visible = false;

            btnmax         = new ThemeCaptionButton(ThemeCaptionButton.CapBtnType.Maximize, this);
            btnmax.Parent  = this;
            btnmax.Visible = false;

            btnmin         = new ThemeCaptionButton(ThemeCaptionButton.CapBtnType.Minimize, this);
            btnmin.Parent  = this;
            btnmin.Visible = false;


            navbtnbackoverfadeid = FadeScheduler.CreateFade(new EventHandler <FadeEventArgs>(this.FadeChanged), 1f, 0f, 1f);
            navbtnfwdoverfadeid  = FadeScheduler.CreateFade(new EventHandler <FadeEventArgs>(this.FadeChanged), 1f, 0f, 1f);
        }
Exemplo n.º 11
0
        protected override void ControlStyleChanged()
        {
            elements = (ThemeButtonElements)GetStyle();

            if (!elements.OverFade)
            {
                elements.OverFadeMin   = 0f;
                elements.OverFadeMax   = 1f;
                elements.OverFadeSteps = 1;
                overfadeprogress       = 0f;
            }

            if (!elements.DownFade)
            {
                elements.DownFadeMin   = 0f;
                elements.DownFadeMax   = 1f;
                elements.DownFadeSteps = 1;
                downfadeprogress       = 0f;
            }

            FadeScheduler.UpdateFade(overfadeid, ((elements.OverFadeMax - elements.OverFadeMin) / elements.OverFadeSteps), elements.OverFadeMin, elements.OverFadeMax);
            FadeScheduler.UpdateFade(downfadeid, ((elements.DownFadeMax - elements.DownFadeMin) / elements.DownFadeSteps), elements.DownFadeMin, elements.DownFadeMax);
        }
Exemplo n.º 12
0
        protected override void OnMouseMove(MouseEventArgs e)
        {
            mseposx = e.X;
            mseposy = e.Y;

            if (elements.NavButtonBack && elements.NavButtonBackRect().Contains(e.Location))
            {
                FadeScheduler.SetFadeType(navbtnbackoverfadeid, FadeType.In);
            }
            else
            {
                FadeScheduler.SetFadeType(navbtnbackoverfadeid, FadeType.Out);
            }

            if (elements.NavButtonForward && elements.NavButtonForwardRect().Contains(e.Location))
            {
                FadeScheduler.SetFadeType(navbtnfwdoverfadeid, FadeType.In);
            }
            else
            {
                FadeScheduler.SetFadeType(navbtnfwdoverfadeid, FadeType.Out);
            }

            hoverindex = -1;

            bool redraw = false;

            int index = 0;

            foreach (ThemeTab tab in parent.TabPages)
            {
                ThemeTab.State original = tab.state;

                tab.state = ThemeTab.State.Normal;

                Rectangle bounds = tab.bounds;
                if (bounds.Contains(e.Location))
                {
                    hoverindex = index;
                    tab.state |= ThemeTab.State.Over;

                    if (mousedown)
                    {
                        tab.state |= ThemeTab.State.Down;
                    }
                }

                if (index == parent.SelectedIndex)
                {
                    tab.state |= ThemeTab.State.Selected;
                }

                redraw = redraw | (original != tab.state);

                if (((original & ThemeTab.State.Over) > 0) && !((tab.state & ThemeTab.State.Over) > 0))
                {
                    FadeScheduler.SetFadeType(tab.overfadeid, FadeType.Out);
                }
                else if (!((original & ThemeTab.State.Over) > 0) && ((tab.state & ThemeTab.State.Over) > 0))
                {
                    FadeScheduler.SetFadeType(tab.overfadeid, FadeType.In);
                }

                index++;
            }

            if (redraw)
            {
                Invalidate();
            }

            base.OnMouseMove(e);
        }
Exemplo n.º 13
0
 public ThemeButton()
 {
     overfadeid = FadeScheduler.CreateFade(new EventHandler <FadeEventArgs>(this.FadeChanged), 0.2f, 0f, 1f);
     downfadeid = FadeScheduler.CreateFade(new EventHandler <FadeEventArgs>(this.FadeChanged), 0.2f, 0f, 1f);
 }
Exemplo n.º 14
0
        protected override void OnMouseEnter(EventArgs e)
        {
            FadeScheduler.SetFadeType(overfadeid, FadeType.In);

            base.OnMouseEnter(e);
        }
Exemplo n.º 15
0
 public void SetFadeType(FadeType ft)
 {
     FadeScheduler.SetFadeType(overfadeid, ft);
 }
Exemplo n.º 16
0
 public ThemeScrollBar()
 {
     overfade = FadeScheduler.CreateFade(new EventHandler <FadeEventArgs>(this.FadeChanged), 1f, 0f, 1f);
     downfade = FadeScheduler.CreateFade(new EventHandler <FadeEventArgs>(this.FadeChanged), 1f, 0f, 1f);
 }
Exemplo n.º 17
0
 public void SetDownFadeType(FadeType ft)
 {
     FadeScheduler.SetFadeType(downfadeid, ft);
 }