Example #1
0
		protected override void OnDeactivated (BaseTool newTool)
		{
			base.OnDeactivated (newTool);

			PintaCore.PaintBrushes.BrushAdded -= HandleBrushAddedOrRemoved;
			PintaCore.PaintBrushes.BrushRemoved -= HandleBrushAddedOrRemoved;
		}
Example #2
0
 public bool Handle(BaseTool tool, Cairo.PointD point)
 {
     if (IsInside (point.X, point.Y)) {
         tool.MouseMoved += action;
         tool.MouseReleased += (x, y, s) => {tool.MouseMoved -= action;};
         //TODO unregister mouse release
         return true;
     }
     return false;
 }
Example #3
0
		public ToolEventArgs (BaseTool tool)
		{
			Tool = tool;
		}
Example #4
0
        protected override void OnDeactivated(BaseTool newTool)
        {
            base.OnDeactivated (newTool);

            // Stop listening for color change events
            PintaCore.Palette.PrimaryColorChanged -= HandlePintaCorePalettePrimaryColorChanged;
            PintaCore.Palette.SecondaryColorChanged -= HandlePintaCorePalettePrimaryColorChanged;

            PintaCore.Layers.LayerAdded -= HandleSelectedLayerChanged;
            PintaCore.Layers.LayerRemoved -= HandleSelectedLayerChanged;
            PintaCore.Layers.SelectedLayerChanged -= HandleSelectedLayerChanged;

            StopEditing(false);
        }
Example #5
0
 protected override void OnDeactivated(BaseTool newTool)
 {
     base.OnDeactivated (newTool);
     if (PintaCore.Workspace.HasOpenDocuments) {
         Document doc = PintaCore.Workspace.ActiveDocument;
         doc.ToolLayer.Clear ();
     }
 }
Example #6
0
		protected override void OnDeactivated(BaseTool newTool)
		{
			base.OnDeactivated (newTool);

			if (PintaCore.Workspace.HasOpenDocuments) {
				PintaCore.Workspace.ActiveDocument.FinishSelection ();
			}
		}
Example #7
0
            public CommandMapToolButton(BaseTool tool)
                : base("Tools")
            {
                Tool = tool;

                TooltipText = tool.ToolTip;

                var icon = new Gtk.Image (PintaCore.Resources.GetIcon (tool.Icon));

                VBox box = new VBox ();
                box.Add (icon);
                Label label = new Label(tool.Name);
                label.Justify = Justification.Center;
                label.WidthChars = 11;
                label.Wrap = true;
                label.LineWrap = true;
                label.LineWrapMode = Pango.WrapMode.Word;
                box.Add (label);
                Add (box);

                ButtonReleaseEvent += Tool_HandleButtonReleaseEvent;
            }
Example #8
0
		public virtual void HandleDeactivated(BaseTool newTool)
		{
			SelectedPointIndex = -1;
			SelectedShapeIndex = -1;

			StorePreviousSettings();

			//Determine if the tool being switched to will be another editable tool.
			if (PintaCore.Workspace.HasOpenDocuments && !newTool.IsEditableShapeTool)
			{
				//The tool being switched to is not editable. Finalize every editable shape not yet finalized.
				FinalizeAllShapes();
			}

            PintaCore.Palette.PrimaryColorChanged -= Palette_PrimaryColorChanged;
            PintaCore.Palette.SecondaryColorChanged -= Palette_SecondaryColorChanged;
        }
Example #9
0
            public CommandMapToolButton(BaseTool tool)
                : base("Tools")
            {
                Tool = tool;

                TooltipText = tool.ToolTip;

                var icon = new Gtk.Image (PintaCore.Resources.GetIcon (tool.Icon));

                VBox box = new VBox ();
                box.Add (icon);
                box.Add (new Label (tool.Name));
                Add (box);

                ButtonReleaseEvent += Tool_HandleButtonReleaseEvent;
            }
Example #10
0
		protected override void OnDeactivated(BaseTool newTool)
		{
			origin = new Point (int.MinValue, int.MinValue);
		}
Example #11
0
		protected override void OnDeactivated(BaseTool newTool)
        {
            EditEngine.HandleDeactivated(newTool);

            base.OnDeactivated(newTool);
        }
Example #12
0
 public ToolEventArgs(BaseTool tool)
 {
     Tool = tool;
 }
Example #13
0
        protected virtual void OnDeactivated(BaseTool newTool)
        {
            PintaCore.Workspace.CanvasSizeChanged -= new EventHandler(Workspace_CanvasSizeChanged);

            SetCursor(null);
        }
Example #14
0
 public void DoDeactivated(BaseTool newTool)
 {
     OnDeactivated(newTool);
 }
Example #15
0
		protected virtual void OnDeactivated(BaseTool newTool)
		{
			SetCursor (null);
		}
Example #16
0
		public void DoDeactivated (BaseTool newTool)
		{
			OnDeactivated(newTool);
		}