本文整理汇总了C#中Gdk.EventButton类的典型用法代码示例。如果您正苦于以下问题:C# EventButton类的具体用法?C# EventButton怎么用?C# EventButton使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EventButton类属于Gdk命名空间,在下文中一共展示了EventButton类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnButtonReleaseEvent
protected override bool OnButtonReleaseEvent (EventButton evnt)
{
if (click && hovered)
OnClicked (EventArgs.Empty);
click = false;
return base.OnButtonReleaseEvent (evnt);
}
示例2: OnWidgetEvent
protected override bool OnWidgetEvent (Gdk.Event evnt)
{
// This method is hooked to block the event as soon as possible if required
if(evnt.Window.Equals (this.GdkWindow))
{
switch(evnt.Type)
{
case Gdk.EventType.ButtonPress:
case Gdk.EventType.ButtonRelease:
case Gdk.EventType.ThreeButtonPress:
case Gdk.EventType.TwoButtonPress:
Gdk.EventButton eb = new Gdk.EventButton (evnt.Handle);
return PropagateEventGivenCoordinate (evnt, eb.X, eb.XRoot, eb.Y, eb.YRoot);
case Gdk.EventType.MotionNotify:
Gdk.EventMotion em = new Gdk.EventMotion (evnt.Handle);
return PropagateEventGivenCoordinate (evnt, em.X, em.XRoot, em.Y, em.YRoot);
case Gdk.EventType.LeaveNotify:
foreach(Widget w in lastHoveredWidgets)
{
w.ProcessEvent (evnt);
}
lastHoveredWidgets.Clear();
return base.OnWidgetEvent (evnt);
}
}
return base.OnWidgetEvent (evnt);
}
示例3: OnCanvasEvent
private void OnCanvasEvent(object obj, CanvasEventArgs args)
{
EventButton ev = new EventButton (args.Event.Handle);
switch (ev.Type)
{
case EventType.ButtonPress:
if (ev.Button == 1)
{
holding= true;
firstCell = taskArea.GetCellAt (ev.X, ev.Y);
StartDrawing (ev);
}
break;
case EventType.MotionNotify:
if (holding && stask != null)
{
curCell = taskArea.GetCellAt (ev.X, ev.Y);
stask.Y2 = ev.Y;
}
break;
case EventType.ButtonRelease:
holding = false;
double rounded = RoundDownTask (ev.Y);
stask.Y2 = rounded;
PointToTime (firstCell, curCell, stask.Task, firstX, firstY, ev.X, rounded);
break;
default:
break;
}
}
示例4: OnButtonPressEvent
protected override bool OnButtonPressEvent(EventButton evnt)
{
TreePath[] paths = Selection.GetSelectedRows();
if((evnt.Type == EventType.ButtonPress) && (evnt.Button == 3))
{
// We don't want to unselect the play when several
// plays are selected and we clik the right button
// For multiedition
if(paths.Length <= 1) {
base.OnButtonPressEvent(evnt);
paths = Selection.GetSelectedRows();
}
if(paths.Length == 1) {
TimeNode selectedTimeNode = GetValueFromPath(paths[0]) as TimeNode;
if(selectedTimeNode is Play) {
deleteKeyFrame.Sensitive = (selectedTimeNode as Play).HasDrawings;
MultiSelectMenu(false);
menu.Popup();
} else {
playersMenu.Popup();
}
}
else if(paths.Length > 1) {
MultiSelectMenu(true);
menu.Popup();
}
}
else
base.OnButtonPressEvent(evnt);
return true;
}
示例5: OnButtonPressEvent
protected override bool OnButtonPressEvent(EventButton evnt)
{
Console.WriteLine("Button pressed");
if (evnt.Button == 1)
{
_dragStartTime = evnt.Time;
GetPathAtPos((int) evnt.X, (int) evnt.Y, out _dragStartPath);
}
return base.OnButtonPressEvent(evnt);
}
示例6: OnPanButtonReleaseEvent
bool OnPanButtonReleaseEvent(EventButton evnt)
{
if (evnt.Button != 2) {
// Restrict to middle mouse button.
return false;
}
System.Diagnostics.Debug.Assert (InPanMotion);
InPanMotion = false;
// Reset cursor
GdkWindow.Cursor = null;
return true;
}
示例7: OnButtonPressEvent
protected override bool OnButtonPressEvent(EventButton args)
{
base.GrabFocus ();
if (args.Button != 3)
return false;
Point grid = WindowCoordsToGridPoint ( (int) args.X, (int) args.Y);
if (map.GetGridInformation (grid) == GridInformation.Invalid)
return false;
highlight_grid = grid;
UIActions.Instance.WorldViewContextMenu.Popup ();
return true;
}
示例8: OnButtonPressEvent
protected override bool OnButtonPressEvent(EventButton evnt)
{
if((evnt.Type == EventType.ButtonPress) && (evnt.Button == 3))
{
TreePath path;
GetPathAtPos((int)evnt.X,(int)evnt.Y,out path);
if(path!=null) {
Model.GetIter(out selectedIter,path);
selectedSubcat = (ISubCategory) Model.GetValue(selectedIter, 0);
edit.Sensitive = selectedSubcat is TagSubCategory;
menu.Popup();
}
}
return base.OnButtonPressEvent(evnt);
}
示例9: OnPanButtonPressEvent
bool OnPanButtonPressEvent(EventButton evnt)
{
if (evnt.Button != 2) {
// Restrict to middle mouse button.
return false;
}
System.Diagnostics.Debug.Assert (!InPanMotion);
InPanMotion = true;
// Track starting point of panning movement.
pan_anchor.X = (int)evnt.X;
pan_anchor.Y = (int)evnt.Y;
// Set to crosshair pointer
GdkWindow.Cursor = new Cursor (CursorType.Fleur);
return true;
}
示例10: OnButtonPressEvent
protected override bool OnButtonPressEvent (EventButton ev)
{
if (surface == null)
return false;
switch (ev.Button) {
case 1:
DrawBrush (ev.X, ev.Y);
break;
case 3:
ClearSurface ();
QueueDraw ();
break;
default:
break;
}
return true;
}
示例11: OnButtonReleaseEvent
protected override bool OnButtonReleaseEvent(EventButton evnt)
{
if (evnt.Button == 1)
{
if (_dragStartTime > 0 && evnt.Time - _dragStartTime > 500)
{
TreePath endPath;
if (!GetPathAtPos((int) evnt.X, (int) evnt.Y, out endPath))
{
GetPathAtPos(1, 1, out endPath);
}
if (_dragStartPath.Compare(endPath) < 0)
Selection.SelectRange(_dragStartPath, endPath);
else
Selection.SelectRange(endPath, _dragStartPath);
}
_dragStartTime = 0;
Console.WriteLine("Button released {0}", _dragStartTime);
}
return base.OnButtonReleaseEvent(evnt);
}
示例12: OnButtonPressEvent
protected override bool OnButtonPressEvent (EventButton evnt)
{
foreach (HotSpot hp in hostSpots) {
if (hp.Rect.Contains ((int)evnt.X, (int)evnt.Y) && hp.Action != null) {
hp.Action ();
break;
}
}
return base.OnButtonPressEvent (evnt);
}
示例13: OnButtonReleaseEvent
protected override bool OnButtonReleaseEvent (EventButton evnt)
{
Close ();
return base.OnButtonReleaseEvent (evnt);
}
示例14: OnButtonReleaseEvent
protected override bool OnButtonReleaseEvent (EventButton evnt)
{
ClearGrab ();
UpdatePrelightState (evnt.X, evnt.Y);
return base.OnButtonReleaseEvent (evnt);
}
示例15: OnButtonReleaseEvent
protected override bool OnButtonReleaseEvent (EventButton e)
{
buttonPressed = false;
return base.OnButtonReleaseEvent (e);
}