当前位置: 首页>>代码示例>>C#>>正文


C# MouseEvent类代码示例

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


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

示例1: OnMouseClick

 public void OnMouseClick(MouseEvent m_event)
 {
     foreach (ParentComponent pc in this.componentList)
     {
         pc.RequestFocusAt(m_event.location);
     }
 }
开发者ID:Cur10s1ty,项目名称:RTS_XNA,代码行数:7,代码来源:ComponentManager.cs

示例2: MouseEventArgs

 public MouseEventArgs(int x, int y, int wheelDelta, MouseEvent mouseEvent)
 {
     X = x;
     Y = y;
     WheelDelta = wheelDelta;
     MouseEvent = mouseEvent;
 }
开发者ID:RoqueDeicide,项目名称:CryCIL,代码行数:7,代码来源:MouseEventArgs.cs

示例3: MouseEventArgs

 public MouseEventArgs(MouseButton button, Point old, Point @new, MouseEvent @event)
 {
     PressedButtons = button;
     OldPosition = old;
     NewPosition = @new;
     FiringEvent = @event;
 }
开发者ID:envy,项目名称:Huddy,代码行数:7,代码来源:MouseEventArgs.cs

示例4: Rectangle

        void MouseClickListener.OnMouseClick(MouseEvent me)
        {
            if (me.button == MouseEvent.MOUSE_BUTTON_3 && selected)
            {
                HUD h = HUD.GetInstance();
                MouseState ms = Mouse.GetState();

                if (h != null)
                {
                    if (h.draw)
                    {
                        Rectangle mr = new Rectangle(ms.X, ms.Y, 1, 1);

                        if (!h.DefineRectangle().Contains(mr))
                        {
                            this.setWaypoint(ms.X, ms.Y);
                        }
                    }
                }
                else
                {
                    this.setWaypoint(ms.X, ms.Y);
                }
            }
        }
开发者ID:R3coil,项目名称:RTS_XNA_v2,代码行数:25,代码来源:Engineer.cs

示例5: MouseDown

        public override void MouseDown(MouseEvent ev)
        {
            var view = ev.View;
            View = view;
            Gdk.EventType type = ev.GdkEvent.Type;

            SetAnchorCoords (ev.X, ev.Y);

            if (type != EventType.TwoButtonPress) {
                DefaultTool.MouseDown (ev);
                return;
            }

            // Split the line the mouse position
            var connection = (PolyLineFigure) Figure;
            connection.SplitSegment (ev.X, ev.Y);

            // Re-add the connector to the selection
            view.ClearSelection ();
            view.AddToSelection (Figure);

            // Change cursor for dragging
            handle = (PolyLineHandle) view.FindHandle (ev.X, ev.Y);
            ((Gtk.Widget) view).GdkWindow.Cursor = handle.CreateCursor ();
            handle.InvokeStart (ev.X, ev.Y, ev.View);

            // add new undo activity
            CreateUndoActivity();
        }
开发者ID:erbriones,项目名称:monodevelop-classdesigner,代码行数:29,代码来源:PolyLineFigureTool.cs

示例6: MouseUp

		public override void MouseUp (MouseEvent ev) {
			if (_handle != null) {
				_handle.InvokeEnd(ev);
				UpdateUndoActivity();
				PushUndoActivity();
			}
		}
开发者ID:jira-sarec,项目名称:ICSE-2012-TraceLab,代码行数:7,代码来源:PolyLineFigureTool.cs

示例7: MouseDown

        public override void MouseDown (MouseEvent ev) {
            base.MouseDown (ev);
            IDrawingView view = ev.View;
            
            if(IsRightButtonPressed (ev))
            {
                DelegateTool = new PanTool(Editor, CursorFactory.GetCursorFromType(Gdk.CursorType.Arrow));
            } 
            else
            {
                IHandle handle = view.FindHandle (ev.X, ev.Y);
                if (handle != null) {
                    DelegateTool = new HandleTracker (Editor, new UndoableHandle(handle));
                }
                else {
                    IFigure figure = view.Drawing.FindFigure (ev.X, ev.Y);
                    if (figure != null) {
                        DelegateTool = figure.CreateFigureTool (Editor, new DragTool (Editor, figure));
                    } else {
                        DelegateTool = new SelectAreaTool (Editor);
                    }
                }
            }

            if (DelegateTool != null) {
                DelegateTool.MouseDown (ev);
            }

        }
开发者ID:jira-sarec,项目名称:ICSE-2012-TraceLab,代码行数:29,代码来源:SelectionTool.cs

示例8: MouseDrag

		public override void MouseDrag (MouseEvent ev) {
			DrawSelectionRect ((Gtk.Widget) ev.View, ev.GdkEvent.Window);
			PointD anchor = new PointD (AnchorX, AnchorY);
			PointD corner = new PointD (ev.X, ev.Y);
			_selectionRect = new RectangleD (anchor, corner);
			DrawSelectionRect ((Gtk.Widget) ev.View, ev.GdkEvent.Window);
		}
开发者ID:jira-sarec,项目名称:ICSE-2012-TraceLab,代码行数:7,代码来源:SelectAreaTool.cs

示例9: HandleMouse

 public override bool HandleMouse(MouseEvent MouseEvent)
 {
     base.HandleMouse(MouseEvent);
     if (MouseEvent.LB)
     {
         SaveConfig();
         return true;
     }
     else if (MouseEvent.Wheel > 0 && CHelper.IsInBounds(_ScreenArea, MouseEvent))
     {
         if (SelectSlides[htSelectSlides(SelectSlideVolume)].Selection - MouseEvent.Wheel >= 0)
             SelectSlides[htSelectSlides(SelectSlideVolume)].SetSelectionByValueIndex(SelectSlides[htSelectSlides(SelectSlideVolume)].Selection - MouseEvent.Wheel);
         else if (SelectSlides[htSelectSlides(SelectSlideVolume)].Selection - MouseEvent.Wheel < 0)
             SelectSlides[htSelectSlides(SelectSlideVolume)].SetSelectionByValueIndex(0);
         SaveConfig();
         return true;
     }
     else if (MouseEvent.Wheel < 0 && CHelper.IsInBounds(_ScreenArea, MouseEvent))
     {
         if (SelectSlides[htSelectSlides(SelectSlideVolume)].Selection - MouseEvent.Wheel < SelectSlides[htSelectSlides(SelectSlideVolume)].NumValues)
             SelectSlides[htSelectSlides(SelectSlideVolume)].SetSelectionByValueIndex(SelectSlides[htSelectSlides(SelectSlideVolume)].Selection - MouseEvent.Wheel);
         else if (SelectSlides[htSelectSlides(SelectSlideVolume)].Selection - MouseEvent.Wheel >= SelectSlides[htSelectSlides(SelectSlideVolume)].NumValues)
             SelectSlides[htSelectSlides(SelectSlideVolume)].SetSelectionByValueIndex(SelectSlides[htSelectSlides(SelectSlideVolume)].NumValues - 1);
         SaveConfig();
         return true;
     }
     else if (MouseEvent.RB)
     {
         //CGraphics.HidePopup(EPopupScreens.PopupPlayerControl);
         return false;
     }
     return true;
 }
开发者ID:HansMaiser,项目名称:Vocaluxe,代码行数:33,代码来源:CPopupScreenVolumeControl.cs

示例10: HandleMouse

        public override bool HandleMouse(MouseEvent MouseEvent)
        {
            base.HandleMouse(MouseEvent);

            if (MouseEvent.LB && IsMouseOver(MouseEvent))
            {
                if (Buttons[htButtons(ButtonOptionsGame)].Selected)
                    CGraphics.FadeTo(EScreens.ScreenOptionsGame);

                if (Buttons[htButtons(ButtonOptionsSound)].Selected)
                    CGraphics.FadeTo(EScreens.ScreenOptionsSound);

                if (Buttons[htButtons(ButtonOptionsRecord)].Selected)
                    CGraphics.FadeTo(EScreens.ScreenOptionsRecord);

                if (Buttons[htButtons(ButtonOptionsVideo)].Selected)
                    CGraphics.FadeTo(EScreens.ScreenOptionsVideo);

                if (Buttons[htButtons(ButtonOptionsLyrics)].Selected)
                    CGraphics.FadeTo(EScreens.ScreenOptionsLyrics);

                if (Buttons[htButtons(ButtonOptionsTheme)].Selected)
                    CGraphics.FadeTo(EScreens.ScreenOptionsTheme);
            }

            if (MouseEvent.RB)
            {
                CGraphics.FadeTo(EScreens.ScreenMain);
            }
            return true;
        }
开发者ID:HansMaiser,项目名称:Vocaluxe,代码行数:31,代码来源:CScreenOptions.cs

示例11: MoveCardToTop

    private void MoveCardToTop(MouseEvent e)
    {
        var targetCard = (CinchSprite)e.Target;

        //adding something that has already been added will just float it to the top
        _cardsContainer.AddChild(targetCard);
    }
开发者ID:kyallbarrows,项目名称:Cinch_4-3,代码行数:7,代码来源:SpriteSheets.cs

示例12: OnHtmlInputEvent

 public override void OnHtmlInputEvent(string href, MouseEvent e)
 {
     if (e == MouseEvent.Click)
     {
         if (href.Substring(0, 6) == "skill=" || href.Substring(0, 9) == "skillbtn=")
         {
             int skillIndex;
             if (!int.TryParse(href.Substring(href.IndexOf('=') + 1), out skillIndex))
                 return;
             m_World.Interaction.UseSkill(skillIndex);
         }
         else if (href.Substring(0, 10) == "skilllock=")
         {
             int skillIndex;
             if (!int.TryParse(href.Substring(10), out skillIndex))
                 return;
             m_World.Interaction.ChangeSkillLock(PlayerState.Skills.SkillEntryByIndex(skillIndex));
         }
     }
     else if (e == MouseEvent.DragBegin)
     {
         if (href.Length >= 9 && href.Substring(0, 9) == "skillbtn=")
         {
             int skillIndex;
             if (!int.TryParse(href.Substring(9), out skillIndex))
                 return;
             SkillEntry skill = PlayerState.Skills.SkillEntryByIndex(skillIndex);
             InputManager input = ServiceRegistry.GetService<InputManager>();
             UseSkillButtonGump gump = new UseSkillButtonGump(skill);
             UserInterface.AddControl(gump, input.MousePosition.X - 60, input.MousePosition.Y - 20);
             UserInterface.AttemptDragControl(gump, input.MousePosition, true);
         }
     }
 }
开发者ID:HankTheDrunk,项目名称:UltimaXNA,代码行数:34,代码来源:SkillsGump.cs

示例13: Show

        public void Show(MouseEvent evt, params object[] objects)
        {
            var ui = InvertApplication.Container.Resolve<ContextMenuUI>();
            Signal<IContextMenuQuery>(_ => _.QueryContextMenu(ui, evt, objects));

            ui.Go();
        }
开发者ID:InvertGames,项目名称:uFrame.Editor,代码行数:7,代码来源:ContextMenus.cs

示例14: Update

    public void Update()
    {
        // Determine the current mouse state.
        var currentMouseState = new MouseButtonState();

        // Project the screen location of the mouse to world coordinates
        var mouseEvent = new MouseEvent();
        var mousePosition2d = new Vector2(Input.mousePosition.x, Input.mousePosition.y);
        mouseEvent.GlobalCoordinates = ScreenToGlobal(mousePosition2d);
        mouseEvent.ScreenCoordinates = mousePosition2d;

        for(int ii = 0; ii < 3; ii++)
        {
            var curButtonState = currentMouseState.Buttons[ii];

            if (previousMouseState != null)
            {
                var prevButtonState = this.previousMouseState.Buttons[ii];
                mouseEvent.MouseButton = (MouseButton)ii;

                if (curButtonState == ButtonState.Pressed && prevButtonState == ButtonState.Released)
                {
                    this.mouseHandler.MousePressed(mouseEvent);
                }

                if (curButtonState == ButtonState.Released && prevButtonState == ButtonState.Pressed)
                {
                    this.mouseHandler.MouseReleased(mouseEvent);
                    this.mouseHandler.MouseClicked(mouseEvent);
                }
            }
        }

        previousMouseState = currentMouseState;
    }
开发者ID:HaKDMoDz,项目名称:awayteam,代码行数:35,代码来源:MouseManager.cs

示例15: MouseDown

        public override void MouseDown(MouseEvent ev)
        {
            IDrawingView view = ev.View;
            SetAnchorCoords (ev.X, ev.Y);
            View = view;

            Gdk.EventType type = ev.GdkEvent.Type;
            if (type == EventType.TwoButtonPress) {
                CreateUndoActivity();
                _showingWidget = true;
                _textview.Buffer.Text = ((MultiLineTextFigure)Figure).Text;

                View.AddWidget(_textview, 0, 0);
                CalculateTextViewSize();

                _textview.Show();
                _textview.GrabFocus();

                //selects all
                _textview.Buffer.SelectRange(_textview.Buffer.StartIter, _textview.Buffer.EndIter);

                return;
            }
            DefaultTool.MouseDown (ev);
        }
开发者ID:mono,项目名称:monohotdraw,代码行数:25,代码来源:MultiLineTextTool.cs


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