• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Gdk.EventButton类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Gdk.EventButton的典型用法代码示例。如果您正苦于以下问题:C# EventButton类的具体用法?C# EventButton怎么用?C# EventButton使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



EventButton类属于Gdk命名空间,在下文中一共展示了EventButton类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: OnButtonReleaseEvent

 protected override bool OnButtonReleaseEvent(EventButton evnt)
 {
     if (State == StateType.Selected)
         OnClicked (EventArgs.Empty);
     State = IsInside (evnt.X, evnt.Y) ? StateType.Prelight : StateType.Normal;;
     hoverState = StateType.Prelight;
     return true;
 }
开发者ID:Kalnor,项目名称:monodevelop,代码行数:8,代码来源:RoundButton.cs


示例17: Item_Event

		void Item_Event (object obj, Gnome.CanvasEventArgs args) {
			EventButton ev = new EventButton (args.Event.Handle);
			CanvasRE item = (CanvasRE) obj;

			switch (ev.Type) {
			case EventType.ButtonPress:
				if (ev.Button == 1) {
					remember_x = ev.X;
					remember_y = ev.Y;
					args.RetVal = true;
					return;
				} else if (ev.Button == 3) {
					item.Destroy ();
					args.RetVal = true;
					return;
				}
				break;
			case EventType.TwoButtonPress:
				ChangeItemColor (item);
				args.RetVal = true;
				return;
			case EventType.MotionNotify:
				Gdk.ModifierType state = (Gdk.ModifierType) ev.State;
				if ((state & Gdk.ModifierType.Button1Mask) != 0) {
					double new_x = ev.X, new_y = ev.Y;
					item.Move (new_x - remember_x, new_y - remember_y);
					remember_x = new_x;
					remember_y = new_y;
					args.RetVal = true;
					return;
				}
				break;
			case EventType.EnterNotify:
				item.WidthUnits = 3.0;
				args.RetVal = true;
				return;
			case EventType.LeaveNotify:
				item.WidthUnits = 1.0;
				args.RetVal = true;
				return;
			}

			args.RetVal = false;
			return;
		}
开发者ID:directhex,项目名称:xamarin-gnome-sharp2,代码行数:45,代码来源:CanvasExample.cs


示例18: OnButtonPressEvent

		protected override bool OnButtonPressEvent (EventButton evnt)
		{
			if (evnt.Button == 1 && hovered) 
				click = true;
			return base.OnButtonPressEvent (evnt);
		}
开发者ID:telebovich,项目名称:monodevelop,代码行数:6,代码来源:HoverCloseButton.cs


示例19: OnSelectionButtonReleaseEvent

        bool OnSelectionButtonReleaseEvent(EventButton evnt)
        {
            if (evnt.Button != 1)
                return false;

            is_dragging_selection = false;
            is_moving_selection = false;
            fixed_width = fixed_height = false;

            SelectionSetPointer ((int)evnt.X, (int)evnt.Y);
            return true;
        }
开发者ID:hbons,项目名称:f-spot,代码行数:12,代码来源:ImageView.cs


示例20: OnButtonReleaseEvent

			protected override bool OnButtonReleaseEvent (EventButton evnt)
			{
				if (dragPosition >= 0) {
					Gdk.Pointer.Ungrab (grabTime);
					dragPosition = -1;
				}
				return base.OnButtonReleaseEvent (evnt);
			}
开发者ID:trustme,项目名称:monodevelop,代码行数:8,代码来源:BlameWidget.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Gdk.EventCrossing类代码示例发布时间:2022-05-26
下一篇:
C# GameStateManagement.ScreenManager类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap