Beispiel #1
0
        public ScVxSlideScreen()
        {
            leftScreen  = new ScVxViewScreen();
            rightScreen = new ScVxViewScreen();

            leftScreen.RowLayerBackAnimEvent  += LeftScreen_RowLayerBackAnimEvent;
            rightScreen.RowLayerBackAnimEvent += RightScreen_RowLayerBackAnimEvent;

            Add(leftScreen);
            Add(rightScreen);

            pageSelector = new ScVxPageSelectorEx();
            pageSelector.IsHitThrough           = false;
            pageSelector.ps.MouseDownPageEvent += PageSelector_MouseDownPageEvent;

            Add(pageSelector);

            SizeChanged += ScVxSlideScreen_SizeChanged;
            MouseDown   += ScVxSlideScreen_MouseDown;

            MouseMove += ScVxSlideScreen_MouseMove;
            MouseUp   += ScVxSlideScreen_MouseUp;

            slideScreenAnim = new ScAnimation(this, 400, true);
            slideScreenAnim.AnimationEvent += SlideScreenAnim_AnimationEvent;
        }
Beispiel #2
0
        public ScTextView(ScMgr scmgr = null)
            : base(scmgr)
        {
            foreFont.FamilyName = "宋体";
            foreFont.Size       = 24;
            foreFont.Style      = SharpDX.DirectWrite.FontStyle.Normal;
            foreColor           = Color.Red;

            LostFocus      += TxtView_LostFocus;
            GotFocus       += TxtView_GotFocus;
            MouseDown      += ScTextView_MouseDown;
            MouseMove      += TxtView_MouseMove;
            MouseUp        += ScTextView_MouseUp;
            KeyDown        += TxtView_KeyDown;
            KeyUp          += ScTextView_KeyUp;
            D2DPaint       += TxtView_D2DPaint;
            CharEvent      += TxtView_CharEvent;
            ImeStringEvent += TxtView_ImeStringEvent;

            Cursor       = Cursors.IBeam;
            IsHitThrough = true;


            //
            scAnim = new ScAnimation(this, -1, true);
            scAnim.AnimationEvent += ScAnim_AnimationEvent;
            scAnim.DurationMS      = 500;


            ReBulid += ScTextView_ReBulid;
        }
Beispiel #3
0
 public ScLinearAnimation(float startValue, float stopValue, ScAnimation scAnimation)
 {
     scAnim          = scAnimation;
     this.startValue = startValue;
     this.stopValue  = stopValue;
     n = (stopValue - startValue) / scAnim.AnimMS * scAnim.DurationMS;
 }
Beispiel #4
0
        public ScVxImageLoopView()
        {
            leftScreen           = new ScLayer();
            leftScreen.GDIPaint += LeftScreen_GDIPaint;

            rightScreen           = new ScLayer();
            rightScreen.GDIPaint += RightScreen_GDIPaint;

            Add(leftScreen);
            Add(rightScreen);

            playControler = new ScLayer();
            playControler.IsHitThrough = false;
            playControler.MouseDown   += PlayControler_MouseDown;
            playControler.GDIPaint    += PlayControler_GDIPaint;

            Add(playControler);

            SizeChanged += ScVxImageLoopView_SizeChanged;

            MouseDown += ScVxImageLoopView_MouseDown;
            MouseMove += ScVxImageLoopView_MouseMove;
            MouseUp   += ScVxImageLoopView_MouseUp;

            IsHitThrough = false;

            progressAnim                 = new ScAnimation(this, -1, true);
            progressAnim.DurationMS      = 20;
            progressAnim.AnimationEvent += ProgressAnim_AnimationEvent;
        }
Beispiel #5
0
        private void ScAnim_AnimationEvent(ScAnimation scAnimation)
        {
            if (mouseEnterLinear == null)
            {
                return;
            }

            float value = mouseEnterLinear.GetCurtValue();

            enterHaloAlpha = (int)value;

            if (mouseEnterLinear.IsStop)
            {
                mouseEnterAnim.Stop();
                mouseEnterLinear = null;

                if (value == endColor)
                {
                    StartProgressAnim(endColor, startColor);
                }
                else
                {
                    StartProgressAnim(startColor, endColor);
                }
            }

            Refresh();
        }
Beispiel #6
0
        private void ScaleAnim_AnimationEvent(ScAnimation scAnimation)
        {
            if (AnimValueSetEvent != null)
            {
                AnimValueSetEvent(this);
            }
            else
            {
                animValue += step;

                if (step > 0 && animValue >= maxVarValue ||
                    step < 0 && animValue <= maxVarValue)
                {
                    animValue = maxVarValue;
                    StopScaleAnim();
                }

                txt = fontTxt + animValue + backTxt;
            }

            if (AnimScaleEvent != null)
            {
                AnimScaleEvent();
            }
        }
Beispiel #7
0
        private void ScAnim_AnimationEvent(ScAnimation scAnimation)
        {
            float valx;
            AnimationEffect ae = stepAnim;

            if (ae == null)
                return;

            valx = (int)ae.GetCurtValue();

            if (downType == 0)
            {
                if (panelView.DirectionRect.Left == 0)
                    return;

                if (valx > 0)
                    valx = 0;
            }
            else
            {
                if (panelView.DirectionRect.Right == preNextBtn.Location.X)
                    return;

                if (valx + panelView.Width < preNextBtn.Location.X)
                    valx = preNextBtn.Location.X - panelView.Width;
            }

            panelView.Location = new PointF(valx, panelView.Location.Y);
            Refresh();
        }
Beispiel #8
0
        public ScButton(ScMgr scmgr = null)
            : base(scmgr)
        {
            D2DPaint += ScButton_D2DPaint;


            shadow = new ScShadow(scmgr);
            shadow.CornersRadius = 6;
            shadow.ShadowRadius  = 3;
            shadow.ShadowColor   = Color.FromArgb(15, 0, 0, 0);
            ShadowLayer          = shadow;


            this.MouseDown  += ScButton_MouseDown;
            this.MouseUp    += ScButton_MouseUp;
            this.MouseEnter += ScButton_MouseEnter;
            this.MouseLeave += ScButton_MouseLeave;

            this.D2DPaint += ScButton_D2DPaint;


            scAnim = new ScAnimation(this, animMS, true);
            scAnim.AnimationEvent += ScAnim_AnimationEvent;

            scFontColorAnim = new ScAnimation(this, animMS, true);
            scFontColorAnim.AnimationEvent += ScFontColorAnim_AnimationEvent;


            IsUseOrgHitGeometry = false;

            SizeChanged     += ScButton_SizeChanged;
            LocationChanged += ScButton_LocationChanged;
        }
Beispiel #9
0
        public ScProgressNodeAnim(ScLayer sclayer, RectangleF rect)
        {
            this.sclayer = sclayer;
            this.rect    = rect;

            scaleAnim = new ScAnimation(sclayer, 50, true);
            scaleAnim.AnimationEvent += ScaleAnim_AnimationEvent;
        }
Beispiel #10
0
        private void ProgressAnim_AnimationEvent(ScAnimation scAnimation)
        {
            downLeftScreenLocationX  = leftScreen.Location.X;
            downRightScreenLocationX = rightScreen.Location.X + rightScreen.Width;

            Move(animStep);

            Refresh();
        }
Beispiel #11
0
        public ScTxtInfo(ScLayer sclayer)
        {
            type         = 1;
            this.sclayer = sclayer;

            scaleAnim                 = new ScAnimation(sclayer, -1, true);
            scaleAnim.DurationMS      = 30;
            scaleAnim.AnimationEvent += ScaleAnim_AnimationEvent;
        }
Beispiel #12
0
        public ScVxViewScreen()
        {
            SizeChanged += ScVxViewScreen_SizeChanged;

            rowLayerAnim = new ScAnimation(this, 200, true);
            rowLayerAnim.AnimationEvent += RowLayerAnim_AnimationEvent;

            rowLayerBackAnim = new ScAnimation(this, 200, true);
            rowLayerBackAnim.AnimationEvent += RowLayerBackAnim_AnimationEvent;
        }
Beispiel #13
0
        public ScVxDate()
        {
            GDIPaint    += ScVxDate_GDIPaint;
            SizeChanged += ScVxDate_SizeChanged;

            dateAnim            = new ScAnimation(this, true);
            dateAnim.DurationMS = 1000;

            dateAnim.AnimationEvent += DateAnim_AnimationEvent;
        }
Beispiel #14
0
        public ScLayer(ScMgr scmgr = null)
        {
            ScMgr   = scmgr;
            Opacity = 1.0f;

            MouseEnter += ScControl_MouseEnter;
            MouseLeave += ScControl_MouseLeave;

            visableAnim = new ScAnimation(this, VisibleAnimMS, true);
            visableAnim.AnimationEvent += VisibleAnim_AnimationEvent;
        }
Beispiel #15
0
        private void ScAnim_AnimationEvent(ScAnimation scAnimation)
        {
            alpha = (int)linear.GetCurtValue();

            if (linear.IsStop)
            {
                scAnimation.Stop();
            }

            Refresh();
        }
Beispiel #16
0
        private void ProgressAnim_AnimationEvent(ScAnimation scAnimation)
        {
            animProgress = progressStep.GetCurtValue();
            //float progressPos = animProgress * 0.01f * Width + 1;
            float progressPos = animProgress + 1;

            RectangleF         r;
            ScProgressNodeAnim nodeAnim;

            for (int i = 0; i < progressNodeRects.Count(); i++)
            {
                r = progressNodeRects[i];

                if (progressPos >= r.Right)
                {
                    nodeAnim = progressNodeAnims[i];

                    if (nodeAnim.linear == null && nodeAnim.animScaleValue < 1.0f)
                    {
                        nodeAnim.StartScaleAnim();
                    }

                    if (i == curtProgressNodeIdx && curtProgressNodeIdx < progressNodeRects.Count() - 1)
                    {
                        //animProgress = (r.Right - 1) / (0.01f * Width);
                        animProgress = r.Right + 1;
                        progressAnim.Stop();
                        break;
                    }
                }
                else
                {
                    break;
                }
            }

            float val = (animProgress - 1) / (0.01f * Width);

            if (val >= 100)
            {
                animProgress = Width;
                // animProgress = 100;
                progressAnim.Stop();
            }

            if (ProgressEvent != null)
            {
                //progressPos = animProgress * 0.01f * Width + 1;
                progressPos = animProgress + 1;
                ProgressEvent(progressPos);
            }

            Refresh();
        }
Beispiel #17
0
        public ScVxProgressBar()
        {
            IsUseHitGeometryLayerBound = true;
            SizeChanged += ScVxProgressBar_SizeChanged;
            MouseMove   += ScVxProgressBar_MouseMove;

            GDIPaint += ScVxProgressBar_GDIPaint;

            progressAnim                 = new ScAnimation(this, -1, true);
            progressAnim.DurationMS      = 25;
            progressAnim.AnimationEvent += ProgressAnim_AnimationEvent;
        }
Beispiel #18
0
        private void ScAnim_AnimationEvent1(ScAnimation scAnimation)
        {
            growHeight = mouseEnterLinear1.GetCurtValue();

            if (mouseEnterLinear1.IsStop)
            {
                mouseEnterAnim1.Stop();

                StartProgressAnim(startColor, endColor);
            }

            Refresh();
        }
Beispiel #19
0
        public ScScrollBarSliderEx(ScMgr scmgr)
            : base(scmgr)
        {
            D2DPaint += ScScrollBarSlider_D2DPaint;

            MouseEnter += ScScrollBarSlider_MouseEnter;
            MouseDown  += ScScrollBarSlider_MouseDown;
            MouseLeave += ScScrollBarSlider_MouseLeave;
            MouseUp    += ScScrollBarSlider_MouseUp;

            scAnim = new ScAnimation(this, 100, true);
            scAnim.AnimationEvent += ScAnim_AnimationEvent;
        }
Beispiel #20
0
        public ScScrollBarSlider()
        {
            D2DPaint += ScScrollBarSlider_D2DPaint;
            GDIPaint += ScScrollBarSlider_GDIPaint;

            MouseEnter += ScScrollBarSlider_MouseEnter;
            MouseDown  += ScScrollBarSlider_MouseDown;
            MouseLeave += ScScrollBarSlider_MouseLeave;
            MouseUp    += ScScrollBarSlider_MouseUp;

            scAnim = new ScAnimation(this, 100, true);
            scAnim.AnimationEvent += ScAnim_AnimationEvent;
        }
Beispiel #21
0
        private void ZoomAnim_AnimationEvent(ScAnimation scAnimation)
        {
            animZoom = zoomLinear.GetCurtValue();

            ScaleX = animZoom;
            ScaleY = animZoom;

            if (zoomLinear.IsStop)
            {
                scAnimation.Stop();
            }

            Refresh();
        }
Beispiel #22
0
        private void ScaleAnim_AnimationEvent(ScAnimation scAnimation)
        {
            animScaleValue = linear.GetCurtValue();

            if (animScaleValue >= 1.0f)
            {
                StopScaleAnim();
            }

            if (AnimScaleEvent != null)
            {
                AnimScaleEvent();
            }
        }
Beispiel #23
0
        private void VisibleAnim_AnimationEvent(ScAnimation scAnimation)
        {
            Opacity = opacityLinear.GetCurtValue();

            if (opacityLinear.IsStop)
            {
                scAnimation.Stop();
                if (Opacity == 0)
                {
                    visible = false;
                }
            }

            Refresh();
        }
Beispiel #24
0
        public ScTabHeadItem(ScMgr scMgr, ScTabHead scTabHead)
            : base(scMgr)
        {
            this.scTabHead   = scTabHead;
            this.MouseDown  += SimpleTabHeadItem_MouseDown;
            this.MouseEnter += ScTabHeadItem_MouseEnter;
            this.MouseLeave += ScTabHeadItem_MouseLeave;

            this.D2DPaint += ScTabHeadItem_D2DPaint;
            this.GDIPaint += ScTabHeadItem_GDIPaint;

            scAnim = new ScAnimation(this, 50, true);
            scAnim.AnimationEvent += ScAnim_AnimationEvent;

            IsUseOrgHitGeometry = false;
        }
Beispiel #25
0
        public ScScrollBarSlider(float w, float h)
        {
            Width  = w;
            Height = h;

            D2DPaint += ScScrollBarSlider_D2DPaint;
            GDIPaint += ScScrollBarSlider_GDIPaint;

            MouseEnter += ScScrollBarSlider_MouseEnter;
            MouseDown  += ScScrollBarSlider_MouseDown;
            MouseLeave += ScScrollBarSlider_MouseLeave;
            MouseUp    += ScScrollBarSlider_MouseUp;

            scAnim = new ScAnimation(this, 100, true);
            scAnim.AnimationEvent += ScAnim_AnimationEvent;
        }
Beispiel #26
0
        public ScTabHeaderItem(ScMgr scmgr = null)
            : base(scmgr)
        {
            this.MouseDown  += SimpleTabHeadItem_MouseDown;
            this.MouseEnter += ScTabHeadItem_MouseEnter;
            this.MouseLeave += ScTabHeadItem_MouseLeave;

            this.D2DPaint += ScTabHeadItem_D2DPaint;

            scAnim = new ScAnimation(this, 50, true);
            scAnim.AnimationEvent += ScAnim_AnimationEvent;

            IsUseOrgHitGeometry = false;

            SizeChanged += ScTabHeaderItem_SizeChanged;
        }
Beispiel #27
0
        public ScTabHeader(ScMgr scmgr = null)
            : base(scmgr)
        {
           IsUseDebugPanitCode = true;
            panelView = new ScLayer(scmgr);
            Add(panelView);

            panelView.IsUseDebugPanitCode = true;

            preNextBtn = new ScTabHeaderPevNextBtn(scmgr);
            preNextBtn.Visible = false;
            Add(preNextBtn);
          
            scAnim = new ScAnimation(panelView, -1, true);
            scAnim.AnimationEvent += ScAnim_AnimationEvent;

            SizeChanged += ScTabHeader_SizeChanged;
        }
Beispiel #28
0
        private void ScAnim_AnimationEvent(ScAnimation scAnimation)
        {
            if (progressLinear == null)
            {
                return;
            }

            animProgress = progressLinear.GetCurtValue();

            if (progressLinear.IsStop)
            {
                scAnimation.Stop();
                progressLinear = null;
                StartProgressAnim();
            }

            Refresh();
        }
Beispiel #29
0
        public ScVxButton2()
        {
            SizeChanged += ScVxButton_SizeChanged;

            MouseEnter += BtnLayer_MouseEnter;
            MouseLeave += BtnLayer_MouseLeave;
            MouseDown  += BtnLayer_MouseDown;


            GDIPaint += ScVxButton_GDIPaint;


            mouseEnterAnim1 = new ScAnimation(this, 70, true);
            mouseEnterAnim1.AnimationEvent += ScAnim_AnimationEvent1;

            mouseEnterAnim = new ScAnimation(this, 600, true);
            mouseEnterAnim.AnimationEvent += ScAnim_AnimationEvent;
        }
Beispiel #30
0
        private void RowLayerAnim_AnimationEvent(ScAnimation scAnimation)
        {
            float v   = 0;
            float len = rowLayerAnimLinear.GetCurtValue();

            if (rowLayerAnimLinear.IsStop)
            {
                scAnimation.Stop();
            }

            for (int i = 0; i < controls.Count; i++)
            {
                ScLayer rowlayer = controls[i];
                v = len * i * animBaseSpaceScale + animPos;
                rowlayer.Location = new PointF(v, rowlayer.Location.Y);
            }

            Refresh();
        }