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


C# Gdk.EventButton类代码示例

本文整理汇总了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);
		}
开发者ID:telebovich,项目名称:monodevelop,代码行数:7,代码来源:HoverCloseButton.cs

示例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);
		}
开发者ID:JianwenSun,项目名称:mono-soc-2007,代码行数:30,代码来源:SyntheticWindow.cs

示例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;
     }
 }
开发者ID:BackupTheBerlios,项目名称:mspace-svn,代码行数:30,代码来源:TimeTable.cs

示例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;
        }
开发者ID:dineshkummarc,项目名称:longomatch,代码行数:33,代码来源:PlayersTreeView.cs

示例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);
 }
开发者ID:gclark916,项目名称:Howler,代码行数:10,代码来源:TrackListView.cs

示例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;
        }
开发者ID:nathansamson,项目名称:F-Spot-Album-Exporter,代码行数:14,代码来源:ImageView_Panning.cs

示例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;
        }
开发者ID:manicolosi,项目名称:questar,代码行数:16,代码来源:WorldView.cs

示例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);
        }
开发者ID:dineshkummarc,项目名称:longomatch,代码行数:16,代码来源:SubCategoriesTreeView.cs

示例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;
        }
开发者ID:nathansamson,项目名称:F-Spot-Album-Exporter,代码行数:18,代码来源:ImageView_Panning.cs

示例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;
		}
开发者ID:liberostelios,项目名称:gtk-sharp,代码行数:18,代码来源:Scribble.cs

示例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);
        }
开发者ID:gclark916,项目名称:Howler,代码行数:22,代码来源:TrackListView.cs

示例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);
		}
开发者ID:llucenic,项目名称:monodevelop,代码行数:10,代码来源:TimeLineView.cs

示例13: OnButtonReleaseEvent

		protected override bool OnButtonReleaseEvent (EventButton evnt)
		{
			Close ();
			return base.OnButtonReleaseEvent (evnt);
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:5,代码来源:PlaceholderWindow.cs

示例14: OnButtonReleaseEvent

		protected override bool OnButtonReleaseEvent (EventButton evnt)
		{
			ClearGrab ();
			UpdatePrelightState (evnt.X, evnt.Y);
			return base.OnButtonReleaseEvent (evnt);
		}
开发者ID:GroM,项目名称:monodevelop,代码行数:6,代码来源:QuickTaskOverviewMode.cs

示例15: OnButtonReleaseEvent

		protected override bool OnButtonReleaseEvent (EventButton e)
		{
			buttonPressed = false;
			return base.OnButtonReleaseEvent (e);
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:5,代码来源:ListView.cs


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