本文整理汇总了C#中Gtk.MotionNotifyEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# MotionNotifyEventArgs类的具体用法?C# MotionNotifyEventArgs怎么用?C# MotionNotifyEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MotionNotifyEventArgs类属于Gtk命名空间,在下文中一共展示了MotionNotifyEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleWidgetMotionNotifyEvent
private void HandleWidgetMotionNotifyEvent (object o, MotionNotifyEventArgs args)
{
X = args.Event.XRoot;
Y = args.Event.YRoot;
if (MotionNotifyEvent != null) {
MotionNotifyEvent (this, new MouseButtonEventArgs ());
}
}
示例2: MotionNotifyEventHandler
void MotionNotifyEventHandler (object o, MotionNotifyEventArgs args)
{
if (!is_dragging)
return;
int x, y;
GetPointer (out x, out y);
Selected = HitTest (y);
}
示例3: ProcessMotionEvent
public void ProcessMotionEvent(MotionNotifyEventArgs args)
{
if (swiping) {
swipeTest = new Point((int) args.Event.X, (int) args.Event.Y);
// Swipe must be horizontal or vertical
if ((swipeTest.X - swipeStart.X > maxError || swipeTest.X - swipeStart.X < -maxError) && (swipeTest.Y - swipeStart.Y > maxError || swipeTest.Y - swipeStart.Y < -maxError)) {
swiping = false;
}
}
}
示例4: HandleMotionNotifyEvent
void HandleMotionNotifyEvent(object o, MotionNotifyEventArgs args)
{
decorator.Clean();
var doc = IdeApp.Workbench.ActiveDocument;
if (doc == null || !IsCtrlPush(args.Event.State))
return;
decorator.Draw(doc, args.Event.X, args.Event.Y);
}
示例5: OnMouseMove
protected override void OnMouseMove(object o, MotionNotifyEventArgs args, Cairo.PointD point)
{
if (!is_drawing)
return;
double x = Utility.Clamp (point.X, 0, PintaCore.Workspace.ImageSize.Width - 1);
double y = Utility.Clamp (point.Y, 0, PintaCore.Workspace.ImageSize.Height - 1);
PintaCore.Layers.ShowSelection = true;
Rectangle dirty = DrawShape (PointsToRectangle (shape_origin, new PointD (x, y), (args.Event.State & Gdk.ModifierType.ShiftMask) == Gdk.ModifierType.ShiftMask), PintaCore.Layers.SelectionLayer);
PintaCore.Workspace.Invalidate ();
last_dirty = dirty;
}
示例6: onDAMotionNotify
protected void onDAMotionNotify(object o, MotionNotifyEventArgs args)
{
if (circuit == null)
return;
if (selectedTool == ToolType.LINK_CHK) {
circuit.linkCheck(args.Event.X, args.Event.Y);
}
if (selectedTool == ToolType.DEL_M || selectedTool == ToolType.DEL_S) {
clickCell(args.Event.X, args.Event.Y);
}
if (!linkingCells)
return;
switch (mouseButton) {
case 1: // bouton 1
switch (selectedTool) {
case ToolType.SILICON_N:
if (linkingCells)
clickCell(args.Event.X, args.Event.Y);
break;
case ToolType.SILICON_P:
if (linkingCells)
clickCell(args.Event.X, args.Event.Y);
break;
case ToolType.METAL:
if (linkingCells)
clickCell(args.Event.X, args.Event.Y);
break;
}
break;
}
}
示例7: HandleMotionNotifyEvent
void HandleMotionNotifyEvent (object sender, MotionNotifyEventArgs args)
{
var document = IdeApp.Workbench.ActiveDocument;
if (IdeApp.Workspace == null) return;
if (document == null) return;
if (document.ParsedDocument == null) return;
try
{
if (_marker != null)
{
RemoveMarker (document.Editor.Document);
}
if ((args.Event.State & ModifierType.ControlMask) == ModifierType.ControlMask)
{
DocumentLocation location = document.Editor.Parent.PointToLocation(args.Event.X - document.Editor.Parent.TextViewMargin.XOffset, args.Event.Y);
int offset = document.Editor.LocationToOffset(location);
int start = document.Editor.FindCurrentWordStart(offset);
int end = document.Editor.FindCurrentWordEnd(offset);
if (end - start <= 0) return;
_marker = new UnderlineTextSegmentMarker(document.Editor.ColorStyle.KeywordNamespace.Foreground, new TextSegment(start, end - start));
_marker.Wave = false;
_marker.IsVisible = true;
document.Editor.Document.AddMarker(_marker);
document.Editor.Parent.QueueDraw();
}
}
catch (Exception exception)
{
LoggingService.LogError(exception.ToString());
}
}
示例8: OnMouseMove
protected override void OnMouseMove(object o, MotionNotifyEventArgs args, Cairo.PointD point)
{
ctrlKey = (args.Event.State & ModifierType.ControlMask) != 0;
lastMousePosition = point.ToGdkPoint();
// If we're dragging the text around, do that
if (tracking)
{
Cairo.PointD delta = new Cairo.PointD(point.X - startMouseXY.X, point.Y - startMouseXY.Y);
clickPoint = new Point((int)(startClickPoint.X + delta.X), (int)(startClickPoint.Y + delta.Y));
CurrentTextEngine.Origin = clickPoint;
RedrawText(true, true);
}
else
{
UpdateMouseCursor();
}
}
示例9: DrawMotionNotifyEvent
void DrawMotionNotifyEvent(object o, MotionNotifyEventArgs args)
{
if (this.Sensitive && MouseClick != null && _button != MouseButton.None) {
MouseClick (this, new MouseEventArgs ((int)args.Event.X, (int)args.Event.Y, _button));
}
}
示例10: DoMouseMove
public void DoMouseMove(object o, MotionNotifyEventArgs args, Cairo.PointD point)
{
OnMouseMove (o, args, point);
}
示例11: HandleMotionNotifyEvent
private void HandleMotionNotifyEvent(object sender, MotionNotifyEventArgs args)
{
if (!this.CanApplyMarker()) return;
this.RemoveMarker();
if ((args.Event.State & ModifierType.Mod1Mask) == ModifierType.Mod1Mask)
{
var document = IdeApp.Workbench.ActiveDocument;
var location = document.Editor.Parent.PointToLocation(args.Event.X - document.Editor.Parent.TextViewMargin.XOffset, args.Event.Y);
int offset = document.Editor.LocationToOffset(location);
int start = document.Editor.FindCurrentWordStart(offset);
int end = document.Editor.FindCurrentWordEnd(offset);
if (end - start <= 0) return;
var element = this.GetCurrentElement(document, offset);
if (element != null)
{
this.PlaceMarker(document, start, end);
}
else
{
var variable = this.GetCurrentVariable(document, offset);
if (variable != null)
{
this.PlaceMarker(document, start, end);
}
}
}
}
示例12: OnMotionNotify
void OnMotionNotify(object o, MotionNotifyEventArgs args)
{
OnMove((o as Preview).GetXY(args));
}
示例13: HandleMotionNotifyEvent
void HandleMotionNotifyEvent(object o, MotionNotifyEventArgs args)
{
TreeIter iter;
if (!elementsTreeview.Selection.GetSelected (out iter))
return;
Gdk.Rectangle rect = elementsTreeview.GetCellArea (elementsStore.GetPath (iter), elementsTreeview.GetColumn (0));
int x, y;
this.GdkWindow.GetOrigin (out x, out y);
x += rect.X;
y += rect.Y;
if (this.tooltipWindow == null || ox != x || oy != y) {
ShowTooltipForSelectedEntry ();
ox = x;
oy = y;
}
}
示例14: OnEventVolumeMotionNotifyEvent
protected void OnEventVolumeMotionNotifyEvent(object o, MotionNotifyEventArgs args)
{
int width;
int height;
drawVolume.GdkWindow.GetSize(out width, out height);
int x = (int) args.Event.X;
int startInside = 36;
int endInside = width - 36;
if (x < startInside) {
Percentage = 0;
} else if (x > endInside) {
Percentage = 100;
} else {
Percentage = (x - startInside) * 100 / (endInside - startInside);
}
QueueDraw();
}
示例15: HandleImageViewMotion
void HandleImageViewMotion(object sender, MotionNotifyEventArgs args)
{
Gdk.Point coords;
coords = new Gdk.Point ((int) args.Event.X, (int) args.Event.Y);
SetSamplePoint (view.WindowCoordsToImage (coords));
}