Ejemplo n.º 1
0
        protected override void OnMouseDown(Gtk.DrawingArea canvas, Gtk.ButtonPressEventArgs args, Cairo.PointD point)
        {
            // If we are already drawing, ignore any additional mouse down events
            if (mouse_button > 0)
            {
                return;
            }

            surface_modified = false;
            undo_surface     = PintaCore.Workspace.ActiveDocument.CurrentUserLayer.Surface.Clone();
            mouse_button     = args.Event.Button;
            Color tool_color;

            if (mouse_button == 1)
            {
                tool_color = PintaCore.Palette.PrimaryColor;
            }
            else if (mouse_button == 3)
            {
                tool_color = PintaCore.Palette.SecondaryColor;
            }
            else
            {
                last_point = point_empty;
                return;
            }

            Draw(canvas, tool_color, point, true);
        }
        private void userList_ButtonPressEvent(object o, Gtk.ButtonPressEventArgs args)
        {
            TreePath path;

            if (userList.GetPathAtPos((int)args.Event.X, (int)args.Event.Y, out path))
            {
                userList.Selection.SelectPath(path);
            }
            else
            {
                userList.Selection.UnselectAll();
            }

            var node = GetSelectedNode();

            if (map != null)
            {
                map.SelectNode(node);
            }

            if (args.Event.Button == 3)
            {
                if (node != null)
                {
                    UserMenu menu = new UserMenu(node.Network, node);
                    menu.Popup();
                }
            }
        }
Ejemplo n.º 3
0
 void OnSizeButtonPress(object ob, Gtk.ButtonPressEventArgs args)
 {
     if (!animating && args.Event.Button == 1 && !args.Event.TriggersContextMenu())
     {
         int n;
         if (horiz)
         {
             Toplevel.GetPointer(out resizePos, out n);
             origSize = WidthRequest;
             if (!startPos)
             {
                 origPos = X + origSize;
             }
         }
         else
         {
             Toplevel.GetPointer(out n, out resizePos);
             origSize = HeightRequest;
             if (!startPos)
             {
                 origPos = Y + origSize;
             }
         }
         resizing = true;
     }
 }
Ejemplo n.º 4
0
        protected override void OnMouseDown(Gtk.DrawingArea canvas, Gtk.ButtonPressEventArgs args, Cairo.PointD point)
        {
            if (surface_modified)
            {
                return;
            }

            surface_modified = false;
            undo_surface     = PintaCore.Workspace.ActiveDocument.CurrentLayer.Surface.Clone();
            Color tool_color;

            if (args.Event.Button == 1)             // left
            {
                tool_color = PintaCore.Palette.PrimaryColor;
            }
            else if (args.Event.Button == 3)             // right
            {
                tool_color = PintaCore.Palette.SecondaryColor;
            }
            else
            {
                last_point = point_empty;
                return;
            }

            Draw(canvas, tool_color, point, true);
        }
Ejemplo n.º 5
0
        void OnButtonPressed(object sender, Gtk.ButtonPressEventArgs args)
        {
            switch (args.Event.Button)
            {
            case 3:             // third mouse button (right-click)
                Gtk.TreePath       path   = null;
                Gtk.TreeViewColumn column = null;

                if (tree.Selection.CountSelectedRows() == 0)
                {
                    if (tree.GetPathAtPos((int)args.Event.X,
                                          (int)args.Event.Y,
                                          out path,
                                          out column) == false)
                    {
                        break;
                    }

                    Gtk.TreeIter iter;
                    if (store_sort.GetIter(out iter, path) == false)
                    {
                        break;
                    }

                    tree.Selection.SelectIter(iter);
                }

                PopupContextMenuAtLocation((int)args.Event.X,
                                           (int)args.Event.Y);

                break;
            }
        }
Ejemplo n.º 6
0
 protected virtual void OnListButtonPress(object o, Gtk.ButtonPressEventArgs args)
 {
     if (args.Event.Button == 3)
     {
         currentListMenuHandler.ShowContextMenu();
     }
 }
Ejemplo n.º 7
0
        protected override void OnMouseDown(Gtk.DrawingArea canvas,
                                            Gtk.ButtonPressEventArgs args,
                                            Cairo.PointD point)
        {
            Document doc = PintaCore.Workspace.ActiveDocument;

            if (IsActive)
            {
                return;
            }

            original_point = point;
            if (!doc.Workspace.PointInCanvas(point))
            {
                return;
            }

            if (args.Event.Button == GtkExtensions.MouseRightButton)
            {
                is_rotating = true;
            }
            else if (args.Event.State.IsControlPressed())
            {
                is_scaling = true;
            }
            else
            {
                is_dragging = true;
            }

            using_mouse = true;
            OnStartTransform();
        }
Ejemplo n.º 8
0
 protected virtual void OnTreeSelectedButtonPressEvent(object o, Gtk.ButtonPressEventArgs args)
 {
     if (args.Event.Button == 1 && args.Event.Type == Gdk.EventType.TwoButtonPress)
     {
         OnButtonRemoveClicked(o, args);
     }
 }
Ejemplo n.º 9
0
 protected void lblReply_ButtonPress(object o, Gtk.ButtonPressEventArgs args)
 {
     if (OwnerThreadView != null)
     {
         OwnerThreadView.NotifyReplyClicked(this);
     }
 }
Ejemplo n.º 10
0
        void HandleFieldButtonPressEvent(object o, Gtk.ButtonPressEventArgs args)
        {
            LongoMatch.Core.Common.Image background;
            Gdk.Pixbuf pix = Helpers.Misc.OpenImage(this);

            if (pix == null)
            {
                return;
            }

            background = new Image(pix);
            background.ScaleInplace(Constants.MAX_BACKGROUND_WIDTH,
                                    Constants.MAX_BACKGROUND_HEIGHT);
            if (o == fieldeventbox)
            {
                UpdateBackground(background, 0);
            }
            else if (o == hfieldeventbox)
            {
                UpdateBackground(background, 1);
            }
            else if (o == goaleventbox)
            {
                UpdateBackground(background, 2);
            }
            Edited = true;
        }
Ejemplo n.º 11
0
 protected virtual void OnTreeExceptionsButtonPressEvent(object o, Gtk.ButtonPressEventArgs args)
 {
     if (args.Event.Button == 1 && args.Event.Type == Gdk.EventType.TwoButtonPress)
     {
         OnButtonAddClicked(o, args);
     }
 }
Ejemplo n.º 12
0
 protected virtual void OnButtonPress(object o, Gtk.ButtonPressEventArgs args)
 {
     if (args.Event.Button == 3)
     {
         CreatePopup(args);
     }
 }
Ejemplo n.º 13
0
        protected virtual void OnTreeviewButtonPressEvent(object o, Gtk.ButtonPressEventArgs args)
        {
            // check for a right-click
            if (args.Event.Button == 3)
            {
                // note: at this stage GetSelectedObject is "late" and return the previous item
                object   obj = null;
                TreePath path;
                if (treeview.GetPathAtPos((int)args.Event.X, (int)args.Event.Y, out path))
                {
                    TreeIter iter;
                    if (treeview.Model.GetIter(out iter, path))
                    {
                        obj = treeview.Model.GetValue(iter, 1);
                        Console.WriteLine(obj);
                    }
                }

                if ((obj is AssemblyDefinition) && (popup_assemblies.Children.Length > 0))
                {
                    popup_assemblies.Popup();
                }
                else if ((obj is TypeDefinition) && (popup_types.Children.Length > 0))
                {
                    popup_types.Popup();
                }
                else if ((obj is MethodDefinition) && (popup_methods.Children.Length > 0))
                {
                    popup_methods.Popup();
                }
            }
        }
Ejemplo n.º 14
0
 void OnVideoboxButtonPressEvent(object o, Gtk.ButtonPressEventArgs args)
 {
     /* FIXME: The pointer is grabbed when the event box is clicked.
      * Make sure to ungrab it in order to avoid clicks outisde the window
      * triggering this callback. This should be fixed properly.*/
     Pointer.Ungrab(Gtk.Global.CurrentEventTime);
     Player.TogglePlay();
 }
Ejemplo n.º 15
0
 protected void lblDelete_ButtonPress(object o, Gtk.ButtonPressEventArgs args)
 {
     if (this.LoadedMessage != null)
     {
         this.LoadedMessage.DeleteFromServer();
         this.ShowAsDeleted();
     }
 }
Ejemplo n.º 16
0
		protected virtual void OnLabelRevisionButtonPressEvent (object o, Gtk.ButtonPressEventArgs args)
		{
			if (currentRevisionShortened) {
				Revision d = SelectedRevision;
				labelRevision.Text = GettextCatalog.GetString ("revision: {0}", d.Name);
				currentRevisionShortened = false;
			}
		}
Ejemplo n.º 17
0
        void OnTabPress(object s, Gtk.ButtonPressEventArgs args)
        {
            CurrentTab = Array.IndexOf(box.Children, s);
            Tab t = (Tab)s;

            DockItem.SetFocus(t.Page);
            QueueDraw();
        }
Ejemplo n.º 18
0
 void HandleButtonPressEvent(object sender, Gtk.ButtonPressEventArgs args)
 {
     if (args.Event.Type == Gdk.EventType.ButtonPress && args.Event.Button == 3)
     {
         var popup = new PhotoPopup(this);
         popup.Activate(Toplevel, args.Event);
     }
 }
Ejemplo n.º 19
0
 void OnButtonPressed(object sender, Gtk.ButtonPressEventArgs args)
 {
     // Pass this on to the TaskWindow
     if (ButtonPressed != null)
     {
         ButtonPressed(sender, args);
     }
 }
Ejemplo n.º 20
0
 protected virtual void OnBugsListButtonPressEvent(object o, Gtk.ButtonPressEventArgs args)
 {
     if (args.Event.Button == 3)
     {
         ShowPopup();
         args.RetVal = true;
     }
 }
Ejemplo n.º 21
0
 void OnChartButtonPress(object o, Gtk.ButtonPressEventArgs args)
 {
     if (args.Event.TriggersContextMenu())
     {
         IdeApp.CommandService.ShowContextMenu(Control, args.Event, "/MonoDevelop/NUnit/ContextMenu/TestChart");
         args.RetVal = true;
     }
 }
Ejemplo n.º 22
0
        void OnTabPress(object s, Gtk.ButtonPressEventArgs args)
        {
            CurrentTab = Array.IndexOf(box.Children.ToArray(), s);
            DockItemTitleTab t = (DockItemTitleTab)s;

            DockItem.SetFocus(t.Page);
            QueueDraw();
            args.RetVal = true;
        }
Ejemplo n.º 23
0
    /**
     * Invoked when mouse clicks occur on window
     */
    protected void OnMainDrawingAreaButtonPressEvent(object o, Gtk.ButtonPressEventArgs args)
    {
        Gdk.EventButton e = args.Event;

        if (inputClient.Active && transport.isConnected() && sessionClient.GetSessionId() != 0)
        {
            inputClient.SendMouseEvent(e.Button, true, (int)e.X, (int)e.Y);
        }
    }
Ejemplo n.º 24
0
 protected virtual void OnTreeButtonPress(object o, Gtk.ButtonPressEventArgs args)
 {
     if (args.Event.Button == 3)
     {
         if (CurrentSelection != null)
         {
             CurrentSelection.ContextMenu.Popup();
         }
     }
 }
Ejemplo n.º 25
0
        protected override void OnMouseDown(Gtk.DrawingArea canvas, Gtk.ButtonPressEventArgs args, Cairo.PointD point)
        {
            Document doc = PintaCore.Workspace.ActiveDocument;

            surface_modified = false;
            undo_surface     = doc.CurrentUserLayer.Surface.Clone();
            path             = null;

            doc.ToolLayer.Clear();
            doc.ToolLayer.Hidden = false;
        }
Ejemplo n.º 26
0
    protected void OnEventbox5ButtonPressEvent(object o, Gtk.ButtonPressEventArgs args)
    {
        int mx, my;

        Gdk.Display.Default.GetPointer(out mx, out my);
        fixedLayout.Remove(this);
        fixedLayout.Add(this);

        x = curx;
        y = cury;
        w = this.WidthRequest;
        h = this.HeightRequest;
        fixedLayout.Move(this, curx, cury);

        ResetCursor();
        int tmpw = w + x, tmph = h + y;

        timer.Stop();
        timer          = new Timer(10);
        timer.Elapsed += delegate
        {
            try
            {
                Gtk.Application.Invoke(delegate {
                    int mx2, my2;
                    Gdk.Display.Default.GetPointer(out mx2, out my2);

                    if (mx2 != mx || my2 != my)
                    {
                        x = x - mx + mx2;
                        y = y - my + my2;

                        w = tmpw - Math.Max(0, x);
                        h = tmph - Math.Max(0, y);

                        mx = mx2;
                        my = my2;

                        curx = Math.Min(tmpw - minw, Math.Max(0, x));
                        cury = Math.Min(tmph - minh, Math.Max(0, y));
                        fixedLayout.Move(this, Math.Min(tmpw - minw, Math.Max(0, x)), Math.Min(tmph - minh, Math.Max(0, y)));

                        this.WidthRequest  = Math.Max(w, minw);
                        this.HeightRequest = Math.Max(h, minh);

                        ResetCompenents();
                        fixedLayout.ShowAll();
                    }
                });
            }
            catch { }
        };
        timer.Start();
    }
Ejemplo n.º 27
0
        protected void ctlStarEventBox_ButtonPress(object o, Gtk.ButtonPressEventArgs args)
        {
            if (this.loadedMessage == null)
            {
                return;
            }

            // Toggle the star status
            this.loadedMessage.Starred = !this.loadedMessage.Starred;

            this.UpdateUI();
        }
Ejemplo n.º 28
0
 //when we click our mouse button
 void DragStart(object sender, Gtk.ButtonPressEventArgs args)
 {
     // single click
     if (args.Event.Type == EventType.ButtonPress)
     {
         mouseStart = new Gdk.Point((int)Math.Floor(args.Event.X), (int)Math.Floor(args.Event.Y));
         Console.WriteLine("-------------------------------------");
         Console.WriteLine("Mouse Clicked");
         Console.WriteLine("Mouse Start Point: ({0}, {1})", mouseStart.X, mouseStart.Y);
         Console.WriteLine("-------------------------------------");
     }
 }
Ejemplo n.º 29
0
 private void on_avatarButton_button_press_event(object o, Gtk.ButtonPressEventArgs args)
 {
     if (args.Event.Button == 3)
     {
         Gtk.Menu      menu      = new Gtk.Menu();
         ImageMenuItem clearItem = new ImageMenuItem(Gtk.Stock.Clear, null);
         clearItem.Activated += clearItem_Activated;
         menu.Append(clearItem);
         menu.ShowAll();
         menu.Popup();
     }
 }
Ejemplo n.º 30
0
        protected virtual void OnDrawingareaButtonPressEvent(object o, Gtk.ButtonPressEventArgs args)
        {
            if (!Sensitive)
            {
                return;
            }

            FindNearestPoint(new Point((int)args.Event.X, (int)args.Event.Y),
                             out selectedCoords, out selectedPoint);

            QueueDraw();
        }