2016-10-01 20:58:59 +13:00
|
|
|
|
#region License Information (GPL v3)
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
ShareX - A program that allows you to take screenshots and share any file type
|
2019-01-02 20:43:52 +13:00
|
|
|
|
Copyright (c) 2007-2019 ShareX Team
|
2016-10-01 20:58:59 +13:00
|
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
|
modify it under the terms of the GNU General Public License
|
|
|
|
|
as published by the Free Software Foundation; either version 2
|
|
|
|
|
of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
|
|
|
|
|
Optionally you can also view the license at <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#endregion License Information (GPL v3)
|
|
|
|
|
|
|
|
|
|
using ShareX.HelpersLib;
|
|
|
|
|
using ShareX.ScreenCaptureLib.Properties;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
|
|
|
namespace ShareX.ScreenCaptureLib
|
|
|
|
|
{
|
|
|
|
|
internal partial class ShapeManager
|
|
|
|
|
{
|
2017-10-24 12:24:50 +13:00
|
|
|
|
public bool ToolbarCreated { get; private set; }
|
2017-10-30 21:48:58 +13:00
|
|
|
|
public bool ToolbarCollapsed { get; private set; }
|
2016-10-06 02:00:33 +13:00
|
|
|
|
|
2017-04-03 12:44:03 +12:00
|
|
|
|
internal TextAnimation MenuTextAnimation = new TextAnimation()
|
|
|
|
|
{
|
2017-04-03 22:49:00 +12:00
|
|
|
|
FadeInDuration = TimeSpan.FromMilliseconds(0),
|
|
|
|
|
Duration = TimeSpan.FromMilliseconds(5000),
|
|
|
|
|
FadeOutDuration = TimeSpan.FromMilliseconds(500)
|
2017-04-03 12:44:03 +12:00
|
|
|
|
};
|
2016-10-03 05:01:55 +13:00
|
|
|
|
|
2016-10-01 20:58:59 +13:00
|
|
|
|
private Form menuForm;
|
|
|
|
|
private ToolStripEx tsMain;
|
2017-12-25 19:40:32 +13:00
|
|
|
|
private ToolStripButton tsbSaveImage, tsbBorderColor, tsbFillColor, tsbHighlightColor;
|
2016-10-01 20:58:59 +13:00
|
|
|
|
private ToolStripDropDownButton tsddbShapeOptions;
|
2018-01-31 06:14:28 +13:00
|
|
|
|
private ToolStripMenuItem tsmiArrowHeadsBothSide, tsmiShadow, tsmiShadowColor, tsmiStepUseLetters, tsmiUndo, tsmiDelete, tsmiDeleteAll, tsmiMoveTop,
|
2018-05-01 04:45:35 +12:00
|
|
|
|
tsmiMoveUp, tsmiMoveDown, tsmiMoveBottom, tsmiRegionCapture, tsmiQuickCrop, tsmiShowMagnifier, tsmiImageEditorBackgroundColor;
|
|
|
|
|
private ToolStripLabeledNumericUpDown tslnudBorderSize, tslnudCornerRadius, tslnudCenterPoints, tslnudBlurRadius, tslnudPixelateSize, tslnudStepFontSize,
|
2019-05-03 19:40:54 +12:00
|
|
|
|
tslnudMagnifierPixelCount, tslnudStartingStepValue, tslnudMagnifyStrength;
|
2017-10-31 00:14:13 +13:00
|
|
|
|
private ToolStripLabel tslDragLeft, tslDragRight;
|
2018-01-06 18:30:04 +13:00
|
|
|
|
private ToolStripLabeledComboBox tscbImageInterpolationMode, tscbCursorTypes;
|
2016-10-01 20:58:59 +13:00
|
|
|
|
|
2017-10-24 12:24:50 +13:00
|
|
|
|
internal void CreateToolbar()
|
2016-10-01 20:58:59 +13:00
|
|
|
|
{
|
|
|
|
|
menuForm = new Form()
|
|
|
|
|
{
|
|
|
|
|
AutoScaleDimensions = new SizeF(6F, 13F),
|
|
|
|
|
AutoScaleMode = AutoScaleMode.Font,
|
|
|
|
|
AutoSize = true,
|
|
|
|
|
AutoSizeMode = AutoSizeMode.GrowAndShrink,
|
|
|
|
|
ClientSize = new Size(759, 509),
|
|
|
|
|
FormBorderStyle = FormBorderStyle.None,
|
|
|
|
|
Location = new Point(200, 200),
|
|
|
|
|
ShowInTaskbar = false,
|
|
|
|
|
StartPosition = FormStartPosition.Manual,
|
2017-10-29 09:40:50 +13:00
|
|
|
|
Text = "ShareX - " + Resources.ShapeManager_CreateToolbar_AnnotateMenu,
|
2017-11-12 20:32:55 +13:00
|
|
|
|
TopMost = Form.IsFullscreen
|
2016-10-01 20:58:59 +13:00
|
|
|
|
};
|
|
|
|
|
|
2017-04-02 09:56:53 +12:00
|
|
|
|
menuForm.Shown += MenuForm_Shown;
|
2017-01-11 07:56:37 +13:00
|
|
|
|
menuForm.KeyDown += MenuForm_KeyDown;
|
2016-10-06 08:32:01 +13:00
|
|
|
|
menuForm.KeyUp += MenuForm_KeyUp;
|
2016-10-06 04:37:11 +13:00
|
|
|
|
menuForm.LocationChanged += MenuForm_LocationChanged;
|
2018-04-03 10:43:10 +12:00
|
|
|
|
menuForm.GotFocus += MenuForm_GotFocus;
|
|
|
|
|
menuForm.LostFocus += MenuForm_LostFocus;
|
2016-10-06 04:37:11 +13:00
|
|
|
|
|
2016-10-01 20:58:59 +13:00
|
|
|
|
menuForm.SuspendLayout();
|
|
|
|
|
|
|
|
|
|
tsMain = new ToolStripEx()
|
|
|
|
|
{
|
|
|
|
|
AutoSize = true,
|
|
|
|
|
CanOverflow = false,
|
|
|
|
|
ClickThrough = true,
|
|
|
|
|
Dock = DockStyle.None,
|
|
|
|
|
GripStyle = ToolStripGripStyle.Hidden,
|
|
|
|
|
Location = new Point(0, 0),
|
2016-10-06 02:00:33 +13:00
|
|
|
|
MinimumSize = new Size(10, 30),
|
2017-11-12 20:32:55 +13:00
|
|
|
|
Padding = Form.IsEditorMode ? new Padding(5, 1, 3, 0) : new Padding(0, 1, 0, 0),
|
2019-05-16 11:05:32 +12:00
|
|
|
|
Renderer = new ToolStripRoundedEdgeRenderer(),
|
2016-10-13 20:36:25 +13:00
|
|
|
|
TabIndex = 0,
|
|
|
|
|
ShowItemToolTips = false
|
2016-10-01 20:58:59 +13:00
|
|
|
|
};
|
|
|
|
|
|
2016-10-06 04:37:11 +13:00
|
|
|
|
tsMain.MouseLeave += TsMain_MouseLeave;
|
|
|
|
|
|
2016-10-01 20:58:59 +13:00
|
|
|
|
tsMain.SuspendLayout();
|
|
|
|
|
|
|
|
|
|
menuForm.Controls.Add(tsMain);
|
|
|
|
|
|
2017-11-12 20:32:55 +13:00
|
|
|
|
if (Form.IsFullscreen)
|
2016-10-01 20:58:59 +13:00
|
|
|
|
{
|
2017-10-27 20:42:57 +13:00
|
|
|
|
tslDragLeft = new ToolStripLabel()
|
|
|
|
|
{
|
|
|
|
|
DisplayStyle = ToolStripItemDisplayStyle.Image,
|
|
|
|
|
Image = Resources.ui_radio_button_uncheck,
|
|
|
|
|
Margin = new Padding(0, 0, 2, 0),
|
|
|
|
|
Padding = new Padding(2)
|
|
|
|
|
};
|
2016-10-01 20:58:59 +13:00
|
|
|
|
|
2017-10-27 20:42:57 +13:00
|
|
|
|
tsMain.Items.Add(tslDragLeft);
|
|
|
|
|
}
|
2016-10-01 20:58:59 +13:00
|
|
|
|
|
2017-11-12 20:32:55 +13:00
|
|
|
|
if (Form.IsEditorMode)
|
2016-10-01 20:58:59 +13:00
|
|
|
|
{
|
2016-12-02 04:11:26 +13:00
|
|
|
|
#region Editor mode
|
|
|
|
|
|
2017-03-08 02:49:01 +13:00
|
|
|
|
ToolStripButton tsbCompleteEdit = new ToolStripButton();
|
|
|
|
|
|
2017-11-12 20:32:55 +13:00
|
|
|
|
if (Form.Mode == RegionCaptureMode.Editor)
|
2017-03-08 02:49:01 +13:00
|
|
|
|
{
|
2017-06-16 10:57:39 +12:00
|
|
|
|
tsbCompleteEdit.Text = Resources.ShapeManager_CreateToolbar_RunAfterCaptureTasks;
|
2017-03-08 02:49:01 +13:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2017-06-16 10:57:39 +12:00
|
|
|
|
tsbCompleteEdit.Text = Resources.ShapeManager_CreateToolbar_ApplyChangesContinueTaskEnter;
|
2017-03-08 02:49:01 +13:00
|
|
|
|
}
|
|
|
|
|
|
2016-10-01 20:58:59 +13:00
|
|
|
|
tsbCompleteEdit.DisplayStyle = ToolStripItemDisplayStyle.Image;
|
|
|
|
|
tsbCompleteEdit.Image = Resources.tick;
|
2018-03-28 03:35:00 +13:00
|
|
|
|
tsbCompleteEdit.Click += (sender, e) => Form.CloseWindow(RegionResult.AnnotateRunAfterCaptureTasks);
|
2016-10-01 20:58:59 +13:00
|
|
|
|
tsMain.Items.Add(tsbCompleteEdit);
|
|
|
|
|
|
2017-11-12 20:32:55 +13:00
|
|
|
|
if (Form.Mode == RegionCaptureMode.TaskEditor)
|
2017-03-08 02:49:01 +13:00
|
|
|
|
{
|
2018-12-29 21:17:44 +13:00
|
|
|
|
ToolStripButton tsbContinueTask = new ToolStripButton(Resources.ShapeManager_CreateToolbar_ContinueTaskSpaceOrRightClick);
|
|
|
|
|
tsbContinueTask.DisplayStyle = ToolStripItemDisplayStyle.Image;
|
|
|
|
|
tsbContinueTask.Image = Resources.control;
|
|
|
|
|
tsbContinueTask.Click += (sender, e) => Form.CloseWindow(RegionResult.AnnotateContinueTask);
|
|
|
|
|
tsMain.Items.Add(tsbContinueTask);
|
|
|
|
|
|
|
|
|
|
ToolStripButton tsbCancelTask = new ToolStripButton(Resources.ShapeManager_CreateToolbar_CancelTaskEsc);
|
|
|
|
|
tsbCancelTask.DisplayStyle = ToolStripItemDisplayStyle.Image;
|
|
|
|
|
tsbCancelTask.Image = Resources.cross;
|
|
|
|
|
tsbCancelTask.Click += (sender, e) => Form.CloseWindow(RegionResult.AnnotateCancelTask);
|
|
|
|
|
tsMain.Items.Add(tsbCancelTask);
|
2017-03-08 02:49:01 +13:00
|
|
|
|
|
|
|
|
|
tsMain.Items.Add(new ToolStripSeparator());
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-25 19:40:32 +13:00
|
|
|
|
tsbSaveImage = new ToolStripButton(Resources.ShapeManager_CreateToolbar_SaveImage);
|
2016-10-01 20:58:59 +13:00
|
|
|
|
tsbSaveImage.DisplayStyle = ToolStripItemDisplayStyle.Image;
|
|
|
|
|
tsbSaveImage.Image = Resources.disk_black;
|
2017-12-17 20:30:39 +13:00
|
|
|
|
tsbSaveImage.Click += (sender, e) => Form.OnSaveImageRequested();
|
2016-10-01 20:58:59 +13:00
|
|
|
|
tsMain.Items.Add(tsbSaveImage);
|
|
|
|
|
|
2017-06-16 10:57:39 +12:00
|
|
|
|
ToolStripButton tsbSaveImageAs = new ToolStripButton(Resources.ShapeManager_CreateToolbar_SaveImageAs);
|
2016-10-01 20:58:59 +13:00
|
|
|
|
tsbSaveImageAs.DisplayStyle = ToolStripItemDisplayStyle.Image;
|
|
|
|
|
tsbSaveImageAs.Image = Resources.disks_black;
|
2017-12-17 20:30:39 +13:00
|
|
|
|
tsbSaveImageAs.Click += (sender, e) => Form.OnSaveImageAsRequested();
|
2016-10-01 20:58:59 +13:00
|
|
|
|
tsMain.Items.Add(tsbSaveImageAs);
|
|
|
|
|
|
2017-06-16 10:57:39 +12:00
|
|
|
|
ToolStripButton tsbCopyImage = new ToolStripButton(Resources.ShapeManager_CreateToolbar_CopyImageToClipboard);
|
2016-10-01 20:58:59 +13:00
|
|
|
|
tsbCopyImage.DisplayStyle = ToolStripItemDisplayStyle.Image;
|
|
|
|
|
tsbCopyImage.Image = Resources.clipboard;
|
2017-12-17 20:30:39 +13:00
|
|
|
|
tsbCopyImage.Click += (sender, e) => Form.OnCopyImageRequested();
|
2016-10-01 20:58:59 +13:00
|
|
|
|
tsMain.Items.Add(tsbCopyImage);
|
|
|
|
|
|
2017-06-16 10:57:39 +12:00
|
|
|
|
ToolStripButton tsbUploadImage = new ToolStripButton(Resources.ShapeManager_CreateToolbar_UploadImage);
|
2016-10-01 20:58:59 +13:00
|
|
|
|
tsbUploadImage.DisplayStyle = ToolStripItemDisplayStyle.Image;
|
|
|
|
|
tsbUploadImage.Image = Resources.drive_globe;
|
2017-12-17 20:30:39 +13:00
|
|
|
|
tsbUploadImage.Click += (sender, e) => Form.OnUploadImageRequested();
|
2016-10-01 20:58:59 +13:00
|
|
|
|
tsMain.Items.Add(tsbUploadImage);
|
|
|
|
|
|
2017-06-16 10:57:39 +12:00
|
|
|
|
ToolStripButton tsbPrintImage = new ToolStripButton(Resources.ShapeManager_CreateToolbar_PrintImage);
|
2016-10-01 20:58:59 +13:00
|
|
|
|
tsbPrintImage.DisplayStyle = ToolStripItemDisplayStyle.Image;
|
|
|
|
|
tsbPrintImage.Image = Resources.printer;
|
2017-12-17 20:30:39 +13:00
|
|
|
|
tsbPrintImage.Click += (sender, e) => Form.OnPrintImageRequested();
|
2016-10-01 20:58:59 +13:00
|
|
|
|
tsMain.Items.Add(tsbPrintImage);
|
|
|
|
|
|
|
|
|
|
tsMain.Items.Add(new ToolStripSeparator());
|
|
|
|
|
|
2016-12-02 04:11:26 +13:00
|
|
|
|
#endregion Editor mode
|
|
|
|
|
}
|
2018-12-29 21:17:44 +13:00
|
|
|
|
else if (Helpers.IsTabletMode())
|
|
|
|
|
{
|
|
|
|
|
ToolStripButton tsbClose = new ToolStripButton("Close (Esc)");
|
|
|
|
|
tsbClose.DisplayStyle = ToolStripItemDisplayStyle.Image;
|
|
|
|
|
tsbClose.Image = Resources.cross;
|
|
|
|
|
tsbClose.Click += (sender, e) => Form.CloseWindow();
|
|
|
|
|
tsMain.Items.Add(tsbClose);
|
|
|
|
|
|
|
|
|
|
tsMain.Items.Add(new ToolStripSeparator());
|
|
|
|
|
}
|
2016-10-01 20:58:59 +13:00
|
|
|
|
|
|
|
|
|
#region Tools
|
|
|
|
|
|
|
|
|
|
foreach (ShapeType shapeType in Helpers.GetEnums<ShapeType>())
|
|
|
|
|
{
|
2017-11-12 20:32:55 +13:00
|
|
|
|
if (Form.IsEditorMode)
|
2016-10-01 20:58:59 +13:00
|
|
|
|
{
|
2016-10-02 02:41:17 +13:00
|
|
|
|
if (IsShapeTypeRegion(shapeType))
|
|
|
|
|
{
|
|
|
|
|
continue;
|
|
|
|
|
}
|
2016-10-01 20:58:59 +13:00
|
|
|
|
}
|
2019-04-05 05:32:58 +13:00
|
|
|
|
else if (shapeType == ShapeType.ToolSelect)
|
2016-10-02 00:19:53 +13:00
|
|
|
|
{
|
|
|
|
|
tsMain.Items.Add(new ToolStripSeparator());
|
|
|
|
|
}
|
2017-12-13 04:50:02 +13:00
|
|
|
|
else if (shapeType == ShapeType.ToolCrop)
|
2017-05-01 00:54:05 +12:00
|
|
|
|
{
|
|
|
|
|
continue;
|
|
|
|
|
}
|
2016-10-02 00:19:53 +13:00
|
|
|
|
|
2016-10-01 20:58:59 +13:00
|
|
|
|
ToolStripButton tsbShapeType = new ToolStripButton(shapeType.GetLocalizedDescription());
|
|
|
|
|
tsbShapeType.DisplayStyle = ToolStripItemDisplayStyle.Image;
|
|
|
|
|
|
|
|
|
|
Image img = null;
|
|
|
|
|
|
|
|
|
|
switch (shapeType)
|
|
|
|
|
{
|
|
|
|
|
case ShapeType.RegionRectangle:
|
|
|
|
|
img = Resources.layer_shape_region;
|
|
|
|
|
break;
|
|
|
|
|
case ShapeType.RegionEllipse:
|
|
|
|
|
img = Resources.layer_shape_ellipse_region;
|
|
|
|
|
break;
|
|
|
|
|
case ShapeType.RegionFreehand:
|
|
|
|
|
img = Resources.layer_shape_polygon;
|
|
|
|
|
break;
|
|
|
|
|
case ShapeType.DrawingRectangle:
|
|
|
|
|
img = Resources.layer_shape;
|
|
|
|
|
break;
|
|
|
|
|
case ShapeType.DrawingEllipse:
|
|
|
|
|
img = Resources.layer_shape_ellipse;
|
|
|
|
|
break;
|
|
|
|
|
case ShapeType.DrawingFreehand:
|
2017-02-09 00:16:40 +13:00
|
|
|
|
img = Resources.pencil;
|
2016-10-01 20:58:59 +13:00
|
|
|
|
break;
|
|
|
|
|
case ShapeType.DrawingLine:
|
|
|
|
|
img = Resources.layer_shape_line;
|
|
|
|
|
break;
|
|
|
|
|
case ShapeType.DrawingArrow:
|
|
|
|
|
img = Resources.layer_shape_arrow;
|
|
|
|
|
break;
|
2017-02-16 13:49:13 +13:00
|
|
|
|
case ShapeType.DrawingTextOutline:
|
|
|
|
|
img = Resources.edit_outline;
|
|
|
|
|
break;
|
|
|
|
|
case ShapeType.DrawingTextBackground:
|
|
|
|
|
img = Resources.edit_shade;
|
2016-10-01 20:58:59 +13:00
|
|
|
|
break;
|
|
|
|
|
case ShapeType.DrawingSpeechBalloon:
|
|
|
|
|
img = Resources.balloon_box_left;
|
|
|
|
|
break;
|
|
|
|
|
case ShapeType.DrawingStep:
|
|
|
|
|
img = Resources.counter_reset;
|
|
|
|
|
break;
|
2019-05-02 21:45:54 +12:00
|
|
|
|
case ShapeType.DrawingMagnify:
|
|
|
|
|
img = Resources.magnifier_zoom;
|
|
|
|
|
break;
|
2016-10-01 20:58:59 +13:00
|
|
|
|
case ShapeType.DrawingImage:
|
2017-05-07 09:34:03 +12:00
|
|
|
|
img = Resources.folder_open_image;
|
2016-10-01 20:58:59 +13:00
|
|
|
|
break;
|
2017-05-07 08:53:46 +12:00
|
|
|
|
case ShapeType.DrawingImageScreen:
|
2017-05-07 09:34:03 +12:00
|
|
|
|
img = Resources.monitor_image;
|
2017-05-07 08:53:46 +12:00
|
|
|
|
break;
|
2018-02-06 21:32:13 +13:00
|
|
|
|
case ShapeType.DrawingSticker:
|
2018-07-13 17:35:54 +12:00
|
|
|
|
if (MathHelpers.Random(1, 10) == 1)
|
|
|
|
|
{
|
|
|
|
|
img = Resources.smiley_cool;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
img = Resources.smiley_yell;
|
|
|
|
|
}
|
2018-02-06 21:32:13 +13:00
|
|
|
|
break;
|
2017-07-18 06:48:42 +12:00
|
|
|
|
case ShapeType.DrawingCursor:
|
2019-04-08 09:26:57 +12:00
|
|
|
|
img = Resources.stamp_cursor;
|
2017-07-18 06:48:42 +12:00
|
|
|
|
break;
|
2016-10-01 20:58:59 +13:00
|
|
|
|
case ShapeType.EffectBlur:
|
|
|
|
|
img = Resources.layer_shade;
|
|
|
|
|
break;
|
|
|
|
|
case ShapeType.EffectPixelate:
|
|
|
|
|
img = Resources.grid;
|
|
|
|
|
break;
|
|
|
|
|
case ShapeType.EffectHighlight:
|
|
|
|
|
img = Resources.highlighter_text;
|
|
|
|
|
break;
|
2017-12-13 04:50:02 +13:00
|
|
|
|
case ShapeType.ToolCrop:
|
2017-05-03 02:03:28 +12:00
|
|
|
|
img = Resources.image_crop;
|
|
|
|
|
break;
|
2019-04-05 05:32:58 +13:00
|
|
|
|
case ShapeType.ToolSelect:
|
2019-04-14 00:27:41 +12:00
|
|
|
|
img = Resources.cursor;
|
2019-04-05 05:32:58 +13:00
|
|
|
|
break;
|
2016-10-01 20:58:59 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tsbShapeType.Image = img;
|
2017-11-07 05:01:02 +13:00
|
|
|
|
tsbShapeType.Checked = shapeType == CurrentTool;
|
2016-10-01 20:58:59 +13:00
|
|
|
|
tsbShapeType.Tag = shapeType;
|
|
|
|
|
|
|
|
|
|
tsbShapeType.MouseDown += (sender, e) =>
|
|
|
|
|
{
|
|
|
|
|
tsbShapeType.RadioCheck();
|
2017-11-07 05:01:02 +13:00
|
|
|
|
CurrentTool = shapeType;
|
2016-10-01 20:58:59 +13:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
tsMain.Items.Add(tsbShapeType);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion Tools
|
|
|
|
|
|
2016-12-02 01:24:19 +13:00
|
|
|
|
#region Shape options
|
2016-10-01 20:58:59 +13:00
|
|
|
|
|
|
|
|
|
tsMain.Items.Add(new ToolStripSeparator());
|
|
|
|
|
|
2016-10-05 06:38:30 +13:00
|
|
|
|
tsbBorderColor = new ToolStripButton(Resources.ShapeManager_CreateContextMenu_Border_color___);
|
|
|
|
|
tsbBorderColor.DisplayStyle = ToolStripItemDisplayStyle.Image;
|
|
|
|
|
tsbBorderColor.Click += (sender, e) =>
|
2016-10-01 20:58:59 +13:00
|
|
|
|
{
|
2017-11-12 20:32:55 +13:00
|
|
|
|
Form.Pause();
|
2016-10-01 20:58:59 +13:00
|
|
|
|
|
2017-11-07 05:01:02 +13:00
|
|
|
|
ShapeType shapeType = CurrentTool;
|
2016-10-01 20:58:59 +13:00
|
|
|
|
|
|
|
|
|
Color borderColor;
|
|
|
|
|
|
2017-02-16 13:49:13 +13:00
|
|
|
|
if (shapeType == ShapeType.DrawingTextBackground || shapeType == ShapeType.DrawingSpeechBalloon)
|
2016-10-01 20:58:59 +13:00
|
|
|
|
{
|
|
|
|
|
borderColor = AnnotationOptions.TextBorderColor;
|
|
|
|
|
}
|
2017-02-16 13:49:13 +13:00
|
|
|
|
else if (shapeType == ShapeType.DrawingTextOutline)
|
|
|
|
|
{
|
|
|
|
|
borderColor = AnnotationOptions.TextOutlineBorderColor;
|
|
|
|
|
}
|
2016-10-01 20:58:59 +13:00
|
|
|
|
else if (shapeType == ShapeType.DrawingStep)
|
|
|
|
|
{
|
|
|
|
|
borderColor = AnnotationOptions.StepBorderColor;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
borderColor = AnnotationOptions.BorderColor;
|
|
|
|
|
}
|
|
|
|
|
|
2018-06-03 00:34:52 +12:00
|
|
|
|
if (PickColor(borderColor, out Color newColor))
|
2016-10-01 20:58:59 +13:00
|
|
|
|
{
|
2017-05-28 10:29:33 +12:00
|
|
|
|
if (shapeType == ShapeType.DrawingTextBackground || shapeType == ShapeType.DrawingSpeechBalloon)
|
2016-10-01 20:58:59 +13:00
|
|
|
|
{
|
2017-05-28 10:29:33 +12:00
|
|
|
|
AnnotationOptions.TextBorderColor = newColor;
|
2016-10-01 20:58:59 +13:00
|
|
|
|
}
|
2017-05-28 10:29:33 +12:00
|
|
|
|
else if (shapeType == ShapeType.DrawingTextOutline)
|
|
|
|
|
{
|
|
|
|
|
AnnotationOptions.TextOutlineBorderColor = newColor;
|
|
|
|
|
}
|
|
|
|
|
else if (shapeType == ShapeType.DrawingStep)
|
|
|
|
|
{
|
|
|
|
|
AnnotationOptions.StepBorderColor = newColor;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
AnnotationOptions.BorderColor = newColor;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
UpdateMenu();
|
|
|
|
|
UpdateCurrentShape();
|
2016-10-01 20:58:59 +13:00
|
|
|
|
}
|
|
|
|
|
|
2017-11-12 20:32:55 +13:00
|
|
|
|
Form.Resume();
|
2016-10-01 20:58:59 +13:00
|
|
|
|
};
|
2016-10-05 06:38:30 +13:00
|
|
|
|
tsMain.Items.Add(tsbBorderColor);
|
2016-10-01 20:58:59 +13:00
|
|
|
|
|
2016-10-05 06:38:30 +13:00
|
|
|
|
tsbFillColor = new ToolStripButton(Resources.ShapeManager_CreateContextMenu_Fill_color___);
|
|
|
|
|
tsbFillColor.DisplayStyle = ToolStripItemDisplayStyle.Image;
|
|
|
|
|
tsbFillColor.Click += (sender, e) =>
|
2016-10-01 20:58:59 +13:00
|
|
|
|
{
|
2017-11-12 20:32:55 +13:00
|
|
|
|
Form.Pause();
|
2016-10-01 20:58:59 +13:00
|
|
|
|
|
2017-11-07 05:01:02 +13:00
|
|
|
|
ShapeType shapeType = CurrentTool;
|
2016-10-01 20:58:59 +13:00
|
|
|
|
|
|
|
|
|
Color fillColor;
|
|
|
|
|
|
2017-02-16 13:49:13 +13:00
|
|
|
|
if (shapeType == ShapeType.DrawingTextBackground || shapeType == ShapeType.DrawingSpeechBalloon)
|
2016-10-01 20:58:59 +13:00
|
|
|
|
{
|
|
|
|
|
fillColor = AnnotationOptions.TextFillColor;
|
|
|
|
|
}
|
|
|
|
|
else if (shapeType == ShapeType.DrawingStep)
|
|
|
|
|
{
|
|
|
|
|
fillColor = AnnotationOptions.StepFillColor;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
fillColor = AnnotationOptions.FillColor;
|
|
|
|
|
}
|
|
|
|
|
|
2018-06-03 00:34:52 +12:00
|
|
|
|
if (PickColor(fillColor, out Color newColor))
|
2016-10-01 20:58:59 +13:00
|
|
|
|
{
|
2017-05-28 10:29:33 +12:00
|
|
|
|
if (shapeType == ShapeType.DrawingTextBackground || shapeType == ShapeType.DrawingSpeechBalloon)
|
2016-10-01 20:58:59 +13:00
|
|
|
|
{
|
2017-05-28 10:29:33 +12:00
|
|
|
|
AnnotationOptions.TextFillColor = newColor;
|
2016-10-01 20:58:59 +13:00
|
|
|
|
}
|
2017-05-28 10:29:33 +12:00
|
|
|
|
else if (shapeType == ShapeType.DrawingStep)
|
|
|
|
|
{
|
|
|
|
|
AnnotationOptions.StepFillColor = newColor;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
AnnotationOptions.FillColor = newColor;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
UpdateMenu();
|
|
|
|
|
UpdateCurrentShape();
|
2016-10-01 20:58:59 +13:00
|
|
|
|
}
|
|
|
|
|
|
2017-11-12 20:32:55 +13:00
|
|
|
|
Form.Resume();
|
2016-10-01 20:58:59 +13:00
|
|
|
|
};
|
2016-10-05 06:38:30 +13:00
|
|
|
|
tsMain.Items.Add(tsbFillColor);
|
|
|
|
|
|
2016-10-05 11:05:55 +13:00
|
|
|
|
tsbHighlightColor = new ToolStripButton(Resources.ShapeManager_CreateContextMenu_Highlight_color___);
|
|
|
|
|
tsbHighlightColor.DisplayStyle = ToolStripItemDisplayStyle.Image;
|
|
|
|
|
tsbHighlightColor.Click += (sender, e) =>
|
|
|
|
|
{
|
2017-11-12 20:32:55 +13:00
|
|
|
|
Form.Pause();
|
2016-10-05 11:05:55 +13:00
|
|
|
|
|
2018-06-03 00:34:52 +12:00
|
|
|
|
if (PickColor(AnnotationOptions.HighlightColor, out Color newColor))
|
2016-10-05 11:05:55 +13:00
|
|
|
|
{
|
2017-05-28 10:29:33 +12:00
|
|
|
|
AnnotationOptions.HighlightColor = newColor;
|
|
|
|
|
UpdateMenu();
|
|
|
|
|
UpdateCurrentShape();
|
2016-10-05 11:05:55 +13:00
|
|
|
|
}
|
|
|
|
|
|
2017-11-12 20:32:55 +13:00
|
|
|
|
Form.Resume();
|
2016-10-05 11:05:55 +13:00
|
|
|
|
};
|
|
|
|
|
tsMain.Items.Add(tsbHighlightColor);
|
|
|
|
|
|
2017-06-16 10:57:39 +12:00
|
|
|
|
tsddbShapeOptions = new ToolStripDropDownButton(Resources.ShapeManager_CreateToolbar_ShapeOptions);
|
2016-10-05 06:38:30 +13:00
|
|
|
|
tsddbShapeOptions.DisplayStyle = ToolStripItemDisplayStyle.Image;
|
|
|
|
|
tsddbShapeOptions.Image = Resources.layer__pencil;
|
|
|
|
|
tsMain.Items.Add(tsddbShapeOptions);
|
|
|
|
|
|
2019-05-05 18:53:03 +12:00
|
|
|
|
// TODO: Translate
|
|
|
|
|
tslnudMagnifyStrength = new ToolStripLabeledNumericUpDown("Magnify strength:");
|
2019-05-05 18:59:05 +12:00
|
|
|
|
tslnudMagnifyStrength.Content.Text2 = "%";
|
2019-05-05 18:53:03 +12:00
|
|
|
|
tslnudMagnifyStrength.Content.Minimum = 100;
|
|
|
|
|
tslnudMagnifyStrength.Content.Maximum = 1000;
|
|
|
|
|
tslnudMagnifyStrength.Content.Increment = 100;
|
|
|
|
|
tslnudMagnifyStrength.Content.ValueChanged = (sender, e) =>
|
|
|
|
|
{
|
|
|
|
|
AnnotationOptions.MagnifyStrength = (int)tslnudMagnifyStrength.Content.Value;
|
|
|
|
|
UpdateCurrentShape();
|
|
|
|
|
};
|
|
|
|
|
tsddbShapeOptions.DropDownItems.Add(tslnudMagnifyStrength);
|
|
|
|
|
|
2016-10-05 06:38:30 +13:00
|
|
|
|
tslnudBorderSize = new ToolStripLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Border_size_);
|
|
|
|
|
tslnudBorderSize.Content.Minimum = 0;
|
|
|
|
|
tslnudBorderSize.Content.Maximum = 20;
|
|
|
|
|
tslnudBorderSize.Content.ValueChanged = (sender, e) =>
|
|
|
|
|
{
|
2017-11-07 05:01:02 +13:00
|
|
|
|
ShapeType shapeType = CurrentTool;
|
2016-10-05 06:38:30 +13:00
|
|
|
|
|
|
|
|
|
int borderSize = (int)tslnudBorderSize.Content.Value;
|
|
|
|
|
|
2017-02-16 13:49:13 +13:00
|
|
|
|
if (shapeType == ShapeType.DrawingTextBackground || shapeType == ShapeType.DrawingSpeechBalloon)
|
2016-10-05 06:38:30 +13:00
|
|
|
|
{
|
|
|
|
|
AnnotationOptions.TextBorderSize = borderSize;
|
|
|
|
|
}
|
2017-02-16 13:49:13 +13:00
|
|
|
|
else if (shapeType == ShapeType.DrawingTextOutline)
|
|
|
|
|
{
|
|
|
|
|
AnnotationOptions.TextOutlineBorderSize = borderSize;
|
|
|
|
|
}
|
2016-10-05 06:38:30 +13:00
|
|
|
|
else if (shapeType == ShapeType.DrawingStep)
|
|
|
|
|
{
|
|
|
|
|
AnnotationOptions.StepBorderSize = borderSize;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
AnnotationOptions.BorderSize = borderSize;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
UpdateCurrentShape();
|
|
|
|
|
};
|
|
|
|
|
tsddbShapeOptions.DropDownItems.Add(tslnudBorderSize);
|
2016-10-01 20:58:59 +13:00
|
|
|
|
|
|
|
|
|
tslnudCornerRadius = new ToolStripLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Corner_radius_);
|
|
|
|
|
tslnudCornerRadius.Content.Minimum = 0;
|
|
|
|
|
tslnudCornerRadius.Content.Maximum = 150;
|
|
|
|
|
tslnudCornerRadius.Content.ValueChanged = (sender, e) =>
|
|
|
|
|
{
|
2017-11-07 05:01:02 +13:00
|
|
|
|
ShapeType shapeType = CurrentTool;
|
2016-10-01 20:58:59 +13:00
|
|
|
|
|
2016-12-01 04:17:12 +13:00
|
|
|
|
if (shapeType == ShapeType.RegionRectangle)
|
2016-10-01 20:58:59 +13:00
|
|
|
|
{
|
2016-12-01 04:17:12 +13:00
|
|
|
|
AnnotationOptions.RegionCornerRadius = (int)tslnudCornerRadius.Content.Value;
|
2016-10-01 20:58:59 +13:00
|
|
|
|
}
|
2017-02-16 13:49:13 +13:00
|
|
|
|
else if (shapeType == ShapeType.DrawingRectangle || shapeType == ShapeType.DrawingTextBackground)
|
2016-10-01 20:58:59 +13:00
|
|
|
|
{
|
2016-12-01 04:17:12 +13:00
|
|
|
|
AnnotationOptions.DrawingCornerRadius = (int)tslnudCornerRadius.Content.Value;
|
2016-10-01 20:58:59 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
UpdateCurrentShape();
|
|
|
|
|
};
|
|
|
|
|
tsddbShapeOptions.DropDownItems.Add(tslnudCornerRadius);
|
|
|
|
|
|
2018-01-14 02:43:06 +13:00
|
|
|
|
tscbImageInterpolationMode = new ToolStripLabeledComboBox(Resources.ShapeManager_CreateToolbar_InterpolationMode);
|
2018-01-06 18:30:04 +13:00
|
|
|
|
tscbImageInterpolationMode.Content.AddRange(Helpers.GetLocalizedEnumDescriptions<ImageEditorInterpolationMode>());
|
|
|
|
|
tscbImageInterpolationMode.Content.SelectedIndexChanged += (sender, e) =>
|
|
|
|
|
{
|
|
|
|
|
AnnotationOptions.ImageInterpolationMode = (ImageEditorInterpolationMode)tscbImageInterpolationMode.Content.SelectedIndex;
|
|
|
|
|
tscbImageInterpolationMode.Invalidate();
|
|
|
|
|
UpdateCurrentShape();
|
|
|
|
|
};
|
|
|
|
|
tsddbShapeOptions.DropDownItems.Add(tscbImageInterpolationMode);
|
|
|
|
|
|
2017-10-29 09:40:50 +13:00
|
|
|
|
tscbCursorTypes = new ToolStripLabeledComboBox(Resources.ShapeManager_CursorType);
|
2017-08-13 23:07:52 +12:00
|
|
|
|
CursorConverter cursorConverter = new CursorConverter();
|
|
|
|
|
foreach (Cursor cursor in Helpers.CursorList)
|
|
|
|
|
{
|
|
|
|
|
string name = cursorConverter.ConvertToString(cursor);
|
2017-08-28 18:26:24 +12:00
|
|
|
|
tscbCursorTypes.Content.Add(name);
|
2017-08-13 23:07:52 +12:00
|
|
|
|
}
|
2017-08-28 18:26:24 +12:00
|
|
|
|
tscbCursorTypes.Content.SelectedIndex = 3; // Cursors.Default
|
2018-05-01 01:41:39 +12:00
|
|
|
|
tscbCursorTypes.Content.SelectedIndexChanged += (sender, e) => UpdateCurrentShape();
|
2017-08-13 23:07:52 +12:00
|
|
|
|
tsddbShapeOptions.DropDownItems.Add(tscbCursorTypes);
|
|
|
|
|
|
2016-10-01 20:58:59 +13:00
|
|
|
|
tslnudBlurRadius = new ToolStripLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Blur_radius_);
|
2016-11-14 12:27:24 +13:00
|
|
|
|
tslnudBlurRadius.Content.Minimum = 3;
|
|
|
|
|
tslnudBlurRadius.Content.Maximum = 199;
|
|
|
|
|
tslnudBlurRadius.Content.Increment = 2;
|
2016-10-01 20:58:59 +13:00
|
|
|
|
tslnudBlurRadius.Content.ValueChanged = (sender, e) =>
|
|
|
|
|
{
|
|
|
|
|
AnnotationOptions.BlurRadius = (int)tslnudBlurRadius.Content.Value;
|
|
|
|
|
UpdateCurrentShape();
|
|
|
|
|
};
|
|
|
|
|
tsddbShapeOptions.DropDownItems.Add(tslnudBlurRadius);
|
|
|
|
|
|
|
|
|
|
tslnudPixelateSize = new ToolStripLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Pixel_size_);
|
|
|
|
|
tslnudPixelateSize.Content.Minimum = 2;
|
2016-11-29 02:08:17 +13:00
|
|
|
|
tslnudPixelateSize.Content.Maximum = 10000;
|
2016-10-01 20:58:59 +13:00
|
|
|
|
tslnudPixelateSize.Content.ValueChanged = (sender, e) =>
|
|
|
|
|
{
|
|
|
|
|
AnnotationOptions.PixelateSize = (int)tslnudPixelateSize.Content.Value;
|
|
|
|
|
UpdateCurrentShape();
|
|
|
|
|
};
|
|
|
|
|
tsddbShapeOptions.DropDownItems.Add(tslnudPixelateSize);
|
|
|
|
|
|
2017-10-29 09:40:50 +13:00
|
|
|
|
tslnudCenterPoints = new ToolStripLabeledNumericUpDown(Resources.ShapeManager_CenterPoints);
|
2017-08-03 03:32:51 +12:00
|
|
|
|
tslnudCenterPoints.Content.Minimum = 0;
|
|
|
|
|
tslnudCenterPoints.Content.Maximum = LineDrawingShape.MaximumCenterPointCount;
|
|
|
|
|
tslnudCenterPoints.Content.ValueChanged = (sender, e) =>
|
|
|
|
|
{
|
|
|
|
|
AnnotationOptions.LineCenterPointCount = (int)tslnudCenterPoints.Content.Value;
|
|
|
|
|
UpdateCurrentShape();
|
|
|
|
|
};
|
|
|
|
|
tsddbShapeOptions.DropDownItems.Add(tslnudCenterPoints);
|
|
|
|
|
|
2017-10-29 09:40:50 +13:00
|
|
|
|
tsmiArrowHeadsBothSide = new ToolStripMenuItem(Resources.ShapeManager_ArrowsOnBothEnds);
|
2017-08-03 04:11:12 +12:00
|
|
|
|
tsmiArrowHeadsBothSide.CheckOnClick = true;
|
|
|
|
|
tsmiArrowHeadsBothSide.Click += (sender, e) =>
|
|
|
|
|
{
|
|
|
|
|
AnnotationOptions.ArrowHeadsBothSide = tsmiArrowHeadsBothSide.Checked;
|
|
|
|
|
UpdateCurrentShape();
|
|
|
|
|
};
|
|
|
|
|
tsddbShapeOptions.DropDownItems.Add(tsmiArrowHeadsBothSide);
|
|
|
|
|
|
2018-01-14 02:43:06 +13:00
|
|
|
|
tslnudStepFontSize = new ToolStripLabeledNumericUpDown(Resources.ShapeManager_CreateToolbar_FontSize);
|
2017-12-08 09:17:36 +13:00
|
|
|
|
tslnudStepFontSize.Content.Minimum = 10;
|
|
|
|
|
tslnudStepFontSize.Content.Maximum = 100;
|
|
|
|
|
tslnudStepFontSize.Content.ValueChanged = (sender, e) =>
|
|
|
|
|
{
|
|
|
|
|
AnnotationOptions.StepFontSize = (int)tslnudStepFontSize.Content.Value;
|
|
|
|
|
UpdateCurrentShape();
|
|
|
|
|
};
|
|
|
|
|
tsddbShapeOptions.DropDownItems.Add(tslnudStepFontSize);
|
|
|
|
|
|
2018-09-18 06:05:09 +12:00
|
|
|
|
tslnudStartingStepValue = new ToolStripLabeledNumericUpDown(Resources.ShapeManager_CreateToolbar_StartingStepValue);
|
|
|
|
|
tslnudStartingStepValue.Content.Minimum = 1;
|
|
|
|
|
tslnudStartingStepValue.Content.Maximum = 10000;
|
|
|
|
|
tslnudStartingStepValue.Content.ValueChanged = (sender, e) =>
|
|
|
|
|
{
|
2018-09-20 04:35:58 +12:00
|
|
|
|
StartingStepNumber = (int)tslnudStartingStepValue.Content.Value;
|
2018-09-18 06:05:09 +12:00
|
|
|
|
UpdateCurrentShape();
|
|
|
|
|
};
|
|
|
|
|
tsddbShapeOptions.DropDownItems.Add(tslnudStartingStepValue);
|
|
|
|
|
|
2018-01-14 02:43:06 +13:00
|
|
|
|
tsmiStepUseLetters = new ToolStripMenuItem(Resources.ShapeManager_CreateToolbar_UseLetters);
|
2017-12-28 03:48:51 +13:00
|
|
|
|
tsmiStepUseLetters.Checked = false;
|
|
|
|
|
tsmiStepUseLetters.CheckOnClick = true;
|
|
|
|
|
tsmiStepUseLetters.Click += (sender, e) =>
|
|
|
|
|
{
|
|
|
|
|
AnnotationOptions.StepUseLetters = tsmiStepUseLetters.Checked;
|
|
|
|
|
UpdateCurrentShape();
|
|
|
|
|
};
|
|
|
|
|
tsddbShapeOptions.DropDownItems.Add(tsmiStepUseLetters);
|
|
|
|
|
|
2017-06-16 10:57:39 +12:00
|
|
|
|
tsmiShadow = new ToolStripMenuItem(Resources.ShapeManager_CreateToolbar_DropShadow);
|
2016-11-30 10:11:39 +13:00
|
|
|
|
tsmiShadow.Checked = true;
|
|
|
|
|
tsmiShadow.CheckOnClick = true;
|
|
|
|
|
tsmiShadow.Click += (sender, e) =>
|
|
|
|
|
{
|
|
|
|
|
AnnotationOptions.Shadow = tsmiShadow.Checked;
|
|
|
|
|
UpdateCurrentShape();
|
|
|
|
|
};
|
|
|
|
|
tsddbShapeOptions.DropDownItems.Add(tsmiShadow);
|
|
|
|
|
|
2018-10-25 14:00:47 +13:00
|
|
|
|
tsmiShadowColor = new ToolStripMenuItem(Resources.DropShadowColor);
|
2018-01-31 06:14:28 +13:00
|
|
|
|
tsmiShadowColor.Click += (sender, e) =>
|
|
|
|
|
{
|
|
|
|
|
Form.Pause();
|
|
|
|
|
|
2018-06-03 00:34:52 +12:00
|
|
|
|
if (PickColor(AnnotationOptions.ShadowColor, out Color newColor))
|
2018-01-31 06:14:28 +13:00
|
|
|
|
{
|
|
|
|
|
AnnotationOptions.ShadowColor = newColor;
|
|
|
|
|
UpdateMenu();
|
|
|
|
|
UpdateCurrentShape();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Form.Resume();
|
|
|
|
|
};
|
|
|
|
|
tsddbShapeOptions.DropDownItems.Add(tsmiShadowColor);
|
|
|
|
|
|
2016-10-05 11:40:22 +13:00
|
|
|
|
// In dropdown menu if only last item is visible then menu opens at 0, 0 position on first open, so need to add dummy item to solve this weird bug...
|
|
|
|
|
tsddbShapeOptions.DropDownItems.Add(new ToolStripSeparator() { Visible = false });
|
|
|
|
|
|
2016-12-02 01:24:19 +13:00
|
|
|
|
#endregion Shape options
|
2016-10-01 20:58:59 +13:00
|
|
|
|
|
2016-12-02 01:24:19 +13:00
|
|
|
|
#region Edit
|
2016-10-01 20:58:59 +13:00
|
|
|
|
|
2017-06-16 10:57:39 +12:00
|
|
|
|
ToolStripDropDownButton tsddbEdit = new ToolStripDropDownButton(Resources.ShapeManager_CreateToolbar_Edit);
|
2016-12-02 01:24:19 +13:00
|
|
|
|
tsddbEdit.DisplayStyle = ToolStripItemDisplayStyle.Image;
|
|
|
|
|
tsddbEdit.Image = Resources.wrench_screwdriver;
|
|
|
|
|
tsMain.Items.Add(tsddbEdit);
|
|
|
|
|
|
2017-06-16 10:57:39 +12:00
|
|
|
|
tsmiUndo = new ToolStripMenuItem(Resources.ShapeManager_CreateToolbar_Undo);
|
2016-12-02 03:34:53 +13:00
|
|
|
|
tsmiUndo.Image = Resources.arrow_circle_225_left;
|
|
|
|
|
tsmiUndo.ShortcutKeyDisplayString = "Ctrl+Z";
|
2017-12-01 21:08:32 +13:00
|
|
|
|
tsmiUndo.Click += (sender, e) => UndoShape();
|
2016-12-02 03:34:53 +13:00
|
|
|
|
tsddbEdit.DropDownItems.Add(tsmiUndo);
|
2016-12-02 01:24:19 +13:00
|
|
|
|
|
2017-12-06 04:44:38 +13:00
|
|
|
|
ToolStripMenuItem tsmiPaste = new ToolStripMenuItem(Resources.ShapeManager_CreateToolbar_PasteImageText);
|
2017-12-01 20:58:53 +13:00
|
|
|
|
tsmiPaste.Image = Resources.clipboard;
|
|
|
|
|
tsmiPaste.ShortcutKeyDisplayString = "Ctrl+V";
|
2017-12-01 21:08:32 +13:00
|
|
|
|
tsmiPaste.Click += (sender, e) => PasteFromClipboard(false);
|
2017-12-01 20:58:53 +13:00
|
|
|
|
tsddbEdit.DropDownItems.Add(tsmiPaste);
|
|
|
|
|
|
2016-12-02 01:24:19 +13:00
|
|
|
|
tsddbEdit.DropDownItems.Add(new ToolStripSeparator());
|
|
|
|
|
|
2017-06-16 10:57:39 +12:00
|
|
|
|
tsmiDelete = new ToolStripMenuItem(Resources.ShapeManager_CreateToolbar_Delete);
|
2016-12-02 03:34:53 +13:00
|
|
|
|
tsmiDelete.Image = Resources.layer__minus;
|
|
|
|
|
tsmiDelete.ShortcutKeyDisplayString = "Del";
|
2017-12-01 21:08:32 +13:00
|
|
|
|
tsmiDelete.Click += (sender, e) => DeleteCurrentShape();
|
2016-12-02 03:34:53 +13:00
|
|
|
|
tsddbEdit.DropDownItems.Add(tsmiDelete);
|
2016-12-02 01:24:19 +13:00
|
|
|
|
|
2017-06-16 10:57:39 +12:00
|
|
|
|
tsmiDeleteAll = new ToolStripMenuItem(Resources.ShapeManager_CreateToolbar_DeleteAll);
|
2016-12-02 01:24:19 +13:00
|
|
|
|
tsmiDeleteAll.Image = Resources.eraser;
|
2016-12-15 05:38:07 +13:00
|
|
|
|
tsmiDeleteAll.ShortcutKeyDisplayString = "Shift+Del";
|
2017-12-01 21:08:32 +13:00
|
|
|
|
tsmiDeleteAll.Click += (sender, e) => DeleteAllShapes();
|
2016-12-02 01:24:19 +13:00
|
|
|
|
tsddbEdit.DropDownItems.Add(tsmiDeleteAll);
|
|
|
|
|
|
|
|
|
|
tsddbEdit.DropDownItems.Add(new ToolStripSeparator());
|
|
|
|
|
|
2017-06-16 10:57:39 +12:00
|
|
|
|
tsmiMoveTop = new ToolStripMenuItem(Resources.ShapeManager_CreateToolbar_BringToFront);
|
2016-12-02 01:24:19 +13:00
|
|
|
|
tsmiMoveTop.Image = Resources.layers_stack_arrange;
|
|
|
|
|
tsmiMoveTop.ShortcutKeyDisplayString = "Home";
|
2017-12-01 21:08:32 +13:00
|
|
|
|
tsmiMoveTop.Click += (sender, e) => MoveCurrentShapeTop();
|
2016-12-02 01:24:19 +13:00
|
|
|
|
tsddbEdit.DropDownItems.Add(tsmiMoveTop);
|
|
|
|
|
|
2017-06-16 10:57:39 +12:00
|
|
|
|
tsmiMoveUp = new ToolStripMenuItem(Resources.ShapeManager_CreateToolbar_BringForward);
|
2016-12-02 01:24:19 +13:00
|
|
|
|
tsmiMoveUp.Image = Resources.layers_arrange;
|
|
|
|
|
tsmiMoveUp.ShortcutKeyDisplayString = "Page up";
|
2017-12-01 21:08:32 +13:00
|
|
|
|
tsmiMoveUp.Click += (sender, e) => MoveCurrentShapeUp();
|
2016-12-02 01:24:19 +13:00
|
|
|
|
tsddbEdit.DropDownItems.Add(tsmiMoveUp);
|
|
|
|
|
|
2017-06-16 10:57:39 +12:00
|
|
|
|
tsmiMoveDown = new ToolStripMenuItem(Resources.ShapeManager_CreateToolbar_SendBackward);
|
2016-12-02 01:24:19 +13:00
|
|
|
|
tsmiMoveDown.Image = Resources.layers_arrange_back;
|
|
|
|
|
tsmiMoveDown.ShortcutKeyDisplayString = "Page down";
|
2017-12-01 21:08:32 +13:00
|
|
|
|
tsmiMoveDown.Click += (sender, e) => MoveCurrentShapeDown();
|
2016-12-02 01:24:19 +13:00
|
|
|
|
tsddbEdit.DropDownItems.Add(tsmiMoveDown);
|
|
|
|
|
|
2017-06-16 10:57:39 +12:00
|
|
|
|
tsmiMoveBottom = new ToolStripMenuItem(Resources.ShapeManager_CreateToolbar_SendToBack);
|
2016-12-02 01:24:19 +13:00
|
|
|
|
tsmiMoveBottom.Image = Resources.layers_stack_arrange_back;
|
|
|
|
|
tsmiMoveBottom.ShortcutKeyDisplayString = "End";
|
2017-12-01 21:08:32 +13:00
|
|
|
|
tsmiMoveBottom.Click += (sender, e) => MoveCurrentShapeBottom();
|
2016-12-02 01:24:19 +13:00
|
|
|
|
tsddbEdit.DropDownItems.Add(tsmiMoveBottom);
|
|
|
|
|
|
2017-10-22 10:28:20 +13:00
|
|
|
|
#endregion Edit
|
|
|
|
|
|
2017-11-12 20:32:55 +13:00
|
|
|
|
if (Form.IsEditorMode)
|
2017-10-22 10:28:20 +13:00
|
|
|
|
{
|
|
|
|
|
#region Image
|
2017-10-21 12:15:23 +13:00
|
|
|
|
|
2017-10-29 09:40:50 +13:00
|
|
|
|
ToolStripDropDownButton tsddbImage = new ToolStripDropDownButton(Resources.ShapeManager_CreateToolbar_Image);
|
2017-10-22 10:28:20 +13:00
|
|
|
|
tsddbImage.DisplayStyle = ToolStripItemDisplayStyle.Image;
|
|
|
|
|
tsddbImage.Image = Resources.image__pencil;
|
|
|
|
|
tsMain.Items.Add(tsddbImage);
|
2017-10-21 12:15:23 +13:00
|
|
|
|
|
2018-01-14 02:43:06 +13:00
|
|
|
|
ToolStripMenuItem tsmiNewImage = new ToolStripMenuItem(Resources.ShapeManager_CreateToolbar_NewImage);
|
2017-12-25 22:18:04 +13:00
|
|
|
|
tsmiNewImage.Image = Resources.image_empty;
|
2018-01-09 23:00:56 +13:00
|
|
|
|
tsmiNewImage.Click += (sender, e) => NewImage();
|
2017-12-25 07:02:08 +13:00
|
|
|
|
tsddbImage.DropDownItems.Add(tsmiNewImage);
|
|
|
|
|
|
2018-01-14 02:43:06 +13:00
|
|
|
|
ToolStripMenuItem tsmiOpenImage = new ToolStripMenuItem(Resources.ShapeManager_CreateToolbar_OpenImageFile);
|
2017-12-25 08:04:12 +13:00
|
|
|
|
tsmiOpenImage.Image = Resources.folder_open_image;
|
2017-12-26 05:48:41 +13:00
|
|
|
|
tsmiOpenImage.Click += (sender, e) => OpenImageFile();
|
2017-12-25 08:04:12 +13:00
|
|
|
|
tsddbImage.DropDownItems.Add(tsmiOpenImage);
|
|
|
|
|
|
2018-01-14 02:43:06 +13:00
|
|
|
|
ToolStripMenuItem tsmiInsertImageFile = new ToolStripMenuItem(Resources.ShapeManager_CreateToolbar_InsertImageFile);
|
2018-01-01 07:39:13 +13:00
|
|
|
|
tsmiInsertImageFile.Image = Resources.image__plus;
|
|
|
|
|
tsmiInsertImageFile.Click += (sender, e) => InsertImageFile();
|
|
|
|
|
tsddbImage.DropDownItems.Add(tsmiInsertImageFile);
|
|
|
|
|
|
2018-01-14 02:43:06 +13:00
|
|
|
|
ToolStripMenuItem tsmiInsertImageFromScreen = new ToolStripMenuItem(Resources.ShapeManager_CreateToolbar_InsertImageFromScreen);
|
2018-01-01 07:39:13 +13:00
|
|
|
|
tsmiInsertImageFromScreen.Image = Resources.camera;
|
|
|
|
|
tsmiInsertImageFromScreen.Click += (sender, e) => InsertImageFromScreen();
|
|
|
|
|
tsddbImage.DropDownItems.Add(tsmiInsertImageFromScreen);
|
2017-12-25 22:18:04 +13:00
|
|
|
|
|
2017-12-25 07:02:08 +13:00
|
|
|
|
tsddbImage.DropDownItems.Add(new ToolStripSeparator());
|
|
|
|
|
|
2017-10-29 09:40:50 +13:00
|
|
|
|
ToolStripMenuItem tsmiImageSize = new ToolStripMenuItem(Resources.ShapeManager_CreateToolbar_ImageSize);
|
2017-12-25 23:00:15 +13:00
|
|
|
|
tsmiImageSize.Image = Resources.image_select;
|
2017-12-01 21:08:32 +13:00
|
|
|
|
tsmiImageSize.Click += (sender, e) => ChangeImageSize();
|
2017-10-22 11:33:00 +13:00
|
|
|
|
tsddbImage.DropDownItems.Add(tsmiImageSize);
|
2017-10-22 10:51:18 +13:00
|
|
|
|
|
2017-10-29 09:40:50 +13:00
|
|
|
|
ToolStripMenuItem tsmiCanvasSize = new ToolStripMenuItem(Resources.ShapeManager_CreateToolbar_CanvasSize);
|
2017-12-25 23:00:15 +13:00
|
|
|
|
tsmiCanvasSize.Image = Resources.image_resize;
|
2017-12-01 21:08:32 +13:00
|
|
|
|
tsmiCanvasSize.Click += (sender, e) => ChangeCanvasSize();
|
2017-10-22 10:28:20 +13:00
|
|
|
|
tsddbImage.DropDownItems.Add(tsmiCanvasSize);
|
|
|
|
|
|
2018-01-14 02:43:06 +13:00
|
|
|
|
ToolStripMenuItem tsmiCropImage = new ToolStripMenuItem(Resources.ShapeManager_CreateToolbar_CropImage);
|
2017-12-25 23:00:15 +13:00
|
|
|
|
tsmiCropImage.Image = Resources.image_crop;
|
|
|
|
|
tsmiCropImage.Click += (sender, e) => AddCropTool();
|
|
|
|
|
tsddbImage.DropDownItems.Add(tsmiCropImage);
|
|
|
|
|
|
2017-12-06 04:44:38 +13:00
|
|
|
|
ToolStripMenuItem tsmiAutoCropImage = new ToolStripMenuItem(Resources.ShapeManager_CreateToolbar_AutoCropImage);
|
2017-12-25 23:00:15 +13:00
|
|
|
|
tsmiAutoCropImage.Image = Resources.image_resize_actual;
|
2017-12-01 21:08:32 +13:00
|
|
|
|
tsmiAutoCropImage.Click += (sender, e) => AutoCropImage();
|
2017-11-29 08:10:45 +13:00
|
|
|
|
tsddbImage.DropDownItems.Add(tsmiAutoCropImage);
|
|
|
|
|
|
2017-10-22 10:51:18 +13:00
|
|
|
|
tsddbImage.DropDownItems.Add(new ToolStripSeparator());
|
|
|
|
|
|
2017-10-29 09:40:50 +13:00
|
|
|
|
ToolStripMenuItem tsmiRotate90Clockwise = new ToolStripMenuItem(Resources.ShapeManager_CreateToolbar_Rotate90Clockwise);
|
2017-10-22 10:51:18 +13:00
|
|
|
|
tsmiRotate90Clockwise.Image = Resources.arrow_circle;
|
2017-12-01 21:08:32 +13:00
|
|
|
|
tsmiRotate90Clockwise.Click += (sender, e) => RotateImage(RotateFlipType.Rotate90FlipNone);
|
2017-10-22 10:51:18 +13:00
|
|
|
|
tsddbImage.DropDownItems.Add(tsmiRotate90Clockwise);
|
|
|
|
|
|
2017-10-29 09:40:50 +13:00
|
|
|
|
ToolStripMenuItem tsmiRotate90CounterClockwise = new ToolStripMenuItem(Resources.ShapeManager_CreateToolbar_Rotate90CounterClockwise);
|
2017-10-22 10:51:18 +13:00
|
|
|
|
tsmiRotate90CounterClockwise.Image = Resources.arrow_circle_135_left;
|
2017-12-01 21:08:32 +13:00
|
|
|
|
tsmiRotate90CounterClockwise.Click += (sender, e) => RotateImage(RotateFlipType.Rotate270FlipNone);
|
2017-10-22 10:51:18 +13:00
|
|
|
|
tsddbImage.DropDownItems.Add(tsmiRotate90CounterClockwise);
|
|
|
|
|
|
2017-10-29 09:40:50 +13:00
|
|
|
|
ToolStripMenuItem tsmiRotate180 = new ToolStripMenuItem(Resources.ShapeManager_CreateToolbar_Rotate180);
|
2017-10-22 10:51:18 +13:00
|
|
|
|
tsmiRotate180.Image = Resources.arrow_circle_double;
|
2017-12-01 21:08:32 +13:00
|
|
|
|
tsmiRotate180.Click += (sender, e) => RotateImage(RotateFlipType.Rotate180FlipNone);
|
2017-10-22 10:51:18 +13:00
|
|
|
|
tsddbImage.DropDownItems.Add(tsmiRotate180);
|
|
|
|
|
|
|
|
|
|
tsddbImage.DropDownItems.Add(new ToolStripSeparator());
|
|
|
|
|
|
2017-10-29 09:40:50 +13:00
|
|
|
|
ToolStripMenuItem tsmiFlipHorizontal = new ToolStripMenuItem(Resources.ShapeManager_CreateToolbar_FlipHorizontal);
|
2017-10-22 10:51:18 +13:00
|
|
|
|
tsmiFlipHorizontal.Image = Resources.layer_flip;
|
2017-12-01 21:08:32 +13:00
|
|
|
|
tsmiFlipHorizontal.Click += (sender, e) => RotateImage(RotateFlipType.RotateNoneFlipX);
|
2017-10-22 10:51:18 +13:00
|
|
|
|
tsddbImage.DropDownItems.Add(tsmiFlipHorizontal);
|
|
|
|
|
|
2017-10-29 09:40:50 +13:00
|
|
|
|
ToolStripMenuItem tsmiFlipVertical = new ToolStripMenuItem(Resources.ShapeManager_CreateToolbar_FlipVertical);
|
2017-10-22 10:51:18 +13:00
|
|
|
|
tsmiFlipVertical.Image = Resources.layer_flip_vertical;
|
2017-12-01 21:08:32 +13:00
|
|
|
|
tsmiFlipVertical.Click += (sender, e) => RotateImage(RotateFlipType.RotateNoneFlipY);
|
2017-10-22 10:51:18 +13:00
|
|
|
|
tsddbImage.DropDownItems.Add(tsmiFlipVertical);
|
|
|
|
|
|
2018-01-20 10:36:05 +13:00
|
|
|
|
tsddbImage.DropDownItems.Add(new ToolStripSeparator());
|
|
|
|
|
|
2018-10-25 14:00:47 +13:00
|
|
|
|
ToolStripMenuItem tsmiAddImageEffects = new ToolStripMenuItem(Resources.ImageEffects);
|
2018-01-20 10:36:05 +13:00
|
|
|
|
tsmiAddImageEffects.Image = Resources.image_saturation;
|
|
|
|
|
tsmiAddImageEffects.Click += (sender, e) => AddImageEffects();
|
|
|
|
|
tsddbImage.DropDownItems.Add(tsmiAddImageEffects);
|
|
|
|
|
|
2018-03-01 11:52:11 +13:00
|
|
|
|
#endregion Image
|
2017-10-22 10:28:20 +13:00
|
|
|
|
}
|
2016-10-01 20:58:59 +13:00
|
|
|
|
|
2017-10-25 13:53:53 +13:00
|
|
|
|
tsMain.Items.Add(new ToolStripSeparator());
|
2016-10-01 20:58:59 +13:00
|
|
|
|
|
2017-11-12 20:32:55 +13:00
|
|
|
|
if (!Form.IsEditorMode)
|
2017-10-27 20:42:57 +13:00
|
|
|
|
{
|
|
|
|
|
#region Capture
|
2016-12-02 04:11:26 +13:00
|
|
|
|
|
2017-10-27 20:42:57 +13:00
|
|
|
|
ToolStripDropDownButton tsddbCapture = new ToolStripDropDownButton(Resources.ShapeManager_CreateContextMenu_Capture);
|
|
|
|
|
tsddbCapture.DisplayStyle = ToolStripItemDisplayStyle.Image;
|
|
|
|
|
tsddbCapture.Image = Resources.camera;
|
|
|
|
|
tsMain.Items.Add(tsddbCapture);
|
2016-10-04 00:56:30 +13:00
|
|
|
|
|
2017-10-27 20:42:57 +13:00
|
|
|
|
tsmiRegionCapture = new ToolStripMenuItem(Resources.ShapeManager_CreateToolbar_CaptureRegions);
|
|
|
|
|
tsmiRegionCapture.Image = Resources.layer;
|
|
|
|
|
tsmiRegionCapture.ShortcutKeyDisplayString = "Enter";
|
2017-12-01 21:08:32 +13:00
|
|
|
|
tsmiRegionCapture.Click += (sender, e) =>
|
2017-10-27 20:42:57 +13:00
|
|
|
|
{
|
2017-11-12 20:32:55 +13:00
|
|
|
|
Form.UpdateRegionPath();
|
2018-03-28 03:35:00 +13:00
|
|
|
|
Form.CloseWindow(RegionResult.Region);
|
2017-10-27 20:42:57 +13:00
|
|
|
|
};
|
|
|
|
|
tsddbCapture.DropDownItems.Add(tsmiRegionCapture);
|
2016-10-04 01:13:53 +13:00
|
|
|
|
|
2017-10-27 20:42:57 +13:00
|
|
|
|
if (RegionCaptureForm.LastRegionFillPath != null)
|
|
|
|
|
{
|
|
|
|
|
ToolStripMenuItem tsmiLastRegionCapture = new ToolStripMenuItem(Resources.ShapeManager_CreateToolbar_LastRegion);
|
|
|
|
|
tsmiLastRegionCapture.Image = Resources.layers;
|
2018-03-28 03:35:00 +13:00
|
|
|
|
tsmiLastRegionCapture.Click += (sender, e) => Form.CloseWindow(RegionResult.LastRegion);
|
2017-10-27 20:42:57 +13:00
|
|
|
|
tsddbCapture.DropDownItems.Add(tsmiLastRegionCapture);
|
|
|
|
|
}
|
2016-11-19 12:36:14 +13:00
|
|
|
|
|
2017-10-27 20:42:57 +13:00
|
|
|
|
ToolStripMenuItem tsmiFullscreenCapture = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Capture_fullscreen);
|
|
|
|
|
tsmiFullscreenCapture.Image = Resources.layer_fullscreen;
|
|
|
|
|
tsmiFullscreenCapture.ShortcutKeyDisplayString = "Space";
|
2018-03-28 03:35:00 +13:00
|
|
|
|
tsmiFullscreenCapture.Click += (sender, e) => Form.CloseWindow(RegionResult.Fullscreen);
|
2017-10-27 20:42:57 +13:00
|
|
|
|
tsddbCapture.DropDownItems.Add(tsmiFullscreenCapture);
|
2016-10-04 00:56:30 +13:00
|
|
|
|
|
2017-10-27 20:42:57 +13:00
|
|
|
|
ToolStripMenuItem tsmiActiveMonitorCapture = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Capture_active_monitor);
|
|
|
|
|
tsmiActiveMonitorCapture.Image = Resources.monitor;
|
|
|
|
|
tsmiActiveMonitorCapture.ShortcutKeyDisplayString = "~";
|
2018-03-28 03:35:00 +13:00
|
|
|
|
tsmiActiveMonitorCapture.Click += (sender, e) => Form.CloseWindow(RegionResult.ActiveMonitor);
|
2017-10-27 20:42:57 +13:00
|
|
|
|
tsddbCapture.DropDownItems.Add(tsmiActiveMonitorCapture);
|
2016-10-04 00:56:30 +13:00
|
|
|
|
|
2017-10-27 20:42:57 +13:00
|
|
|
|
ToolStripMenuItem tsmiMonitorCapture = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Capture_monitor);
|
|
|
|
|
tsmiMonitorCapture.HideImageMargin();
|
|
|
|
|
tsmiMonitorCapture.Image = Resources.monitor_window;
|
|
|
|
|
tsddbCapture.DropDownItems.Add(tsmiMonitorCapture);
|
2016-10-01 20:58:59 +13:00
|
|
|
|
|
2017-10-27 20:42:57 +13:00
|
|
|
|
Screen[] screens = Screen.AllScreens;
|
2016-10-01 20:58:59 +13:00
|
|
|
|
|
2017-10-27 20:42:57 +13:00
|
|
|
|
for (int i = 0; i < screens.Length; i++)
|
2016-10-01 20:58:59 +13:00
|
|
|
|
{
|
2017-10-27 20:42:57 +13:00
|
|
|
|
Screen screen = screens[i];
|
|
|
|
|
ToolStripMenuItem tsmi = new ToolStripMenuItem($"{screen.Bounds.Width}x{screen.Bounds.Height}");
|
|
|
|
|
tsmi.ShortcutKeyDisplayString = (i + 1).ToString();
|
|
|
|
|
int index = i;
|
2017-12-01 21:08:32 +13:00
|
|
|
|
tsmi.Click += (sender, e) =>
|
2017-10-27 20:42:57 +13:00
|
|
|
|
{
|
2017-11-12 20:32:55 +13:00
|
|
|
|
Form.MonitorIndex = index;
|
2018-03-28 03:35:00 +13:00
|
|
|
|
Form.CloseWindow(RegionResult.Monitor);
|
2017-10-27 20:42:57 +13:00
|
|
|
|
};
|
|
|
|
|
tsmiMonitorCapture.DropDownItems.Add(tsmi);
|
|
|
|
|
}
|
2016-10-01 20:58:59 +13:00
|
|
|
|
|
2017-10-27 20:42:57 +13:00
|
|
|
|
#endregion Capture
|
|
|
|
|
}
|
2016-10-01 20:58:59 +13:00
|
|
|
|
|
2017-10-25 13:53:53 +13:00
|
|
|
|
#region Options
|
2016-10-01 20:58:59 +13:00
|
|
|
|
|
2017-10-25 13:53:53 +13:00
|
|
|
|
ToolStripDropDownButton tsddbOptions = new ToolStripDropDownButton(Resources.ShapeManager_CreateContextMenu_Options);
|
|
|
|
|
tsddbOptions.DisplayStyle = ToolStripItemDisplayStyle.Image;
|
|
|
|
|
tsddbOptions.Image = Resources.gear;
|
|
|
|
|
tsMain.Items.Add(tsddbOptions);
|
2016-10-01 20:58:59 +13:00
|
|
|
|
|
2017-11-12 20:32:55 +13:00
|
|
|
|
if (Form.IsEditorMode)
|
2017-10-27 12:25:57 +13:00
|
|
|
|
{
|
2017-11-21 23:22:55 +13:00
|
|
|
|
ToolStripLabeledComboBox tscbImageEditorStartMode = new ToolStripLabeledComboBox(Resources.ShapeManager_CreateToolbar_EditorStartMode);
|
|
|
|
|
tscbImageEditorStartMode.Content.AddRange(Helpers.GetLocalizedEnumDescriptions<ImageEditorStartMode>());
|
2017-11-13 09:44:18 +13:00
|
|
|
|
tscbImageEditorStartMode.Content.SelectedIndex = (int)Options.ImageEditorStartMode;
|
|
|
|
|
tscbImageEditorStartMode.Content.SelectedIndexChanged +=
|
|
|
|
|
(sender, e) => Options.ImageEditorStartMode = (ImageEditorStartMode)tscbImageEditorStartMode.Content.SelectedIndex;
|
|
|
|
|
tsddbOptions.DropDownItems.Add(tscbImageEditorStartMode);
|
|
|
|
|
|
2018-01-14 02:43:06 +13:00
|
|
|
|
ToolStripMenuItem tsmiAutoCloseEditorOnTask = new ToolStripMenuItem(Resources.ShapeManager_CreateToolbar_AutoCloseEditorOnTask);
|
2017-12-24 22:01:16 +13:00
|
|
|
|
tsmiAutoCloseEditorOnTask.Checked = Options.AutoCloseEditorOnTask;
|
|
|
|
|
tsmiAutoCloseEditorOnTask.CheckOnClick = true;
|
|
|
|
|
tsmiAutoCloseEditorOnTask.Click += (sender, e) => Options.AutoCloseEditorOnTask = tsmiAutoCloseEditorOnTask.Checked;
|
|
|
|
|
tsddbOptions.DropDownItems.Add(tsmiAutoCloseEditorOnTask);
|
|
|
|
|
|
2017-11-13 09:44:18 +13:00
|
|
|
|
tsmiImageEditorBackgroundColor = new ToolStripMenuItem(Resources.ShapeManager_CreateToolbar_EditorBackgroundColor);
|
|
|
|
|
tsmiImageEditorBackgroundColor.Click += (sender, e) =>
|
2017-11-07 08:10:46 +13:00
|
|
|
|
{
|
2017-11-12 20:32:55 +13:00
|
|
|
|
Form.Pause();
|
2017-11-07 08:10:46 +13:00
|
|
|
|
|
2018-06-03 00:34:52 +12:00
|
|
|
|
if (PickColor(Options.ImageEditorBackgroundColor, out Color newColor))
|
2017-11-07 08:10:46 +13:00
|
|
|
|
{
|
2017-11-13 09:44:18 +13:00
|
|
|
|
Options.ImageEditorBackgroundColor = newColor;
|
2017-11-09 07:24:25 +13:00
|
|
|
|
UpdateMenu();
|
2017-11-07 08:10:46 +13:00
|
|
|
|
}
|
|
|
|
|
|
2017-11-12 20:32:55 +13:00
|
|
|
|
Form.Resume();
|
2017-11-07 08:10:46 +13:00
|
|
|
|
};
|
2017-11-13 09:44:18 +13:00
|
|
|
|
tsddbOptions.DropDownItems.Add(tsmiImageEditorBackgroundColor);
|
2017-11-07 08:10:46 +13:00
|
|
|
|
|
2017-10-27 12:25:57 +13:00
|
|
|
|
tsddbOptions.DropDownItems.Add(new ToolStripSeparator());
|
|
|
|
|
}
|
|
|
|
|
|
2017-11-12 20:32:55 +13:00
|
|
|
|
if (!Form.IsEditorMode)
|
2017-10-25 13:53:53 +13:00
|
|
|
|
{
|
2016-10-01 20:58:59 +13:00
|
|
|
|
tsmiQuickCrop = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Multi_region_mode);
|
2017-11-07 05:01:02 +13:00
|
|
|
|
tsmiQuickCrop.Checked = !Options.QuickCrop;
|
2016-10-01 20:58:59 +13:00
|
|
|
|
tsmiQuickCrop.CheckOnClick = true;
|
2016-12-02 04:11:26 +13:00
|
|
|
|
tsmiQuickCrop.ShortcutKeyDisplayString = "Q";
|
2017-11-07 05:01:02 +13:00
|
|
|
|
tsmiQuickCrop.Click += (sender, e) => Options.QuickCrop = !tsmiQuickCrop.Checked;
|
2016-10-01 20:58:59 +13:00
|
|
|
|
tsddbOptions.DropDownItems.Add(tsmiQuickCrop);
|
2017-10-25 13:53:53 +13:00
|
|
|
|
}
|
2016-10-01 20:58:59 +13:00
|
|
|
|
|
2017-10-25 13:53:53 +13:00
|
|
|
|
ToolStripMenuItem tsmiShowInfo = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Show_position_and_size_info);
|
2017-11-07 05:01:02 +13:00
|
|
|
|
tsmiShowInfo.Checked = Options.ShowInfo;
|
2017-10-25 13:53:53 +13:00
|
|
|
|
tsmiShowInfo.CheckOnClick = true;
|
2017-11-07 05:01:02 +13:00
|
|
|
|
tsmiShowInfo.Click += (sender, e) => Options.ShowInfo = tsmiShowInfo.Checked;
|
2017-10-25 13:53:53 +13:00
|
|
|
|
tsddbOptions.DropDownItems.Add(tsmiShowInfo);
|
|
|
|
|
|
2018-05-01 04:45:35 +12:00
|
|
|
|
tsmiShowMagnifier = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Show_magnifier);
|
2017-11-07 05:01:02 +13:00
|
|
|
|
tsmiShowMagnifier.Checked = Options.ShowMagnifier;
|
2017-10-25 13:53:53 +13:00
|
|
|
|
tsmiShowMagnifier.CheckOnClick = true;
|
2017-11-07 05:01:02 +13:00
|
|
|
|
tsmiShowMagnifier.Click += (sender, e) => Options.ShowMagnifier = tsmiShowMagnifier.Checked;
|
2017-10-25 13:53:53 +13:00
|
|
|
|
tsddbOptions.DropDownItems.Add(tsmiShowMagnifier);
|
|
|
|
|
|
|
|
|
|
ToolStripMenuItem tsmiUseSquareMagnifier = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Square_shape_magnifier);
|
2017-11-07 05:01:02 +13:00
|
|
|
|
tsmiUseSquareMagnifier.Checked = Options.UseSquareMagnifier;
|
2017-10-25 13:53:53 +13:00
|
|
|
|
tsmiUseSquareMagnifier.CheckOnClick = true;
|
2017-11-07 05:01:02 +13:00
|
|
|
|
tsmiUseSquareMagnifier.Click += (sender, e) => Options.UseSquareMagnifier = tsmiUseSquareMagnifier.Checked;
|
2017-10-25 13:53:53 +13:00
|
|
|
|
tsddbOptions.DropDownItems.Add(tsmiUseSquareMagnifier);
|
|
|
|
|
|
2018-05-01 04:45:35 +12:00
|
|
|
|
tslnudMagnifierPixelCount = new ToolStripLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Magnifier_pixel_count_);
|
2017-10-25 13:53:53 +13:00
|
|
|
|
tslnudMagnifierPixelCount.Content.Minimum = RegionCaptureOptions.MagnifierPixelCountMinimum;
|
|
|
|
|
tslnudMagnifierPixelCount.Content.Maximum = RegionCaptureOptions.MagnifierPixelCountMaximum;
|
|
|
|
|
tslnudMagnifierPixelCount.Content.Increment = 2;
|
2017-11-07 05:01:02 +13:00
|
|
|
|
tslnudMagnifierPixelCount.Content.Value = Options.MagnifierPixelCount;
|
|
|
|
|
tslnudMagnifierPixelCount.Content.ValueChanged = (sender, e) => Options.MagnifierPixelCount = (int)tslnudMagnifierPixelCount.Content.Value;
|
2017-10-25 13:53:53 +13:00
|
|
|
|
tsddbOptions.DropDownItems.Add(tslnudMagnifierPixelCount);
|
|
|
|
|
|
|
|
|
|
ToolStripLabeledNumericUpDown tslnudMagnifierPixelSize = new ToolStripLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Magnifier_pixel_size_);
|
|
|
|
|
tslnudMagnifierPixelSize.Content.Minimum = RegionCaptureOptions.MagnifierPixelSizeMinimum;
|
|
|
|
|
tslnudMagnifierPixelSize.Content.Maximum = RegionCaptureOptions.MagnifierPixelSizeMaximum;
|
2017-11-07 05:01:02 +13:00
|
|
|
|
tslnudMagnifierPixelSize.Content.Value = Options.MagnifierPixelSize;
|
|
|
|
|
tslnudMagnifierPixelSize.Content.ValueChanged = (sender, e) => Options.MagnifierPixelSize = (int)tslnudMagnifierPixelSize.Content.Value;
|
2017-10-25 13:53:53 +13:00
|
|
|
|
tsddbOptions.DropDownItems.Add(tslnudMagnifierPixelSize);
|
|
|
|
|
|
|
|
|
|
ToolStripMenuItem tsmiShowCrosshair = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Show_screen_wide_crosshair);
|
2017-11-07 05:01:02 +13:00
|
|
|
|
tsmiShowCrosshair.Checked = Options.ShowCrosshair;
|
2017-10-25 13:53:53 +13:00
|
|
|
|
tsmiShowCrosshair.CheckOnClick = true;
|
2017-11-07 05:01:02 +13:00
|
|
|
|
tsmiShowCrosshair.Click += (sender, e) => Options.ShowCrosshair = tsmiShowCrosshair.Checked;
|
2017-10-25 13:53:53 +13:00
|
|
|
|
tsddbOptions.DropDownItems.Add(tsmiShowCrosshair);
|
|
|
|
|
|
2018-10-25 14:00:47 +13:00
|
|
|
|
ToolStripMenuItem tsmiUseLightResizeNodes = new ToolStripMenuItem(Resources.LightResizeNodes);
|
2018-08-30 02:49:50 +12:00
|
|
|
|
tsmiUseLightResizeNodes.Checked = Options.UseLightResizeNodes;
|
|
|
|
|
tsmiUseLightResizeNodes.CheckOnClick = true;
|
|
|
|
|
tsmiUseLightResizeNodes.Click += (sender, e) => Options.UseLightResizeNodes = tsmiUseLightResizeNodes.Checked;
|
|
|
|
|
tsddbOptions.DropDownItems.Add(tsmiUseLightResizeNodes);
|
|
|
|
|
|
2017-10-25 13:53:53 +13:00
|
|
|
|
ToolStripMenuItem tsmiEnableAnimations = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_EnableAnimations);
|
2017-11-07 05:01:02 +13:00
|
|
|
|
tsmiEnableAnimations.Checked = Options.EnableAnimations;
|
2017-10-25 13:53:53 +13:00
|
|
|
|
tsmiEnableAnimations.CheckOnClick = true;
|
2017-11-07 05:01:02 +13:00
|
|
|
|
tsmiEnableAnimations.Click += (sender, e) => Options.EnableAnimations = tsmiEnableAnimations.Checked;
|
2017-10-25 13:53:53 +13:00
|
|
|
|
tsddbOptions.DropDownItems.Add(tsmiEnableAnimations);
|
2017-04-18 02:19:23 +12:00
|
|
|
|
|
2017-11-12 20:32:55 +13:00
|
|
|
|
if (!Form.IsEditorMode)
|
2017-10-25 13:53:53 +13:00
|
|
|
|
{
|
2016-10-01 20:58:59 +13:00
|
|
|
|
ToolStripMenuItem tsmiFixedSize = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Fixed_size_region_mode);
|
2017-11-07 05:01:02 +13:00
|
|
|
|
tsmiFixedSize.Checked = Options.IsFixedSize;
|
2016-10-01 20:58:59 +13:00
|
|
|
|
tsmiFixedSize.CheckOnClick = true;
|
2017-11-07 05:01:02 +13:00
|
|
|
|
tsmiFixedSize.Click += (sender, e) => Options.IsFixedSize = tsmiFixedSize.Checked;
|
2016-10-01 20:58:59 +13:00
|
|
|
|
tsddbOptions.DropDownItems.Add(tsmiFixedSize);
|
|
|
|
|
|
|
|
|
|
ToolStripDoubleLabeledNumericUpDown tslnudFixedSize = new ToolStripDoubleLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Width_,
|
|
|
|
|
Resources.ShapeManager_CreateContextMenu_Height_);
|
|
|
|
|
tslnudFixedSize.Content.Minimum = 10;
|
|
|
|
|
tslnudFixedSize.Content.Maximum = 10000;
|
|
|
|
|
tslnudFixedSize.Content.Increment = 10;
|
2017-11-07 05:01:02 +13:00
|
|
|
|
tslnudFixedSize.Content.Value = Options.FixedSize.Width;
|
|
|
|
|
tslnudFixedSize.Content.Value2 = Options.FixedSize.Height;
|
|
|
|
|
tslnudFixedSize.Content.ValueChanged = (sender, e) => Options.FixedSize = new Size((int)tslnudFixedSize.Content.Value, (int)tslnudFixedSize.Content.Value2);
|
2016-10-01 20:58:59 +13:00
|
|
|
|
tsddbOptions.DropDownItems.Add(tslnudFixedSize);
|
2017-10-25 13:53:53 +13:00
|
|
|
|
}
|
2016-10-01 20:58:59 +13:00
|
|
|
|
|
2017-10-25 13:53:53 +13:00
|
|
|
|
ToolStripMenuItem tsmiShowFPS = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Show_FPS);
|
2017-11-07 05:01:02 +13:00
|
|
|
|
tsmiShowFPS.Checked = Options.ShowFPS;
|
2017-10-25 13:53:53 +13:00
|
|
|
|
tsmiShowFPS.CheckOnClick = true;
|
2017-11-08 13:47:22 +13:00
|
|
|
|
tsmiShowFPS.Click += (sender, e) =>
|
|
|
|
|
{
|
|
|
|
|
Options.ShowFPS = tsmiShowFPS.Checked;
|
2017-11-12 20:32:55 +13:00
|
|
|
|
Form.UpdateTitle();
|
2017-11-08 13:47:22 +13:00
|
|
|
|
};
|
2017-10-25 13:53:53 +13:00
|
|
|
|
tsddbOptions.DropDownItems.Add(tsmiShowFPS);
|
2016-10-06 04:37:11 +13:00
|
|
|
|
|
2019-04-05 06:33:55 +13:00
|
|
|
|
ToolStripMenuItem tsmiSwitchToDrawingToolAfterSelection = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_SwitchToDrawingToolAfterSelection);
|
|
|
|
|
tsmiSwitchToDrawingToolAfterSelection.Checked = Options.SwitchToDrawingToolAfterSelection;
|
|
|
|
|
tsmiSwitchToDrawingToolAfterSelection.CheckOnClick = true;
|
|
|
|
|
tsmiSwitchToDrawingToolAfterSelection.Click += (sender, e) =>
|
|
|
|
|
{
|
|
|
|
|
Options.SwitchToDrawingToolAfterSelection = tsmiSwitchToDrawingToolAfterSelection.Checked;
|
|
|
|
|
};
|
|
|
|
|
tsddbOptions.DropDownItems.Add(tsmiSwitchToDrawingToolAfterSelection);
|
|
|
|
|
|
|
|
|
|
ToolStripMenuItem tsmiSwitchToSelectionToolAfterDrawing = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_SwitchToSelectionToolAfterDrawing);
|
|
|
|
|
tsmiSwitchToSelectionToolAfterDrawing.Checked = Options.SwitchToSelectionToolAfterDrawing;
|
|
|
|
|
tsmiSwitchToSelectionToolAfterDrawing.CheckOnClick = true;
|
|
|
|
|
tsmiSwitchToSelectionToolAfterDrawing.Click += (sender, e) =>
|
|
|
|
|
{
|
|
|
|
|
Options.SwitchToSelectionToolAfterDrawing = tsmiSwitchToSelectionToolAfterDrawing.Checked;
|
|
|
|
|
};
|
|
|
|
|
tsddbOptions.DropDownItems.Add(tsmiSwitchToSelectionToolAfterDrawing);
|
|
|
|
|
|
2017-11-12 20:32:55 +13:00
|
|
|
|
if (!Form.IsEditorMode)
|
2017-10-29 23:25:30 +13:00
|
|
|
|
{
|
|
|
|
|
ToolStripMenuItem tsmiRememberMenuState = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_RememberMenuState);
|
2017-11-07 05:01:02 +13:00
|
|
|
|
tsmiRememberMenuState.Checked = Options.RememberMenuState;
|
2017-10-29 23:25:30 +13:00
|
|
|
|
tsmiRememberMenuState.CheckOnClick = true;
|
2017-11-07 05:01:02 +13:00
|
|
|
|
tsmiRememberMenuState.Click += (sender, e) => Options.RememberMenuState = tsmiRememberMenuState.Checked;
|
2017-10-29 23:25:30 +13:00
|
|
|
|
tsddbOptions.DropDownItems.Add(tsmiRememberMenuState);
|
|
|
|
|
}
|
2016-10-01 20:58:59 +13:00
|
|
|
|
|
2018-05-01 01:19:57 +12:00
|
|
|
|
tsddbOptions.DropDownItems.Add(new ToolStripSeparator());
|
|
|
|
|
|
2018-10-25 14:00:47 +13:00
|
|
|
|
ToolStripMenuItem tsmiKeybinds = new ToolStripMenuItem(Resources.OpenKeybindsPage);
|
2018-05-01 01:19:57 +12:00
|
|
|
|
tsmiKeybinds.Click += (sender, e) =>
|
|
|
|
|
{
|
|
|
|
|
if (Form.IsFullscreen)
|
|
|
|
|
{
|
2018-10-25 14:00:47 +13:00
|
|
|
|
if (MessageBox.Show(Form, Resources.ThisWindowWillCloseBeforeOpeningKeybindsPageWantContinue,
|
2018-05-01 01:19:57 +12:00
|
|
|
|
"ShareX", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
|
|
|
|
|
{
|
|
|
|
|
Form.CloseWindow();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
URLHelpers.OpenURL("https://getsharex.com/docs/region-capture");
|
|
|
|
|
};
|
|
|
|
|
tsddbOptions.DropDownItems.Add(tsmiKeybinds);
|
|
|
|
|
|
2017-10-25 13:53:53 +13:00
|
|
|
|
#endregion Options
|
2016-10-01 20:58:59 +13:00
|
|
|
|
|
2017-11-12 20:32:55 +13:00
|
|
|
|
if (Form.IsFullscreen)
|
2016-10-01 20:58:59 +13:00
|
|
|
|
{
|
2017-10-29 04:04:45 +13:00
|
|
|
|
tslDragRight = new ToolStripLabel()
|
2017-10-27 20:42:57 +13:00
|
|
|
|
{
|
|
|
|
|
Alignment = ToolStripItemAlignment.Right,
|
|
|
|
|
DisplayStyle = ToolStripItemDisplayStyle.Image,
|
|
|
|
|
Image = Resources.ui_radio_button_uncheck,
|
|
|
|
|
Margin = new Padding(0, 0, 2, 0),
|
|
|
|
|
Padding = new Padding(2)
|
|
|
|
|
};
|
2016-10-01 20:58:59 +13:00
|
|
|
|
|
2017-10-27 20:42:57 +13:00
|
|
|
|
tsMain.Items.Add(tslDragRight);
|
2016-10-01 20:58:59 +13:00
|
|
|
|
|
2017-10-27 20:42:57 +13:00
|
|
|
|
tslDragLeft.MouseDown += TslDrag_MouseDown;
|
|
|
|
|
tslDragRight.MouseDown += TslDrag_MouseDown;
|
|
|
|
|
tslDragLeft.MouseEnter += TslDrag_MouseEnter;
|
|
|
|
|
tslDragRight.MouseEnter += TslDrag_MouseEnter;
|
|
|
|
|
tslDragLeft.MouseLeave += TslDrag_MouseLeave;
|
|
|
|
|
tslDragRight.MouseLeave += TslDrag_MouseLeave;
|
|
|
|
|
}
|
2016-10-05 05:24:29 +13:00
|
|
|
|
|
2016-10-03 05:08:45 +13:00
|
|
|
|
foreach (ToolStripItem tsi in tsMain.Items.OfType<ToolStripItem>())
|
2016-10-03 05:01:55 +13:00
|
|
|
|
{
|
2016-10-03 05:08:45 +13:00
|
|
|
|
if (!string.IsNullOrEmpty(tsi.Text))
|
2016-10-03 05:01:55 +13:00
|
|
|
|
{
|
2016-10-03 05:08:45 +13:00
|
|
|
|
tsi.MouseEnter += (sender, e) =>
|
|
|
|
|
{
|
2017-11-12 20:32:55 +13:00
|
|
|
|
Point pos = Form.PointToClient(menuForm.PointToScreen(tsi.Bounds.Location));
|
2016-10-03 05:08:45 +13:00
|
|
|
|
pos.Y += tsi.Height + 8;
|
2017-04-03 12:44:03 +12:00
|
|
|
|
|
|
|
|
|
MenuTextAnimation.Text = tsi.Text;
|
2016-10-03 05:08:45 +13:00
|
|
|
|
MenuTextAnimation.Position = pos;
|
2017-04-03 12:44:03 +12:00
|
|
|
|
MenuTextAnimation.Start();
|
2016-10-03 05:08:45 +13:00
|
|
|
|
};
|
2016-10-03 05:01:55 +13:00
|
|
|
|
|
2016-10-06 04:37:11 +13:00
|
|
|
|
tsi.MouseLeave += TsMain_MouseLeave;
|
2016-10-03 05:08:45 +13:00
|
|
|
|
}
|
2016-10-03 05:01:55 +13:00
|
|
|
|
}
|
|
|
|
|
|
2017-05-27 23:21:22 +12:00
|
|
|
|
tsMain.ResumeLayout(false);
|
|
|
|
|
tsMain.PerformLayout();
|
|
|
|
|
menuForm.ResumeLayout(false);
|
|
|
|
|
|
2017-11-12 20:32:55 +13:00
|
|
|
|
menuForm.Show(Form);
|
2017-05-27 23:21:22 +12:00
|
|
|
|
|
2016-10-01 20:58:59 +13:00
|
|
|
|
UpdateMenu();
|
|
|
|
|
|
|
|
|
|
CurrentShapeChanged += shape => UpdateMenu();
|
2016-11-19 13:03:44 +13:00
|
|
|
|
CurrentShapeTypeChanged += shapeType => UpdateMenu();
|
|
|
|
|
ShapeCreated += shape => UpdateMenu();
|
2016-10-06 04:37:11 +13:00
|
|
|
|
|
2016-10-13 21:47:26 +13:00
|
|
|
|
ConfigureMenuState();
|
2016-10-06 04:37:11 +13:00
|
|
|
|
|
2017-11-12 20:32:55 +13:00
|
|
|
|
Form.Activate();
|
2017-10-24 12:24:50 +13:00
|
|
|
|
|
|
|
|
|
ToolbarCreated = true;
|
2016-10-06 04:37:11 +13:00
|
|
|
|
}
|
|
|
|
|
|
2017-04-02 09:56:53 +12:00
|
|
|
|
private void MenuForm_Shown(object sender, EventArgs e)
|
|
|
|
|
{
|
2017-11-12 20:32:55 +13:00
|
|
|
|
Form.ToolbarHeight = menuForm.Height;
|
|
|
|
|
Form.CenterCanvas();
|
2017-04-02 09:56:53 +12:00
|
|
|
|
}
|
|
|
|
|
|
2017-01-11 07:56:37 +13:00
|
|
|
|
private void MenuForm_KeyDown(object sender, KeyEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
form_KeyDown(sender, e);
|
2017-11-12 20:32:55 +13:00
|
|
|
|
Form.RegionCaptureForm_KeyDown(sender, e);
|
2017-01-11 07:56:37 +13:00
|
|
|
|
|
|
|
|
|
e.Handled = true;
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-06 08:32:01 +13:00
|
|
|
|
private void MenuForm_KeyUp(object sender, KeyEventArgs e)
|
|
|
|
|
{
|
2017-01-11 07:56:37 +13:00
|
|
|
|
form_KeyUp(sender, e);
|
|
|
|
|
|
|
|
|
|
e.Handled = true;
|
2016-10-06 08:32:01 +13:00
|
|
|
|
}
|
|
|
|
|
|
2016-10-06 04:37:11 +13:00
|
|
|
|
private void MenuForm_LocationChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
2016-10-13 21:47:26 +13:00
|
|
|
|
CheckMenuPosition();
|
2016-10-06 04:37:11 +13:00
|
|
|
|
}
|
|
|
|
|
|
2018-04-03 10:43:10 +12:00
|
|
|
|
private void MenuForm_GotFocus(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
Form.Resume();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void MenuForm_LostFocus(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
Form.Pause();
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-06 04:37:11 +13:00
|
|
|
|
private void TsMain_MouseLeave(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
MenuTextAnimation.Stop();
|
2016-10-01 20:58:59 +13:00
|
|
|
|
}
|
|
|
|
|
|
2016-10-05 05:24:29 +13:00
|
|
|
|
private void TslDrag_MouseEnter(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
menuForm.Cursor = Cursors.SizeAll;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void TslDrag_MouseLeave(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
menuForm.Cursor = Cursors.Default;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void TslDrag_MouseDown(object sender, MouseEventArgs e)
|
|
|
|
|
{
|
2016-10-06 02:00:33 +13:00
|
|
|
|
if (e.Button == MouseButtons.Left)
|
|
|
|
|
{
|
|
|
|
|
NativeMethods.ReleaseCapture();
|
|
|
|
|
NativeMethods.DefWindowProc(menuForm.Handle, (uint)WindowsMessages.SYSCOMMAND, (UIntPtr)NativeConstants.MOUSE_MOVE, IntPtr.Zero);
|
|
|
|
|
}
|
|
|
|
|
else if (e.Button == MouseButtons.Right)
|
|
|
|
|
{
|
2017-10-30 21:48:58 +13:00
|
|
|
|
SetMenuCollapsed(!ToolbarCollapsed);
|
2016-10-13 21:47:26 +13:00
|
|
|
|
CheckMenuPosition();
|
2016-10-06 02:00:33 +13:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-13 21:47:26 +13:00
|
|
|
|
private void ConfigureMenuState()
|
2016-10-06 04:37:11 +13:00
|
|
|
|
{
|
2017-11-12 20:32:55 +13:00
|
|
|
|
if (!Form.IsEditorMode && Options.RememberMenuState)
|
2016-10-13 21:47:26 +13:00
|
|
|
|
{
|
2017-11-07 05:01:02 +13:00
|
|
|
|
SetMenuCollapsed(Options.MenuCollapsed);
|
2016-10-13 21:47:26 +13:00
|
|
|
|
}
|
|
|
|
|
|
2017-10-24 12:24:50 +13:00
|
|
|
|
UpdateMenuPosition();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internal void UpdateMenuPosition()
|
|
|
|
|
{
|
2017-10-27 21:54:19 +13:00
|
|
|
|
Rectangle rectScreen;
|
2016-10-06 04:37:11 +13:00
|
|
|
|
|
2017-11-12 20:32:55 +13:00
|
|
|
|
if (Form.IsFullscreen)
|
2016-10-06 04:37:11 +13:00
|
|
|
|
{
|
2017-10-27 21:54:19 +13:00
|
|
|
|
rectScreen = CaptureHelpers.GetActiveScreenBounds();
|
|
|
|
|
rectScreen.Y += 20;
|
2016-10-06 04:37:11 +13:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2017-11-12 20:32:55 +13:00
|
|
|
|
rectScreen = Form.RectangleToScreen(Form.ClientArea);
|
2017-10-27 21:54:19 +13:00
|
|
|
|
}
|
2016-10-06 04:37:11 +13:00
|
|
|
|
|
2017-11-12 20:32:55 +13:00
|
|
|
|
if (!Form.IsEditorMode && Options.RememberMenuState && rectScreen.Contains(Options.MenuPosition))
|
2017-10-27 21:54:19 +13:00
|
|
|
|
{
|
2017-11-07 05:01:02 +13:00
|
|
|
|
menuForm.Location = Options.MenuPosition;
|
2017-10-27 21:54:19 +13:00
|
|
|
|
}
|
|
|
|
|
else if (tsMain.Width < rectScreen.Width)
|
|
|
|
|
{
|
2018-05-17 01:27:11 +12:00
|
|
|
|
menuForm.Location = new Point(rectScreen.X + (rectScreen.Width / 2) - (tsMain.Width / 2), rectScreen.Y);
|
2017-10-27 21:54:19 +13:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
menuForm.Location = rectScreen.Location;
|
2016-10-06 04:37:11 +13:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-13 21:47:26 +13:00
|
|
|
|
private void CheckMenuPosition()
|
2016-10-06 02:00:33 +13:00
|
|
|
|
{
|
2016-10-13 21:47:26 +13:00
|
|
|
|
Rectangle rectMenu = menuForm.Bounds;
|
|
|
|
|
Rectangle rectScreen = CaptureHelpers.GetScreenBounds();
|
|
|
|
|
Point pos = rectMenu.Location;
|
|
|
|
|
|
|
|
|
|
if (rectMenu.Width < rectScreen.Width)
|
2016-10-06 02:00:33 +13:00
|
|
|
|
{
|
2016-10-13 21:47:26 +13:00
|
|
|
|
if (rectMenu.X < rectScreen.X)
|
2016-10-06 02:00:33 +13:00
|
|
|
|
{
|
2016-10-13 21:47:26 +13:00
|
|
|
|
pos.X = rectScreen.X;
|
|
|
|
|
}
|
|
|
|
|
else if (rectMenu.Right > rectScreen.Right)
|
|
|
|
|
{
|
|
|
|
|
pos.X = rectScreen.Right - rectMenu.Width;
|
2016-10-06 02:00:33 +13:00
|
|
|
|
}
|
2016-10-13 21:47:26 +13:00
|
|
|
|
}
|
2016-10-06 02:00:33 +13:00
|
|
|
|
|
2016-10-13 21:47:26 +13:00
|
|
|
|
if (rectMenu.Height < rectScreen.Height)
|
|
|
|
|
{
|
|
|
|
|
if (rectMenu.Y < rectScreen.Y)
|
|
|
|
|
{
|
|
|
|
|
pos.Y = rectScreen.Y;
|
|
|
|
|
}
|
|
|
|
|
else if (rectMenu.Bottom > rectScreen.Bottom)
|
|
|
|
|
{
|
|
|
|
|
pos.Y = rectScreen.Bottom - rectMenu.Height;
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-10-06 02:00:33 +13:00
|
|
|
|
|
2016-10-13 21:47:26 +13:00
|
|
|
|
if (pos != rectMenu.Location)
|
|
|
|
|
{
|
|
|
|
|
menuForm.Location = pos;
|
2016-10-06 02:00:33 +13:00
|
|
|
|
}
|
2016-10-13 21:47:26 +13:00
|
|
|
|
|
2017-11-12 20:32:55 +13:00
|
|
|
|
if (!Form.IsEditorMode && Options.RememberMenuState)
|
2016-10-13 21:47:26 +13:00
|
|
|
|
{
|
2017-11-07 05:01:02 +13:00
|
|
|
|
Options.MenuPosition = pos;
|
2016-10-13 21:47:26 +13:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void SetMenuCollapsed(bool isCollapsed)
|
|
|
|
|
{
|
2017-10-30 21:48:58 +13:00
|
|
|
|
if (ToolbarCollapsed == isCollapsed)
|
2016-10-13 21:47:26 +13:00
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2017-10-30 21:48:58 +13:00
|
|
|
|
ToolbarCollapsed = isCollapsed;
|
2016-10-13 21:47:26 +13:00
|
|
|
|
|
2017-10-30 21:48:58 +13:00
|
|
|
|
if (ToolbarCollapsed)
|
2016-10-06 02:00:33 +13:00
|
|
|
|
{
|
|
|
|
|
foreach (ToolStripItem tsi in tsMain.Items.OfType<ToolStripItem>())
|
|
|
|
|
{
|
|
|
|
|
if (tsi == tslDragLeft)
|
|
|
|
|
{
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tsi.Visible = false;
|
|
|
|
|
}
|
2016-10-13 21:47:26 +13:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
foreach (ToolStripItem tsi in tsMain.Items.OfType<ToolStripItem>())
|
|
|
|
|
{
|
|
|
|
|
tsi.Visible = true;
|
|
|
|
|
}
|
2016-10-06 02:00:33 +13:00
|
|
|
|
|
2016-10-13 21:47:26 +13:00
|
|
|
|
UpdateMenu();
|
|
|
|
|
}
|
|
|
|
|
|
2017-11-12 20:32:55 +13:00
|
|
|
|
if (!Form.IsEditorMode && Options.RememberMenuState)
|
2016-10-13 21:47:26 +13:00
|
|
|
|
{
|
2017-11-07 05:01:02 +13:00
|
|
|
|
Options.MenuCollapsed = ToolbarCollapsed;
|
2016-10-06 02:00:33 +13:00
|
|
|
|
}
|
2016-10-05 05:24:29 +13:00
|
|
|
|
}
|
|
|
|
|
|
2016-10-01 20:58:59 +13:00
|
|
|
|
private void UpdateMenu()
|
|
|
|
|
{
|
2017-11-12 20:32:55 +13:00
|
|
|
|
if (Form.IsClosing || menuForm == null || menuForm.IsDisposed) return;
|
2016-10-01 20:58:59 +13:00
|
|
|
|
|
2017-11-07 05:01:02 +13:00
|
|
|
|
ShapeType shapeType = CurrentTool;
|
2016-10-01 20:58:59 +13:00
|
|
|
|
|
|
|
|
|
foreach (ToolStripButton tsb in tsMain.Items.OfType<ToolStripButton>().Where(x => x.Tag is ShapeType))
|
|
|
|
|
{
|
|
|
|
|
if ((ShapeType)tsb.Tag == shapeType)
|
|
|
|
|
{
|
|
|
|
|
tsb.RadioCheck();
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-04-05 06:33:55 +13:00
|
|
|
|
// use menu of current shape in case of an active select tool.
|
|
|
|
|
if (CurrentShape != null && shapeType == ShapeType.ToolSelect)
|
|
|
|
|
{
|
|
|
|
|
shapeType = CurrentShape.ShapeType;
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-01 20:58:59 +13:00
|
|
|
|
Color borderColor;
|
|
|
|
|
|
2017-02-16 13:49:13 +13:00
|
|
|
|
if (shapeType == ShapeType.DrawingTextBackground || shapeType == ShapeType.DrawingSpeechBalloon)
|
2016-10-01 20:58:59 +13:00
|
|
|
|
{
|
|
|
|
|
borderColor = AnnotationOptions.TextBorderColor;
|
|
|
|
|
}
|
2017-02-16 13:49:13 +13:00
|
|
|
|
else if (shapeType == ShapeType.DrawingTextOutline)
|
|
|
|
|
{
|
|
|
|
|
borderColor = AnnotationOptions.TextOutlineBorderColor;
|
|
|
|
|
}
|
2016-10-01 20:58:59 +13:00
|
|
|
|
else if (shapeType == ShapeType.DrawingStep)
|
|
|
|
|
{
|
|
|
|
|
borderColor = AnnotationOptions.StepBorderColor;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
borderColor = AnnotationOptions.BorderColor;
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-05 06:38:30 +13:00
|
|
|
|
if (tsbBorderColor.Image != null) tsbBorderColor.Image.Dispose();
|
2016-10-13 21:47:26 +13:00
|
|
|
|
tsbBorderColor.Image = ImageHelpers.CreateColorPickerIcon(borderColor, new Rectangle(0, 0, 16, 16), 8);
|
2016-10-01 20:58:59 +13:00
|
|
|
|
|
|
|
|
|
int borderSize;
|
|
|
|
|
|
2017-02-16 13:49:13 +13:00
|
|
|
|
if (shapeType == ShapeType.DrawingTextBackground || shapeType == ShapeType.DrawingSpeechBalloon)
|
2016-10-01 20:58:59 +13:00
|
|
|
|
{
|
|
|
|
|
borderSize = AnnotationOptions.TextBorderSize;
|
|
|
|
|
}
|
2017-02-16 13:49:13 +13:00
|
|
|
|
else if (shapeType == ShapeType.DrawingTextOutline)
|
|
|
|
|
{
|
|
|
|
|
borderSize = AnnotationOptions.TextOutlineBorderSize;
|
|
|
|
|
}
|
2016-10-01 20:58:59 +13:00
|
|
|
|
else if (shapeType == ShapeType.DrawingStep)
|
|
|
|
|
{
|
|
|
|
|
borderSize = AnnotationOptions.StepBorderSize;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
borderSize = AnnotationOptions.BorderSize;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tslnudBorderSize.Content.Value = borderSize;
|
|
|
|
|
|
|
|
|
|
Color fillColor;
|
|
|
|
|
|
2017-02-16 13:49:13 +13:00
|
|
|
|
if (shapeType == ShapeType.DrawingTextBackground || shapeType == ShapeType.DrawingSpeechBalloon)
|
2016-10-01 20:58:59 +13:00
|
|
|
|
{
|
|
|
|
|
fillColor = AnnotationOptions.TextFillColor;
|
|
|
|
|
}
|
|
|
|
|
else if (shapeType == ShapeType.DrawingStep)
|
|
|
|
|
{
|
|
|
|
|
fillColor = AnnotationOptions.StepFillColor;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
fillColor = AnnotationOptions.FillColor;
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-05 06:38:30 +13:00
|
|
|
|
if (tsbFillColor.Image != null) tsbFillColor.Image.Dispose();
|
|
|
|
|
tsbFillColor.Image = ImageHelpers.CreateColorPickerIcon(fillColor, new Rectangle(0, 0, 16, 16));
|
2016-10-01 20:58:59 +13:00
|
|
|
|
|
|
|
|
|
int cornerRadius = 0;
|
|
|
|
|
|
2016-12-01 04:17:12 +13:00
|
|
|
|
if (shapeType == ShapeType.RegionRectangle)
|
2016-10-01 20:58:59 +13:00
|
|
|
|
{
|
2016-12-01 04:17:12 +13:00
|
|
|
|
cornerRadius = AnnotationOptions.RegionCornerRadius;
|
2016-10-01 20:58:59 +13:00
|
|
|
|
}
|
2017-02-16 13:49:13 +13:00
|
|
|
|
else if (shapeType == ShapeType.DrawingRectangle || shapeType == ShapeType.DrawingTextBackground)
|
2016-10-01 20:58:59 +13:00
|
|
|
|
{
|
2016-12-01 04:17:12 +13:00
|
|
|
|
cornerRadius = AnnotationOptions.DrawingCornerRadius;
|
2016-10-01 20:58:59 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tslnudCornerRadius.Content.Value = cornerRadius;
|
|
|
|
|
|
2018-01-06 18:30:04 +13:00
|
|
|
|
tscbImageInterpolationMode.Content.SelectedIndex = (int)AnnotationOptions.ImageInterpolationMode;
|
|
|
|
|
|
2016-10-01 20:58:59 +13:00
|
|
|
|
tslnudBlurRadius.Content.Value = AnnotationOptions.BlurRadius;
|
|
|
|
|
|
|
|
|
|
tslnudPixelateSize.Content.Value = AnnotationOptions.PixelateSize;
|
|
|
|
|
|
2016-10-05 11:05:55 +13:00
|
|
|
|
if (tsbHighlightColor.Image != null) tsbHighlightColor.Image.Dispose();
|
|
|
|
|
tsbHighlightColor.Image = ImageHelpers.CreateColorPickerIcon(AnnotationOptions.HighlightColor, new Rectangle(0, 0, 16, 16));
|
2016-10-01 20:58:59 +13:00
|
|
|
|
|
2017-12-08 09:17:36 +13:00
|
|
|
|
tslnudStepFontSize.Content.Value = AnnotationOptions.StepFontSize;
|
2018-09-20 04:35:58 +12:00
|
|
|
|
tslnudStartingStepValue.Content.Value = StartingStepNumber;
|
2017-12-28 03:48:51 +13:00
|
|
|
|
tsmiStepUseLetters.Checked = AnnotationOptions.StepUseLetters;
|
2017-12-08 09:17:36 +13:00
|
|
|
|
|
2019-05-03 19:40:54 +12:00
|
|
|
|
tslnudMagnifyStrength.Content.Value = AnnotationOptions.MagnifyStrength;
|
|
|
|
|
|
2016-11-30 10:11:39 +13:00
|
|
|
|
tsmiShadow.Checked = AnnotationOptions.Shadow;
|
|
|
|
|
|
2018-01-31 06:14:28 +13:00
|
|
|
|
if (tsmiShadowColor.Image != null) tsmiShadowColor.Image.Dispose();
|
|
|
|
|
tsmiShadowColor.Image = ImageHelpers.CreateColorPickerIcon(AnnotationOptions.ShadowColor, new Rectangle(0, 0, 16, 16));
|
|
|
|
|
|
2017-08-03 03:32:51 +12:00
|
|
|
|
tslnudCenterPoints.Content.Value = AnnotationOptions.LineCenterPointCount;
|
|
|
|
|
|
2017-08-03 04:11:12 +12:00
|
|
|
|
tsmiArrowHeadsBothSide.Checked = AnnotationOptions.ArrowHeadsBothSide;
|
|
|
|
|
|
2016-10-01 20:58:59 +13:00
|
|
|
|
switch (shapeType)
|
|
|
|
|
{
|
|
|
|
|
default:
|
2016-10-05 06:38:30 +13:00
|
|
|
|
tsddbShapeOptions.Visible = false;
|
2016-10-01 20:58:59 +13:00
|
|
|
|
break;
|
2016-12-01 04:17:12 +13:00
|
|
|
|
case ShapeType.RegionRectangle:
|
2016-10-01 20:58:59 +13:00
|
|
|
|
case ShapeType.DrawingRectangle:
|
|
|
|
|
case ShapeType.DrawingEllipse:
|
|
|
|
|
case ShapeType.DrawingFreehand:
|
|
|
|
|
case ShapeType.DrawingLine:
|
|
|
|
|
case ShapeType.DrawingArrow:
|
2017-02-16 13:49:13 +13:00
|
|
|
|
case ShapeType.DrawingTextOutline:
|
|
|
|
|
case ShapeType.DrawingTextBackground:
|
2016-10-01 20:58:59 +13:00
|
|
|
|
case ShapeType.DrawingSpeechBalloon:
|
|
|
|
|
case ShapeType.DrawingStep:
|
2019-05-02 21:45:54 +12:00
|
|
|
|
case ShapeType.DrawingMagnify:
|
2018-01-06 18:30:04 +13:00
|
|
|
|
case ShapeType.DrawingImage:
|
|
|
|
|
case ShapeType.DrawingImageScreen:
|
2017-08-13 23:07:52 +12:00
|
|
|
|
case ShapeType.DrawingCursor:
|
2016-10-01 20:58:59 +13:00
|
|
|
|
case ShapeType.EffectBlur:
|
|
|
|
|
case ShapeType.EffectPixelate:
|
2016-10-05 06:38:30 +13:00
|
|
|
|
tsddbShapeOptions.Visible = true;
|
2016-10-01 20:58:59 +13:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2016-12-02 03:34:53 +13:00
|
|
|
|
tsmiUndo.Enabled = tsmiDeleteAll.Enabled = Shapes.Count > 0;
|
|
|
|
|
tsmiDelete.Enabled = tsmiMoveTop.Enabled = tsmiMoveUp.Enabled = tsmiMoveDown.Enabled = tsmiMoveBottom.Enabled = CurrentShape != null;
|
2016-10-01 20:58:59 +13:00
|
|
|
|
|
|
|
|
|
switch (shapeType)
|
|
|
|
|
{
|
|
|
|
|
default:
|
2016-10-05 06:38:30 +13:00
|
|
|
|
tsbBorderColor.Visible = false;
|
2016-10-01 20:58:59 +13:00
|
|
|
|
tslnudBorderSize.Visible = false;
|
2016-11-30 10:11:39 +13:00
|
|
|
|
tsmiShadow.Visible = false;
|
2018-02-15 10:52:07 +13:00
|
|
|
|
tsmiShadowColor.Visible = false;
|
2016-10-01 20:58:59 +13:00
|
|
|
|
break;
|
|
|
|
|
case ShapeType.DrawingRectangle:
|
|
|
|
|
case ShapeType.DrawingEllipse:
|
|
|
|
|
case ShapeType.DrawingFreehand:
|
|
|
|
|
case ShapeType.DrawingLine:
|
|
|
|
|
case ShapeType.DrawingArrow:
|
2017-02-16 13:49:13 +13:00
|
|
|
|
case ShapeType.DrawingTextOutline:
|
|
|
|
|
case ShapeType.DrawingTextBackground:
|
2016-10-01 20:58:59 +13:00
|
|
|
|
case ShapeType.DrawingSpeechBalloon:
|
|
|
|
|
case ShapeType.DrawingStep:
|
2019-05-02 21:45:54 +12:00
|
|
|
|
case ShapeType.DrawingMagnify:
|
2016-10-05 06:38:30 +13:00
|
|
|
|
tsbBorderColor.Visible = true;
|
2016-10-01 20:58:59 +13:00
|
|
|
|
tslnudBorderSize.Visible = true;
|
2016-11-30 10:11:39 +13:00
|
|
|
|
tsmiShadow.Visible = true;
|
2018-02-15 10:52:07 +13:00
|
|
|
|
tsmiShadowColor.Visible = true;
|
2016-10-01 20:58:59 +13:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
switch (shapeType)
|
|
|
|
|
{
|
|
|
|
|
default:
|
2016-10-05 06:38:30 +13:00
|
|
|
|
tsbFillColor.Visible = false;
|
2016-10-01 20:58:59 +13:00
|
|
|
|
break;
|
|
|
|
|
case ShapeType.DrawingRectangle:
|
|
|
|
|
case ShapeType.DrawingEllipse:
|
2017-02-16 13:49:13 +13:00
|
|
|
|
case ShapeType.DrawingTextBackground:
|
2016-10-01 20:58:59 +13:00
|
|
|
|
case ShapeType.DrawingSpeechBalloon:
|
|
|
|
|
case ShapeType.DrawingStep:
|
2019-05-02 21:45:54 +12:00
|
|
|
|
case ShapeType.DrawingMagnify:
|
2016-10-05 06:38:30 +13:00
|
|
|
|
tsbFillColor.Visible = true;
|
2016-10-01 20:58:59 +13:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
switch (shapeType)
|
|
|
|
|
{
|
|
|
|
|
default:
|
|
|
|
|
tslnudCornerRadius.Visible = false;
|
|
|
|
|
break;
|
2016-12-01 04:17:12 +13:00
|
|
|
|
case ShapeType.RegionRectangle:
|
|
|
|
|
case ShapeType.DrawingRectangle:
|
2017-02-16 13:49:13 +13:00
|
|
|
|
case ShapeType.DrawingTextBackground:
|
2016-10-01 20:58:59 +13:00
|
|
|
|
tslnudCornerRadius.Visible = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2017-08-03 03:32:51 +12:00
|
|
|
|
tslnudCenterPoints.Visible = shapeType == ShapeType.DrawingLine || shapeType == ShapeType.DrawingArrow;
|
2017-08-03 04:11:12 +12:00
|
|
|
|
tsmiArrowHeadsBothSide.Visible = shapeType == ShapeType.DrawingArrow;
|
2019-05-05 18:53:03 +12:00
|
|
|
|
tscbImageInterpolationMode.Visible = shapeType == ShapeType.DrawingImage || shapeType == ShapeType.DrawingImageScreen || shapeType == ShapeType.DrawingMagnify;
|
2018-09-18 06:27:22 +12:00
|
|
|
|
tslnudStartingStepValue.Visible = shapeType == ShapeType.DrawingStep;
|
2017-12-28 03:48:51 +13:00
|
|
|
|
tslnudStepFontSize.Visible = tsmiStepUseLetters.Visible = shapeType == ShapeType.DrawingStep;
|
2019-05-03 19:40:54 +12:00
|
|
|
|
tslnudMagnifyStrength.Visible = shapeType == ShapeType.DrawingMagnify;
|
2017-08-28 18:26:24 +12:00
|
|
|
|
tscbCursorTypes.Visible = shapeType == ShapeType.DrawingCursor;
|
2016-10-01 20:58:59 +13:00
|
|
|
|
tslnudBlurRadius.Visible = shapeType == ShapeType.EffectBlur;
|
|
|
|
|
tslnudPixelateSize.Visible = shapeType == ShapeType.EffectPixelate;
|
2016-10-05 11:05:55 +13:00
|
|
|
|
tsbHighlightColor.Visible = shapeType == ShapeType.EffectHighlight;
|
2016-10-04 01:13:53 +13:00
|
|
|
|
|
2016-10-04 01:21:59 +13:00
|
|
|
|
if (tsmiRegionCapture != null)
|
|
|
|
|
{
|
2017-11-07 05:01:02 +13:00
|
|
|
|
tsmiRegionCapture.Visible = !Options.QuickCrop && ValidRegions.Length > 0;
|
2016-10-04 01:21:59 +13:00
|
|
|
|
}
|
2017-11-09 07:24:25 +13:00
|
|
|
|
|
2017-11-13 09:44:18 +13:00
|
|
|
|
if (tsmiImageEditorBackgroundColor != null)
|
2017-11-09 07:24:25 +13:00
|
|
|
|
{
|
2017-11-13 09:44:18 +13:00
|
|
|
|
if (tsmiImageEditorBackgroundColor.Image != null) tsmiImageEditorBackgroundColor.Image.Dispose();
|
|
|
|
|
tsmiImageEditorBackgroundColor.Image = ImageHelpers.CreateColorPickerIcon(Options.ImageEditorBackgroundColor, new Rectangle(0, 0, 16, 16));
|
2017-11-09 07:24:25 +13:00
|
|
|
|
}
|
2016-10-01 20:58:59 +13:00
|
|
|
|
}
|
2017-08-13 23:07:52 +12:00
|
|
|
|
|
|
|
|
|
internal Cursor GetSelectedCursor()
|
|
|
|
|
{
|
2017-08-28 18:26:24 +12:00
|
|
|
|
if (tscbCursorTypes.Content.SelectedIndex > -1)
|
2017-08-13 23:07:52 +12:00
|
|
|
|
{
|
2017-08-28 18:26:24 +12:00
|
|
|
|
return Helpers.CursorList[tscbCursorTypes.Content.SelectedIndex];
|
2017-08-13 23:07:52 +12:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return Cursors.Default;
|
|
|
|
|
}
|
2016-10-01 20:58:59 +13:00
|
|
|
|
}
|
|
|
|
|
}
|