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; }
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; }
public ScLinearAnimation(float startValue, float stopValue, ScAnimation scAnimation) { scAnim = scAnimation; this.startValue = startValue; this.stopValue = stopValue; n = (stopValue - startValue) / scAnim.AnimMS * scAnim.DurationMS; }
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; }
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(); }
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(); } }
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(); }
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; }
public ScProgressNodeAnim(ScLayer sclayer, RectangleF rect) { this.sclayer = sclayer; this.rect = rect; scaleAnim = new ScAnimation(sclayer, 50, true); scaleAnim.AnimationEvent += ScaleAnim_AnimationEvent; }
private void ProgressAnim_AnimationEvent(ScAnimation scAnimation) { downLeftScreenLocationX = leftScreen.Location.X; downRightScreenLocationX = rightScreen.Location.X + rightScreen.Width; Move(animStep); Refresh(); }
public ScTxtInfo(ScLayer sclayer) { type = 1; this.sclayer = sclayer; scaleAnim = new ScAnimation(sclayer, -1, true); scaleAnim.DurationMS = 30; scaleAnim.AnimationEvent += ScaleAnim_AnimationEvent; }
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; }
public ScVxDate() { GDIPaint += ScVxDate_GDIPaint; SizeChanged += ScVxDate_SizeChanged; dateAnim = new ScAnimation(this, true); dateAnim.DurationMS = 1000; dateAnim.AnimationEvent += DateAnim_AnimationEvent; }
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; }
private void ScAnim_AnimationEvent(ScAnimation scAnimation) { alpha = (int)linear.GetCurtValue(); if (linear.IsStop) { scAnimation.Stop(); } Refresh(); }
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(); }
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; }
private void ScAnim_AnimationEvent1(ScAnimation scAnimation) { growHeight = mouseEnterLinear1.GetCurtValue(); if (mouseEnterLinear1.IsStop) { mouseEnterAnim1.Stop(); StartProgressAnim(startColor, endColor); } Refresh(); }
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; }
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; }
private void ZoomAnim_AnimationEvent(ScAnimation scAnimation) { animZoom = zoomLinear.GetCurtValue(); ScaleX = animZoom; ScaleY = animZoom; if (zoomLinear.IsStop) { scAnimation.Stop(); } Refresh(); }
private void ScaleAnim_AnimationEvent(ScAnimation scAnimation) { animScaleValue = linear.GetCurtValue(); if (animScaleValue >= 1.0f) { StopScaleAnim(); } if (AnimScaleEvent != null) { AnimScaleEvent(); } }
private void VisibleAnim_AnimationEvent(ScAnimation scAnimation) { Opacity = opacityLinear.GetCurtValue(); if (opacityLinear.IsStop) { scAnimation.Stop(); if (Opacity == 0) { visible = false; } } Refresh(); }
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; }
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; }
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; }
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; }
private void ScAnim_AnimationEvent(ScAnimation scAnimation) { if (progressLinear == null) { return; } animProgress = progressLinear.GetCurtValue(); if (progressLinear.IsStop) { scAnimation.Stop(); progressLinear = null; StartProgressAnim(); } Refresh(); }
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; }
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(); }