• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ScrollDirection类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ScrollDirection的典型用法代码示例。如果您正苦于以下问题:C# ScrollDirection类的具体用法?C# ScrollDirection怎么用?C# ScrollDirection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ScrollDirection类属于命名空间,在下文中一共展示了ScrollDirection类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: MouseScrolledEventArgs

		public MouseScrolledEventArgs (long timestamp, double x, double y, ScrollDirection direction)
		{
			X = x;
			Y = y;
			Timestamp  = timestamp;
			Direction = direction;
		}
开发者ID:StEvUgnIn,项目名称:xwt,代码行数:7,代码来源:MouseScrolledEventArgs.cs


示例2: LScrollView

 public LScrollView()
 {
     direction = ScrollDirection.BOTH;
     lastMovePoint = Vector2.zero;
     bounceable = true;
     scrollDistance = Vector2.zero;
     dragable = true;
     maxOffset = Vector2.zero;
     minOffset = Vector2.zero;
 }
开发者ID:NickYang,项目名称:uLui,代码行数:10,代码来源:LScrollView.cs


示例3: HandleKeyPress

 public override bool HandleKeyPress(KeyInput e)
 {
     switch (e.KeyName)
     {
         case "up": Keyboard = Keyboard.Set(ScrollDirection.Up, (e.Event == KeyInputEvent.Down)); return true;
         case "down": Keyboard = Keyboard.Set(ScrollDirection.Down, (e.Event == KeyInputEvent.Down)); return true;
         case "left": Keyboard = Keyboard.Set(ScrollDirection.Left, (e.Event == KeyInputEvent.Down)); return true;
         case "right": Keyboard = Keyboard.Set(ScrollDirection.Right, (e.Event == KeyInputEvent.Down)); return true;
     }
     return false;
 }
开发者ID:maruchinu,项目名称:OpenRA,代码行数:11,代码来源:ViewportScrollControllerWidget.cs


示例4: GetScrollCursor

        public static string GetScrollCursor(Widget w, ScrollDirection edge, int2 pos)
        {
            if (!Game.Settings.Game.ViewportEdgeScroll || Ui.MouseOverWidget != w)
                return null;

            var blockedDirections = Game.viewport.GetBlockedDirections();

            foreach (var dir in directions)
                if (edge.Includes(dir.Key))
                    return dir.Value + (blockedDirections.Includes(dir.Key) ? "-blocked" : "");

            return null;
        }
开发者ID:nevelis,项目名称:OpenRA,代码行数:13,代码来源:ViewportScrollControllerWidget.cs


示例5: ConvertScrollDirection

 public static Gdk.ScrollDirection ConvertScrollDirection(ScrollDirection d)
 {
     switch (d) {
     case ScrollDirection.Up:
         return Gdk.ScrollDirection.Up;
     case ScrollDirection.Down:
         return Gdk.ScrollDirection.Down;
     case ScrollDirection.Left:
         return Gdk.ScrollDirection.Left;
     case ScrollDirection.Right:
         return Gdk.ScrollDirection.Right;
     }
     throw new InvalidOperationException("Invalid mouse scroll direction value: " + d);
 }
开发者ID:pabloescribano,项目名称:xwt,代码行数:14,代码来源:Util.cs


示例6: OnPointChanged

        private void OnPointChanged() {
            if (_scrolledDirection != ScrollDirection.None
                && PointChanged != null) {

                if (_scrolledDirection.HasFlag(ScrollDirection.Horizontal)) {
                    EnsureXPositions();
                }
                if (_scrolledDirection.HasFlag(ScrollDirection.Vertical)) {
                    EnsureYPositions();
                }

                PointChanged(this, new PointChangedEventArgs(_scrolledDirection));
            }

            _scrolledDirection = ScrollDirection.None;
        }
开发者ID:Microsoft,项目名称:RTVS,代码行数:16,代码来源:GridPoints.cs


示例7: OnScrolled

		protected override void OnScrolled (ScrollDirection direction, ModifierType mod)
		{
			if ((mod & ModifierType.ShiftMask) != ModifierType.ShiftMask)
				return;
			
			int shift = HueShift;
			
			if (direction == Gdk.ScrollDirection.Up)
				shift += 5;
			else if (direction == Gdk.ScrollDirection.Down)
				shift -= 5;
			
			if (shift < 0)
				shift += 360;
			shift %= 360;
			
			HueShift = shift;
		}
开发者ID:Aurora-and-Equinox,项目名称:docky,代码行数:18,代码来源:ColoredIconDockItem.cs


示例8: Tick

        public override void Tick()
        {
            edgeDirections = ScrollDirection.None;
            if (Game.Settings.Game.ViewportEdgeScroll && Game.HasInputFocus)
                edgeDirections = CheckForDirections();

            if (keyboardDirections != ScrollDirection.None || edgeDirections != ScrollDirection.None)
            {
                var scroll = float2.Zero;

                foreach (var kv in ScrollOffsets)
                    if (keyboardDirections.Includes(kv.Key) || edgeDirections.Includes(kv.Key))
                        scroll += kv.Value;

                var length = Math.Max(1, scroll.Length);
                scroll *= (1f / length) * Game.Settings.Game.ViewportEdgeScrollStep;

                worldRenderer.Viewport.Scroll(scroll, false);
            }
        }
开发者ID:CH4Code,项目名称:OpenRA,代码行数:20,代码来源:ViewportControllerWidget.cs


示例9: YieldKeyboardFocus

 public override bool YieldKeyboardFocus()
 {
     keyboardDirections = ScrollDirection.None;
     return base.YieldKeyboardFocus();
 }
开发者ID:CH4Code,项目名称:OpenRA,代码行数:5,代码来源:ViewportControllerWidget.cs


示例10: ScrollProgrammatically

 /// <summary>
 /// Does the programmatic scrolling for this element.
 /// </summary>
 /// <param name="scrollDirection">The direction to scroll.</param>
 /// <param name="scrollAmount">The amount to scroll.</param>
 /// <seealso cref="InitializeProgrammaticScroll"/>
 public override void ScrollProgrammatically(ScrollDirection scrollDirection, ScrollAmount scrollAmount)
 {
     // Should never get called because InitializeProgrammaticScroll() returns false.
     throw new NotSupportedException();
 }
开发者ID:k3foru,项目名称:excel,代码行数:11,代码来源:ExcelElement.cs


示例11: HandleKeyPress

        public override bool HandleKeyPress(KeyInput e)
        {
            var key = Hotkey.FromKeyInput(e);
            var ks = Game.Settings.Keys;

            if (key == ks.MapScrollUp)
            {
                keyboardDirections = keyboardDirections.Set(ScrollDirection.Up, e.Event == KeyInputEvent.Down);
                return true;
            }

            if (key == ks.MapScrollDown)
            {
                keyboardDirections = keyboardDirections.Set(ScrollDirection.Down, e.Event == KeyInputEvent.Down);
                return true;
            }

            if (key == ks.MapScrollLeft)
            {
                keyboardDirections = keyboardDirections.Set(ScrollDirection.Left, e.Event == KeyInputEvent.Down);
                return true;
            }

            if (key == ks.MapScrollRight)
            {
                keyboardDirections = keyboardDirections.Set(ScrollDirection.Right, e.Event == KeyInputEvent.Down);
                return true;
            }

            return false;
        }
开发者ID:CH4Code,项目名称:OpenRA,代码行数:31,代码来源:ViewportControllerWidget.cs


示例12: Tick

        public override void Tick(World world)
        {
            Edge = ScrollDirection.None;
            if (Game.Settings.Game.ViewportEdgeScroll && Game.HasInputFocus)
            {
                // Check for edge-scroll
                if (Viewport.LastMousePos.X < EdgeScrollThreshold)
                    Edge = Edge.Set(ScrollDirection.Left, true);
                if (Viewport.LastMousePos.Y < EdgeScrollThreshold)
                    Edge = Edge.Set(ScrollDirection.Up, true);
                if (Viewport.LastMousePos.X >= Game.viewport.Width - EdgeScrollThreshold)
                    Edge = Edge.Set(ScrollDirection.Right, true);
                if (Viewport.LastMousePos.Y >= Game.viewport.Height - EdgeScrollThreshold)
                    Edge = Edge.Set(ScrollDirection.Down, true);
            }

            if(Keyboard != ScrollDirection.None || Edge != ScrollDirection.None)
            {
                var scroll = new float2(0, 0);

                // Modified to use the ViewportEdgeScrollStep setting - Gecko
                if (Keyboard.Includes(ScrollDirection.Up) || Edge.Includes(ScrollDirection.Up))
                    scroll += new float2(0, -(Game.Settings.Game.ViewportEdgeScrollStep * 100));
                if (Keyboard.Includes(ScrollDirection.Right) || Edge.Includes(ScrollDirection.Right))
                    scroll += new float2((Game.Settings.Game.ViewportEdgeScrollStep * 100), 0);
                if (Keyboard.Includes(ScrollDirection.Down) || Edge.Includes(ScrollDirection.Down))
                    scroll += new float2(0, (Game.Settings.Game.ViewportEdgeScrollStep * 100));
                if (Keyboard.Includes(ScrollDirection.Left) || Edge.Includes(ScrollDirection.Left))
                    scroll += new float2(-(Game.Settings.Game.ViewportEdgeScrollStep * 100), 0);

                Game.viewport.Scroll(scroll);
            }
        }
开发者ID:subspace,项目名称:OpenRA,代码行数:33,代码来源:ViewportScrollControllerWidget.cs


示例13: GetScrolledPercentage

 /// <summary>
 /// Gets the amount scrolled in percentage.
 /// </summary>
 /// <param name="srollDirection">The direction for which data is required.</param>
 /// <param name="scrollElement">The element which is either the vertical or horizontal scroll bar.</param>
 /// <returns>The amount in percentage.</returns>
 /// <seealso cref="InitializeProgrammaticScroll"/>
 public override int GetScrolledPercentage(ScrollDirection scrollDirection, IUITechnologyElement scrollElement)
 {
     // Should never get called because InitializeProgrammaticScroll() returns false.
     throw new NotSupportedException();
 }
开发者ID:k3foru,项目名称:excel,代码行数:12,代码来源:ExcelElement.cs


示例14: VerifyNotSame

        /// -------------------------------------------------------------------
        /// <summary>Changes the position to a new random position if the two are the same</summary>
        /// -------------------------------------------------------------------
        private void VerifyNotSame(ref double positionToChange, string positionToChangeStr, double otherPosition, string otherPositionStr, ArrayList validPositions, ScrollDirection scrollDirection, double min, double max, RandomBoundaries boundaries, CheckType checkType)
        {
            if (positionToChange.Equals(otherPosition))  
            {
                if (validPositions.Count < 4)
                    ThrowMe(CheckType.IncorrectElementConfiguration, validPositions.Count.ToString() + " valid scroll positions, not enough for test (4 minimum). Is your display resolution set too low?");

                for (int i = 0; i < 10 && (positionToChange.Equals(otherPosition)); i++)
                {
                    Comment("\"{0}\"({1}) and \"{2}\"({3}) were found to be the same. Find a new \"{0}\"", positionToChange, positionToChangeStr, otherPosition, otherPositionStr);

                    // false says don't incremenet m_TestStep TSC_RandomPosition
                    positionToChange = TSC_RandomPosition(scrollDirection, min, max, boundaries, false, checkType);
                }
                if (positionToChange.Equals(otherPosition))
                    ThrowMe(CheckType.Verification, "Cannot find a random \"{0}\" position", positionToChangeStr);

                Comment("Found new \"{0}\" position : {1}", positionToChangeStr, positionToChange);
            }
        }
开发者ID:geeksree,项目名称:cSharpGeeks,代码行数:23,代码来源:ScrollTests.cs


示例15: Tick

        public override void Tick()
        {
            Edge = ScrollDirection.None;
            if (Game.Settings.Game.ViewportEdgeScroll && Game.HasInputFocus && Widget.MouseOverWidget == this)
            {
                // Check for edge-scroll
                if (Viewport.LastMousePos.X < EdgeScrollThreshold)
                    Edge = Edge.Set(ScrollDirection.Left, true);
                if (Viewport.LastMousePos.Y < EdgeScrollThreshold)
                    Edge = Edge.Set(ScrollDirection.Up, true);
                if (Viewport.LastMousePos.X >= Game.viewport.Width - EdgeScrollThreshold)
                    Edge = Edge.Set(ScrollDirection.Right, true);
                if (Viewport.LastMousePos.Y >= Game.viewport.Height - EdgeScrollThreshold)
                    Edge = Edge.Set(ScrollDirection.Down, true);
            }

            if(Keyboard != ScrollDirection.None || Edge != ScrollDirection.None)
            {
                var scroll = new float2(0, 0);

                // Modified to use the ViewportEdgeScrollStep setting - Gecko
                if (Keyboard.Includes(ScrollDirection.Up) || Edge.Includes(ScrollDirection.Up))
                    scroll += new float2(0, -1);
                if (Keyboard.Includes(ScrollDirection.Right) || Edge.Includes(ScrollDirection.Right))
                    scroll += new float2(1, 0);
                if (Keyboard.Includes(ScrollDirection.Down) || Edge.Includes(ScrollDirection.Down))
                    scroll += new float2(0, 1);
                if (Keyboard.Includes(ScrollDirection.Left) || Edge.Includes(ScrollDirection.Left))
                    scroll += new float2(-1, 0);

                float length = Math.Max(1, scroll.Length);
                scroll.X = (scroll.X / length) * Game.Settings.Game.ViewportEdgeScrollStep;
                scroll.Y = (scroll.Y / length) * Game.Settings.Game.ViewportEdgeScrollStep;

                Game.viewport.Scroll(scroll);
            }

            base.Tick();
        }
开发者ID:hoxworth,项目名称:OpenRA,代码行数:39,代码来源:CncWorldInteractionControllerWidget.cs


示例16: ScrollPageHorizontal

        private static void ScrollPageHorizontal(ScrollViewer scrollViewer, ScrollDirection direction)
        {
            if (scrollViewer == null || direction == ScrollDirection.None)
            {
                return;
            }

            double actualWidth = scrollViewer.ActualWidth;
            double currentOffset = scrollViewer.HorizontalOffset;
            double newWidth = 0;

            if (direction == ScrollDirection.Left)
            {
                newWidth = currentOffset - actualWidth;
            }
            else if (direction == ScrollDirection.Right)
            {
                newWidth = currentOffset + actualWidth;
            }

            if (newWidth > scrollViewer.ExtentWidth)
            {
                newWidth = currentOffset;
            }

            if (newWidth < 0)
            {
                newWidth = 0;
            }

            scrollViewer.ChangeView(newWidth, null, null);
        }
开发者ID:ali-hk,项目名称:Toolkit,代码行数:32,代码来源:PagedScrollAction.cs


示例17: LoseFocus

 public override bool LoseFocus(MouseInput mi)
 {
     Keyboard = ScrollDirection.None;
     return base.LoseFocus(mi);
 }
开发者ID:nevelis,项目名称:OpenRA,代码行数:5,代码来源:ViewportScrollControllerWidget.cs


示例18: ScrollPageVertical

        private static void ScrollPageVertical(ScrollViewer scrollViewer, ScrollDirection direction)
        {
            if (scrollViewer == null || direction == ScrollDirection.None)
            {
                return;
            }

            double actualHeight = scrollViewer.ActualHeight;
            double currentOffset = scrollViewer.VerticalOffset;
            double newHeight = 0;

            if (direction == ScrollDirection.Up)
            {
                newHeight = currentOffset - actualHeight;
            }
            else if (direction == ScrollDirection.Down)
            {
                newHeight = currentOffset + actualHeight;
            }

            if (newHeight > scrollViewer.ExtentHeight)
            {
                newHeight = currentOffset;
            }

            if (newHeight < 0)
            {
                newHeight = 0;
            }

            scrollViewer.ChangeView(null, newHeight, null);
        }
开发者ID:ali-hk,项目名称:Toolkit,代码行数:32,代码来源:PagedScrollAction.cs


示例19: OnOffsetChanged

 private void OnOffsetChanged(ScrollDirection direction, int firstRow)
 {
     ScrollReceiver?.ScrollChanged(new ScrollChangedArgs(direction, firstRow));
 }
开发者ID:ckarcz,项目名称:TailBlazer,代码行数:4,代码来源:LinesScrollPanel.cs


示例20: GetWheelDelta

		static double GetWheelDelta (Adjustment adjustment, ScrollDirection direction)
		{
			double delta = adjustment.StepIncrement * 4;
			if (direction == ScrollDirection.Up || direction == ScrollDirection.Left)
				delta = -delta;
			return delta;
		}
开发者ID:Shanto,项目名称:monodevelop,代码行数:7,代码来源:EditorCompareWidgetBase.cs



注:本文中的ScrollDirection类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# SculptType类代码示例发布时间:2022-05-24
下一篇:
C# Scriptable类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap