Ejemplo n.º 1
0
		protected override bool OnButtonReleaseEvent (EventButton evnt)
		{
			if (click && hovered)
				OnClicked (EventArgs.Empty);
			click = false;
			return base.OnButtonReleaseEvent (evnt);
		}
Ejemplo n.º 2
0
        private bool DrawOrderMenu(Gdk.EventButton args)
        {
            Gtk.Menu order_menu = new Gtk.Menu();

            GtkUtil.MakeCheckMenuItem(order_menu, Catalog.GetString("Arrange by _Month"),
                                      MainWindow.Toplevel.HandleArrangeByTime, true, (adaptor is TimeAdaptor), true);

            GtkUtil.MakeCheckMenuItem(order_menu, Catalog.GetString("Arrange by _Folder"),
                                      MainWindow.Toplevel.HandleArrangeByDirectory, true, (adaptor is DirectoryAdaptor), true);

            GtkUtil.MakeMenuSeparator(order_menu);

            GtkUtil.MakeCheckMenuItem(order_menu, Catalog.GetString("_Reverse Order"),
                                      MainWindow.Toplevel.HandleReverseOrder, true, adaptor.OrderAscending, false);

            if (adaptor is TimeAdaptor && adaptor.Query.Range != null)
            {
                GtkUtil.MakeMenuSeparator(order_menu);

                GtkUtil.MakeMenuItem(order_menu, Catalog.GetString("_Clear Date Range"),
                                     MainWindow.Toplevel.HandleClearDateRange);
            }

            if (args != null)
            {
                order_menu.Popup(null, null, null, args.Button, args.Time);
            }
            else
            {
                order_menu.Popup(null, null, null, 0, Gtk.Global.CurrentEventTime);
            }

            return(true);
        }
Ejemplo n.º 3
0
        override protected bool OnButtonPressEvent(Gdk.EventButton evnt)
        {
            TreePath[] paths = Selection.GetSelectedRows();

            if (Misc.RightButtonClicked(evnt))
            {
                // 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 TimelineEvent)
                    {
                        ShowMenu();
                    }
                }
                else if (paths.Length > 1)
                {
                    ShowMenu();
                }
            }
            else
            {
                GetPathAtPos((int)evnt.X, (int)evnt.Y, out pathClicked);
                base.OnButtonPressEvent(evnt);
            }
            return(true);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Trap widget events to get a left button mouse click.
        /// </summary>
        /// <param name="sender">Event sender.</param>
        /// <param name="args">Event arguments.</param>
        private void OnWidgetEventAfter(object sender, WidgetEventAfterArgs args)
        {
            try
            {
                if (args.Event.Type == Gdk.EventType.ButtonRelease)
                {
                    Gdk.EventButton evt = (Gdk.EventButton)args.Event;

                    if (evt.Button == 1)
                    {
                        // we shouldn't follow a link if the user has selected something
                        textView.Buffer.GetSelectionBounds(out TextIter start, out TextIter end);
                        if (start.Offset == end.Offset)
                        {
                            textView.WindowToBufferCoords(TextWindowType.Widget, (int)evt.X, (int)evt.Y, out int x, out int y);
                            TextIter iter = textView.GetIterAtLocation(x, y);

                            foreach (var tag in iter.Tags)
                            {
                                if (tag is LinkTag linkTag)
                                {
                                    Process.Start(linkTag.URL);
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception err)
            {
                ShowError(err);
            }
        }
Ejemplo n.º 5
0
        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));
        }
Ejemplo n.º 6
0
        public void ActionListSimContactsButtonPress(object sender, ButtonPressEventArgs a)
        {
            Gdk.EventButton ev = a.Event;

            // check for mouse right button
            if (a.Event.Button == 3)
            {
                // check for items presence
                if (lstSimContacts.IterNChildren() == 0)
                {
                    PopMenuSimDel.Sensitive   = false;
                    PopMenuSimVFile.Sensitive = false;
                }
                else
                {
                    PopMenuSimDel.Sensitive = true;

                    // check for sim card presence
                    if (LstFileContacts.Sensitive)
                    {
                        PopMenuSimVFile.Sensitive = true;
                    }
                    else
                    {
                        PopMenuSimVFile.Sensitive = false;
                    }
                }

                PopMenuSim.Popup(null, null, null, ev.Button, ev.Time);
                PopMenuSim.ShowAll();
            }
        }
Ejemplo n.º 7
0
        void EventAfter(object sender, WidgetEventAfterArgs args)
        {
            if (args.Event.Type != Gdk.EventType.ButtonRelease)
            {
                return;
            }

            Gdk.EventButton evt = (Gdk.EventButton)args.Event;

            if (evt.Button != 1)
            {
                return;
            }

            TextView view = sender as TextView;
            TextIter start, end, iter;
            int      x, y;

            // we shouldn't follow a link if the user has selected something
            view.Buffer.GetSelectionBounds(out start, out end);
            if (start.Offset != end.Offset)
            {
                return;
            }

            view.WindowToBufferCoords(TextWindowType.Widget, (int)evt.X, (int)evt.Y, out x, out y);
            iter = view.GetIterAtLocation(x, y);

            FollowIfLink(view, iter);
        }
Ejemplo n.º 8
0
        protected override bool OnButtonReleaseEvent(Gdk.EventButton eb)
        {
            bool result = base.OnButtonReleaseEvent(eb);

            if (debug)
            {
                Console.Out.WriteLine("ZoomableCairoArea: OnButtonReleaseEvent at {0}, {1}", eb.X, eb.Y);
            }
            if (eb.Button == this.firstPressedButton)
            {
                this.isTranslating = false;
                this.isScaling     = false;
                if (eb.Button > pressedButtons.Length)
                {
                    return(result);
                }
                pressedButtons[eb.Button - 1] = false;
                this.firstPressedButton       = 0;
                this.mousePressedX            = -1;
                this.mousePressedY            = -1;
                this.lastMouseX = -1;
                this.lastMouseY = -1;
                this.QueueDraw();
            }
            return(result);
        }
Ejemplo n.º 9
0
        void ButtonPressEventHandler(object o, ButtonPressEventArgs a)
        {
            if (a.Event.Type != Gdk.EventType.ButtonPress)
            {
                return;
            }

            if (a.Event.Button == 1)
            {
                is_dragging = true;
            }

            HasFocus = true;
            Gdk.EventButton pos          = a.Event;
            int             new_selected = HitTest(pos.Y);

            int double_click_time = Settings.DoubleClickTime;

            if ((new_selected == Selected) && (a.Event.Time - last_click_time <= double_click_time))
            {
                Selected = new_selected;
                Grab.Remove(this);
                if (ItemActivated != null)
                {
                    ItemActivated(Selected);
                }
            }
            else
            {
                Selected = new_selected;
            }

            last_click_time = a.Event.Time;
            a.RetVal        = true;
        }
Ejemplo n.º 10
0
		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);
		}
Ejemplo n.º 11
0
        /// <summary>
        /// Handles ButtonPress event
        /// </summary>
        /// <param name="evnt">
        /// Arguments <see cref="Gdk.EventButton"/>
        /// </param>
        /// <returns>
        /// true if handled, false if not <see cref="System.Boolean"/>
        /// </returns>
        protected override bool OnButtonPressEvent(Gdk.EventButton evnt)
        {
            if (CanFocus == true)
            {
                if (HasFocus == false)
                {
                    GrabFocus();
                    return(true);
                }
            }
            if (Editable == false)
            {
                return(base.OnButtonPressEvent(evnt));
            }
            IDrawingCell cell = mainbox.CellAtCoordinates(System.Convert.ToInt32(evnt.X), System.Convert.ToInt32(evnt.Y));

            if (cell == null)
            {
                return(base.OnButtonPressEvent(evnt));
            }
            if (TypeValidator.IsCompatible(cell.GetType(), typeof(TimeText)) == true)
            {
                if ((int)(cell as TimeText).Part < 4)
                {
                    Selected = (cell as TimeText).Part;
                    return(true);
                }
            }
            return(base.OnButtonPressEvent(evnt));
        }
Ejemplo n.º 12
0
        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;
        }
Ejemplo n.º 13
0
 // Place the menu underneath an arbitrary parent widget.  The
 // parent widget must be set using menu.AttachToWidget before
 // calling this
 public static void PopupMenu(Gtk.Menu menu, Gdk.EventButton ev)
 {
     menu.Deactivated += DeactivateMenu;
     menu.Popup(null, null, new Gtk.MenuPositionFunc(GetMenuPosition),
                (ev == null) ? 0 : ev.Button,
                (ev == null) ? Gtk.Global.CurrentEventTime : ev.Time);
 }
Ejemplo n.º 14
0
 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;
     }
 }
Ejemplo n.º 15
0
 protected override bool OnButtonPressEvent(Gdk.EventButton e)
 {
     this.GrabFocus();
     HideTooltipWindow();
     if (this.mouseOverItem is ToolboxWidgetCategory)
     {
         if (!e.TriggersContextMenu() && e.Button == 1 && e.Type == EventType.ButtonPress)
         {
             ToolboxWidgetCategory mouseOverCateogry = (ToolboxWidgetCategory)this.mouseOverItem;
             SetCategoryExpanded(mouseOverCateogry, !mouseOverCateogry.IsExpanded);
             return(true);
         }
         this.SelectedItem = mouseOverItem;
         this.QueueResize();
     }
     else
     {
         this.SelectedItem = mouseOverItem;
         this.QueueDraw();
     }
     if (e.TriggersContextMenu())
     {
         if (DoPopupMenu != null)
         {
             DoPopupMenu(e);
             return(true);
         }
     }
     else if (e.Type == EventType.TwoButtonPress && this.SelectedItem != null)
     {
         this.OnActivateSelectedItem(EventArgs.Empty);
         return(true);
     }
     return(base.OnButtonPressEvent(e));
 }
Ejemplo n.º 16
0
 protected override bool OnButtonPressEvent(Gdk.EventButton e)
 {
     this.GrabFocus();
     HideTooltipWindow();
     if (this.mouseOverItem is Category)
     {
         if (e.Button == 1)
         {
             Category mouseOverCateogry = (Category)this.mouseOverItem;
             mouseOverCateogry.IsExpanded = !mouseOverCateogry.IsExpanded;
         }
         this.SelectedItem = mouseOverItem;
         this.QueueResize();
     }
     else
     {
         this.SelectedItem = mouseOverItem;
         this.QueueDraw();
     }
     if (e.Type == EventType.TwoButtonPress && this.SelectedItem != null)
     {
         this.OnActivateSelectedItem(EventArgs.Empty);
     }
     return(base.OnButtonPressEvent(e));
 }
Ejemplo n.º 17
0
        void OnAccessibilityShowMenu(object sender, EventArgs args)
        {
            var tab = sender as DockNotebookTab;

            DockNotebook.ActiveNotebook = notebook;
            notebook.CurrentTab         = tab;

            int x = tab.Allocation.X + (tab.Allocation.Width / 2);
            int y = tab.Allocation.Y + (tab.Allocation.Height / 2);

            // Fake an event, but all we need is the x and y.
            // Ugly but the only way without messing up the public API.
            var nativeEvent = new NativeEventButtonStruct {
                x = x,
                y = y,
            };

            IntPtr ptr = GLib.Marshaller.StructureToPtrAlloc(nativeEvent);

            try {
                Gdk.EventButton evnt = new Gdk.EventButton(ptr);
                notebook.DoPopupMenu(notebook, tab.Index, evnt);
            } finally {
                Marshal.FreeHGlobal(ptr);
            }
        }
Ejemplo n.º 18
0
 protected override bool OnButtonPressEvent(Gdk.EventButton evnt)
 {
     if (Misc.RightButtonClicked(evnt))
     {
         TreePath path;
         GetPathAtPos((int)evnt.X, (int)evnt.Y, out path);
         if (path != null)
         {
             Model.GetIter(out selectedIter, path);
             object el = Model.GetValue(selectedIter, 0);
             if (el is Playlist)
             {
                 ShowPlaylistMenu(el as Playlist);
             }
             else
             {
                 TreeIter parent;
                 Model.IterParent(out parent, selectedIter);
                 Playlist playlist = Model.GetValue(parent, 0) as Playlist;
                 ShowPlaylistElementMenu(playlist, el as IPlaylistElement, parent);
             }
         }
     }
     else
     {
         GetPathAtPos((int)evnt.X, (int)evnt.Y, out pathClicked);
     }
     return(base.OnButtonPressEvent(evnt));
 }
Ejemplo n.º 19
0
        protected override bool OnButtonPressEvent(Gdk.EventButton e)
        {
            bool result;

            NotifyCompletionContextChanged();
            HideLanguageItemWindow();

            //FIXME GTKSV2
            //if (!ShowLineMarkers)
            //	goto done;

            if (e.Window == GetWindow(Gtk.TextWindowType.Left))
            {
                int x, y;
                WindowToBufferCoords(Gtk.TextWindowType.Left, (int)e.X, (int)e.Y, out x, out y);
                TextIter line;
                int      top;

                GetLineAtY(out line, y, out top);
                buf.PlaceCursor(line);

                if (e.Button == 1)
                {
                    //FIXME GTKSV2
                    //buf.ToggleBookmark (line.Line);
                }
                else if (e.Button == 3)
                {
                    /*FIXME GTKSV2
                     *      CommandEntrySet cset = new CommandEntrySet ();
                     *
                     *      cset.AddItem (SearchCommands.ToggleBookmark);
                     *      cset.AddItem (SearchCommands.ClearBookmarks);
                     *      cset.AddItem (Command.Separator);
                     *      cset.AddItem (DebugCommands.ToggleBreakpoint);
                     *      cset.AddItem (DebugCommands.ClearAllBreakpoints);
                     *      Gtk.Menu menu = IdeApp.CommandService.CreateMenu (cset);
                     *
                     *      menu.Popup (null, null, null, 3, e.Time);*/
                }
            }
            else if (e.Button == 3 && buf.GetSelectedText().Length == 0)
            {
                int x, y;
                WindowToBufferCoords(Gtk.TextWindowType.Text, (int)e.X, (int)e.Y, out x, out y);
                buf.PlaceCursor(GetIterAtLocation(x, y));
            }

            //done:

            result = base.OnButtonPressEvent(e);

            if (extension != null)
            {
                extension.CursorPositionChanged();
            }

            return(result);
        }
Ejemplo n.º 20
0
        protected override bool OnButtonPressEvent(Gdk.EventButton eb)
        {
            bool result = base.OnButtonPressEvent(eb);

            base.GrabFocus();

            if (eb.Button > pressedButtons.Length)
            {
                return(result);
            }

            // We can't always rely on OnButtonReleaseEvent,
            // unfortunetly.
            for (int x = 0; x < pressedButtons.Length; x++)
            {
                pressedButtons[x] = false;
            }

            if (debug)
            {
                Console.Out.WriteLine("ZoomableCairoArea: OnButtonPressEvent at {0}, {1}", eb.X, eb.Y);
            }
            if (eb.Type == Gdk.EventType.ThreeButtonPress)
            {
                this.transformMatrix.InitIdentity();
                this.QueueDraw();
            }
            else if (!this.AreButtonsPressed)
            {
                //if (debug) Console.Out.WriteLine ("Button Pressed: {0}", eb.Button);
                pressedButtons[eb.Button - 1] = true;
                this.firstPressedButton       = eb.Button;
                this.mousePressedX            = eb.X;
                this.mousePressedY            = eb.Y;
                this.lastMouseX = eb.X;
                this.lastMouseY = eb.Y;

                double mouseX = eb.X;
                double mouseY = eb.Y;
                DeviceToUser(ref mouseX, ref mouseY);
                this.mousePressedUserX = mouseX;
                this.mousePressedUserY = mouseY;

                if (this.firstPressedButton == BUTTON_TRANSLATE)
                {
                    if ((eb.State & ModifierType.ControlMask) != 0)
                    {
                        this.isScaling = true;
                    }
                    else
                    {
                        this.isTranslating = true;
                    }

                    this.QueueDraw();
                }
            }
            return(result);
        }
Ejemplo n.º 21
0
 protected override bool OnButtonReleaseEvent(Gdk.EventButton evnt)
 {
     if (canvas_child != null)
     {
         canvas_child.ButtonRelease();
     }
     return(true);
 }
Ejemplo n.º 22
0
 protected override bool OnButtonPressEvent(Gdk.EventButton evnt)
 {
     if (canvas_child != null)
     {
         canvas_child.ButtonPress(evnt.X, evnt.Y, evnt.Button);
     }
     return(true);
 }
Ejemplo n.º 23
0
 protected override bool OnButtonReleaseEvent(Gdk.EventButton press)
 {
     if (canvas_child != null)
     {
         canvas_child.ButtonEvent(new Point(press.X, press.Y), false, press.Button);
     }
     return(true);
 }
Ejemplo n.º 24
0
 protected override bool OnButtonPressEvent(Gdk.EventButton evt)
 {
     if (!String.IsNullOrEmpty(linkUrl))
     {
         System.Diagnostics.Process.Start(linkUrl);
     }
     return(base.OnButtonPressEvent(evt));
 }
Ejemplo n.º 25
0
 protected override bool OnButtonPressEvent(Gdk.EventButton evnt)
 {
     if (Misc.RightButtonClicked(evnt))
     {
         playersMenu.Popup();
     }
     return(base.OnButtonPressEvent(evnt));
 }
Ejemplo n.º 26
0
 protected override bool OnButtonPressEvent(Gdk.EventButton evnt)
 {
     if ((evnt.Type == EventType.ButtonPress) && (evnt.Button == 3))
     {
         playersMenu.Popup();
     }
     return(base.OnButtonPressEvent(evnt));
 }
Ejemplo n.º 27
0
 void DoPopupMenu(Gdk.EventButton evt)
 {
     IdeApp.CommandService.ShowContextMenu(this.treeviewSearchResults, evt, new CommandEntrySet {
         new CommandEntry(ViewCommands.Open),
         new CommandEntry(EditCommands.Copy),
         new CommandEntry(EditCommands.SelectAll),
     }, this);
 }
Ejemplo n.º 28
0
        // END HERZUM SPRINT 2.3 TLAB-56 TLAB-57 TLAB-58 TLAB-59

        protected override bool OnButtonPressEvent(Gdk.EventButton gdk_event)
        {
            PointD     point = ViewToDrawing(gdk_event.X, gdk_event.Y);
            MouseEvent ev    = new MouseEvent(this, gdk_event, point);

            // HERZUM SPRINT 2.3 TLAB-56 TLAB-57 TLAB-58 TLAB-59
            IFigure figure = Drawing.FindFigure(ev.X, ev.Y);

            // END HERZUM SPRINT 2.3 TLAB-56 TLAB-57 TLAB-58 TLAB-59

            // HERZUM SPRINT 2.3 TLAB-56 TLAB-57 TLAB-58 TLAB-59
            if (ev.IsRightButtonPressed())
            {
                if (x != -1 && (x != ev.X || y != ev.Y))
                {
                    x = ev.X;
                    y = ev.Y;
                }
                else if (x == ev.X && y == ev.Y)
                {
                    return(true);
                }
                else
                {
                    x = ev.X;
                    y = ev.Y;
                }
            }
            // END HERZUM SPRINT 2.3 TLAB-56 TLAB-57 TLAB-58 TLAB-59

            // HERZUM SPRINT 2.3 TLAB-56 TLAB-57 TLAB-58 TLAB-59
            if (figure == null && ev.IsRightButtonPressed())
            {
                // HERZUM SPRINT 2.6 TLAB-172
                if (Paste != null)
                {
                    // END HERZUM SPRINT 2.6 TLAB-172
                    PopupContextMenu(ev);
                }
                return(true);
            }
            // END HERZUM SPRINT 2.3 TLAB-56 TLAB-57 TLAB-58 TLAB-59

            // TLAB-184
            if (ev.isCentralButtonPressed())
            {
                if (PanTool != null)
                {
                    OnPanTool(ev);
                }
            }
            /// TLAB-184

            Editor.Tool.MouseDown(ev);
            _drag = true;

            return(base.OnButtonPressEvent(gdk_event));
        }
Ejemplo n.º 29
0
 public EventWrapper(object evnt)
 {
     eventKey    = evnt as EventKey;
     eventButton = evnt as Gdk.EventButton;
     if (eventKey == null && eventButton == null)
     {
         throw new ArgumentException("argument must be of a valid type", nameof(evnt));
     }
 }
Ejemplo n.º 30
0
 /// <summary>
 /// Mothod handling mouse button press event
 /// </summary>
 /// <param name="evnt">
 /// Arguments <see cref="Gdk.EventButton"/>
 /// </param>
 /// <returns>
 /// true if handled, false if not <see cref="System.Boolean"/>
 /// </returns>
 protected override bool OnButtonPressEvent(Gdk.EventButton evnt)
 {
     if (this.IsSensitive() == true)
     {
         OnLinkClicked();
         return(true);
     }
     return(base.OnButtonPressEvent(evnt));
 }
Ejemplo n.º 31
0
 protected override bool OnButtonPressEvent(Gdk.EventButton evnt)
 {
     if (evnt.Button == 1)
     {
         State = Gtk.StateType.Active;
         QueueDraw();
     }
     return(base.OnButtonPressEvent(evnt));
 }
Ejemplo n.º 32
0
            protected override bool OnButtonPressEvent(Gdk.EventButton ev)
            {
                dragging = true;
                dragPos  = (dockGroup.Type == DockGroupType.Horizontal) ? (int)ev.XRoot : (int)ev.YRoot;
                DockObject obj = dockGroup.VisibleObjects [dockIndex];

                dragSize = (dockGroup.Type == DockGroupType.Horizontal) ? obj.Allocation.Width : obj.Allocation.Height;
                return(base.OnButtonPressEvent(ev));
            }
        protected override bool OnButtonPressEvent(Gdk.EventButton ev)
        {
            Gdk.Rectangle rectArea = child.Allocation;
            rectArea.Inflate(selectionBorder, selectionBorder);

            if (rectArea.Contains((int)ev.X, (int)ev.Y))
            {
                Stetic.Wrapper.Widget gw = Stetic.Wrapper.Widget.Lookup(container);
                if (gw != null)
                {
                    gw.Select();
                }
                else
                {
                    ResetSelection(null);
                }

                if (AllowResize)
                {
                    Rectangle rect = GetAreaResizeXY();
                    if (rect.Contains((int)ev.X, (int)ev.Y))
                    {
                        resizingX        = resizingY = true;
                        difX             = (int)(ev.X - rect.X);
                        difY             = (int)(ev.Y - rect.Y);
                        GdkWindow.Cursor = cursorXY;
                    }

                    rect = GetAreaResizeY();
                    if (rect.Contains((int)ev.X, (int)ev.Y))
                    {
                        resizingY        = true;
                        difY             = (int)(ev.Y - rect.Y);
                        GdkWindow.Cursor = cursorY;
                    }

                    rect = GetAreaResizeX();
                    if (rect.Contains((int)ev.X, (int)ev.Y))
                    {
                        resizingX        = true;
                        difX             = (int)(ev.X - rect.X);
                        GdkWindow.Cursor = cursorX;
                    }
                }
            }
            else
            {
                Stetic.Wrapper.Widget gw = Stetic.Wrapper.Widget.Lookup(container);
                if (gw != null)
                {
                    gw.Project.Selection = null;
                }
            }

            return(base.OnButtonPressEvent(ev));
        }
Ejemplo n.º 34
0
 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);
 }
Ejemplo n.º 35
0
        protected override bool OnButtonPressEvent(Gdk.EventButton gdk_event)
        {
            PointD     point = ViewToDrawing(gdk_event.X, gdk_event.Y);
            MouseEvent ev    = new MouseEvent(this, gdk_event, point);

            Editor.Tool.MouseDown(ev);
            _drag = true;

            return(base.OnButtonPressEvent(gdk_event));
        }
        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;
        }
Ejemplo n.º 37
0
        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;
        }
        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);
        }
        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;
        }
Ejemplo n.º 40
0
		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;
		}
Ejemplo n.º 41
0
        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);
        }
Ejemplo n.º 42
0
		protected override bool OnButtonPressEvent (EventButton evnt)
		{
			HideMenu ();
			if (hovering) {
				pressed = true;
				QueueDraw ();
			}
			return true;
		}
		protected override bool OnButtonPressEvent (EventButton e)
		{
			GrabFocus ();
			int row = GetRowByPosition ((int) e.Y);
			if ((e.State & ModifierType.ControlMask) == ModifierType.ControlMask)
				ToggleRowSelection (row);
			else
				this.SelectedRow = row;
			buttonPressed = true;
			if (e.Type == EventType.TwoButtonPress) {
				if (ItemActivated != null)
					ItemActivated (this, EventArgs.Empty);
			}
			return base.OnButtonPressEvent (e);
		}
Ejemplo n.º 44
0
 protected override bool OnButtonPressEvent(EventButton evnt)
 {
     if (evnt.Button == 1 && IsInside (evnt.X, evnt.Y)) {
         hoverState = State = StateType.Selected;
     }
     return true;
 }
Ejemplo n.º 45
0
 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;
 }
Ejemplo n.º 46
0
			protected override bool OnButtonPressEvent (EventButton evnt)
			{
				if (evnt.Button == 3) {
					CommandEntrySet opset = new CommandEntrySet ();
					opset.AddItem (BlameCommands.ShowDiff);
					opset.AddItem (BlameCommands.ShowLog);
					opset.AddItem (Command.Separator);
					opset.AddItem (BlameCommands.CopyRevision);
					IdeApp.CommandService.ShowContextMenu (opset, this);
				} else {
					if (evnt.X < leftSpacer) {
						grabTime = evnt.Time;
						var status = Gdk.Pointer.Grab (this.GdkWindow, false, EventMask.PointerMotionHintMask | EventMask.Button1MotionMask | EventMask.ButtonReleaseMask | EventMask.EnterNotifyMask | EventMask.LeaveNotifyMask, null, null, grabTime);
						if (status == GrabStatus.Success) {
							dragPosition = evnt.X;
						}
					}
				}
				return base.OnButtonPressEvent (evnt);
			}
Ejemplo n.º 47
0
			protected override bool OnButtonReleaseEvent (EventButton evnt)
			{
				if (dragPosition >= 0) {
					Gdk.Pointer.Ungrab (grabTime);
					dragPosition = -1;
				}
				return base.OnButtonReleaseEvent (evnt);
			}
Ejemplo n.º 48
0
		protected override bool OnButtonReleaseEvent (EventButton evnt)
		{
			pressed = false;
			if (hovering) {
				QueueDraw ();
				ShowMenu ();
			}
			return true;
		}
Ejemplo n.º 49
0
		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;
		}
		protected override bool OnButtonReleaseEvent (EventButton e)
		{
			if (dragBar != null)
				EndDragBar (dragBar, e.Time);

			return base.OnButtonReleaseEvent (e);
		}
Ejemplo n.º 51
0
		protected override bool OnButtonPressEvent (EventButton evnt)
		{
			if (evnt.Button == 1 && hovered) 
				click = true;
			return base.OnButtonPressEvent (evnt);
		}
Ejemplo n.º 52
0
        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;
        }
Ejemplo n.º 53
0
		protected override bool OnButtonReleaseEvent (EventButton evnt)
		{
			ClearGrab ();
			UpdatePrelightState (evnt.X, evnt.Y);
			return base.OnButtonReleaseEvent (evnt);
		}
		protected override bool OnButtonReleaseEvent (EventButton e)
		{
			buttonPressed = false;
			return base.OnButtonReleaseEvent (e);
		}
Ejemplo n.º 55
0
		void ShowPopup (EventButton evt)
		{
			Gtk.Menu contextMenu = CreateContextMenu ();
			if (contextMenu != null)
				GtkWorkarounds.ShowContextMenu (contextMenu, this, evt);
		}
Ejemplo n.º 56
0
		protected override bool OnButtonPressEvent (EventButton evnt)
		{
			if (evnt.Type == EventType.TwoButtonPress) {
				OnRequestClose (new RequestActionEventArgs (true));
			}
			if (evnt.Button == 1 && hoverItem != null)
				ActiveItem = hoverItem;
			return base.OnButtonPressEvent (evnt);
		}
Ejemplo n.º 57
0
		protected override bool OnButtonPressEvent (EventButton evnt)
		{
			if (evnt.Button != 1 || evnt.IsContextMenuButton ())
				return base.OnButtonPressEvent (evnt);

			if (IsOverIndicator (evnt.Y)) {
				parentStrip.GotoTask (parentStrip.SearchNextTask (GetHoverMode ()));
				return base.OnButtonPressEvent (evnt);
			}

			var hoverTask = GetHoverTask (evnt.Y);
			if (hoverTask != null)
				MoveToTask (hoverTask);

			if (IsInsideBar (evnt.X, evnt.Y)) {
				Grab.Add (this);
				grabCenter = GetSliderCenter ();
				grabY = evnt.Y;
			} else {
				MovePosition (evnt.Y);
			}

			return base.OnButtonPressEvent (evnt);
		}
		protected override bool OnButtonReleaseEvent (EventButton evnt)
		{
			Close ();
			return base.OnButtonReleaseEvent (evnt);
		}
Ejemplo n.º 59
0
		protected override bool OnButtonPressEvent (EventButton evnt)
		{
			MinimizeAllAutohidden ();
			return base.OnButtonPressEvent (evnt);
		}
Ejemplo n.º 60
0
		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);
		}