コード例 #1
0
ファイル: PencilTool.cs プロジェクト: xentaoslinux/pinta
        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);
        }
コード例 #2
0
        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();
                }
            }
        }
コード例 #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;
     }
 }
コード例 #4
0
ファイル: PencilTool.cs プロジェクト: casey0102/Pinta
        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);
        }
コード例 #5
0
ファイル: TaskListWindow.cs プロジェクト: shubhtr/tomboy-1
        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;
            }
        }
コード例 #6
0
 protected virtual void OnListButtonPress(object o, Gtk.ButtonPressEventArgs args)
 {
     if (args.Event.Button == 3)
     {
         currentListMenuHandler.ShowContextMenu();
     }
 }
コード例 #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();
        }
コード例 #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);
     }
 }
コード例 #9
0
 protected void lblReply_ButtonPress(object o, Gtk.ButtonPressEventArgs args)
 {
     if (OwnerThreadView != null)
     {
         OwnerThreadView.NotifyReplyClicked(this);
     }
 }
コード例 #10
0
ファイル: DashboardWidget.cs プロジェクト: kuggaa/longomatch
        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;
        }
コード例 #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);
     }
 }
コード例 #12
0
 protected virtual void OnButtonPress(object o, Gtk.ButtonPressEventArgs args)
 {
     if (args.Event.Button == 3)
     {
         CreatePopup(args);
     }
 }
コード例 #13
0
ファイル: MainWindow.cs プロジェクト: jma2400/cecil-old
        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();
                }
            }
        }
コード例 #14
0
ファイル: PlayerView.cs プロジェクト: kuggaa/longomatch
 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();
 }
コード例 #15
0
 protected void lblDelete_ButtonPress(object o, Gtk.ButtonPressEventArgs args)
 {
     if (this.LoadedMessage != null)
     {
         this.LoadedMessage.DeleteFromServer();
         this.ShowAsDeleted();
     }
 }
コード例 #16
0
ファイル: LogWidget.cs プロジェクト: tsotsos/monodevelop
		protected virtual void OnLabelRevisionButtonPressEvent (object o, Gtk.ButtonPressEventArgs args)
		{
			if (currentRevisionShortened) {
				Revision d = SelectedRevision;
				labelRevision.Text = GettextCatalog.GetString ("revision: {0}", d.Name);
				currentRevisionShortened = false;
			}
		}
コード例 #17
0
ファイル: TabStrip.cs プロジェクト: p07r0457/Pinta
        void OnTabPress(object s, Gtk.ButtonPressEventArgs args)
        {
            CurrentTab = Array.IndexOf(box.Children, s);
            Tab t = (Tab)s;

            DockItem.SetFocus(t.Page);
            QueueDraw();
        }
コード例 #18
0
ファイル: FullScreenView.cs プロジェクト: f-spot/f-spot-xplat
 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);
     }
 }
コード例 #19
0
 void OnButtonPressed(object sender, Gtk.ButtonPressEventArgs args)
 {
     // Pass this on to the TaskWindow
     if (ButtonPressed != null)
     {
         ButtonPressed(sender, args);
     }
 }
コード例 #20
0
 protected virtual void OnBugsListButtonPressEvent(object o, Gtk.ButtonPressEventArgs args)
 {
     if (args.Event.Button == 3)
     {
         ShowPopup();
         args.RetVal = true;
     }
 }
コード例 #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;
     }
 }
コード例 #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;
        }
コード例 #23
0
ファイル: MainWindow.cs プロジェクト: arif-sb/Screenary
    /**
     * 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);
        }
    }
コード例 #24
0
 protected virtual void OnTreeButtonPress(object o, Gtk.ButtonPressEventArgs args)
 {
     if (args.Event.Button == 3)
     {
         if (CurrentSelection != null)
         {
             CurrentSelection.ContextMenu.Popup();
         }
     }
 }
コード例 #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;
        }
コード例 #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();
    }
コード例 #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();
        }
コード例 #28
0
ファイル: Program.cs プロジェクト: yaegerbomb/BlackOstrich
 //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("-------------------------------------");
     }
 }
コード例 #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();
     }
 }
コード例 #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();
        }