本文整理汇总了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);
}
}
示例2: MouseEventArgs
public MouseEventArgs(int x, int y, int wheelDelta, MouseEvent mouseEvent)
{
X = x;
Y = y;
WheelDelta = wheelDelta;
MouseEvent = mouseEvent;
}
示例3: MouseEventArgs
public MouseEventArgs(MouseButton button, Point old, Point @new, MouseEvent @event)
{
PressedButtons = button;
OldPosition = old;
NewPosition = @new;
FiringEvent = @event;
}
示例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);
}
}
}
示例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();
}
示例6: MouseUp
public override void MouseUp (MouseEvent ev) {
if (_handle != null) {
_handle.InvokeEnd(ev);
UpdateUndoActivity();
PushUndoActivity();
}
}
示例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);
}
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
}
}
示例13: Show
public void Show(MouseEvent evt, params object[] objects)
{
var ui = InvertApplication.Container.Resolve<ContextMenuUI>();
Signal<IContextMenuQuery>(_ => _.QueryContextMenu(ui, evt, objects));
ui.Go();
}
示例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;
}
示例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);
}