예제 #1
0
 public static OxyMouseEventArgs ToMouseEventArgs(this NSEvent theEvent, PlotView view)
 {
     return(new OxyMouseEventArgs
     {
         Position = theEvent.PositionAsScreenPointRelativeToPlotView(view),
         ModifierKeys = theEvent.ModifierFlags.ToModifierKeys(),
     });
 }
예제 #2
0
 /// <summary>
 /// Converts a <see cref="NSEvent" /> to a <see cref="OxyMouseWheelEventArgs" />.
 /// </summary>
 /// <param name="theEvent">The event to convert.</param>
 /// <param name="bounds">The bounds of the window.</param>
 /// <returns>The converted event arguments.</returns>
 public static OxyMouseWheelEventArgs ToMouseWheelEventArgs(this NSEvent theEvent, PlotView view)
 {
     return(new OxyMouseWheelEventArgs
     {
         Delta = (int)theEvent.ScrollingDeltaY,
         Position = theEvent.PositionAsScreenPointRelativeToPlotView(view),
         ModifierKeys = theEvent.ModifierFlags.ToModifierKeys(),
     });
 }
예제 #3
0
 public static OxyMouseDownEventArgs ToMouseDownEventArgs(this NSEvent theEvent, PlotView view)
 {
     // https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSEvent_Class/Reference/Reference.html
     return(new OxyMouseDownEventArgs
     {
         Position = theEvent.PositionAsScreenPointRelativeToPlotView(view),
         ChangedButton = theEvent.Type.ToButton(),
         ModifierKeys = theEvent.ModifierFlags.ToModifierKeys(),
         ClickCount = (int)theEvent.ClickCount,
     });
 }