From b952f3d6541274382c9e7794f6c8d12ab386d442 Mon Sep 17 00:00:00 2001 From: Fyers Date: Mon, 17 Sep 2018 20:05:09 +0200 Subject: [PATCH] added StartingStepNumber option for AnnotationOptions --- .../Properties/Resources.Designer.cs | 9 +++++++++ ShareX.ScreenCaptureLib/Properties/Resources.resx | 3 +++ ShareX.ScreenCaptureLib/Shapes/AnnotationOptions.cs | 1 + ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs | 2 +- ShareX.ScreenCaptureLib/Shapes/ShapeManagerMenu.cs | 13 ++++++++++++- 5 files changed, 26 insertions(+), 2 deletions(-) diff --git a/ShareX.ScreenCaptureLib/Properties/Resources.Designer.cs b/ShareX.ScreenCaptureLib/Properties/Resources.Designer.cs index d9e341176..22956155b 100644 --- a/ShareX.ScreenCaptureLib/Properties/Resources.Designer.cs +++ b/ShareX.ScreenCaptureLib/Properties/Resources.Designer.cs @@ -1559,6 +1559,15 @@ internal static string ShapeManager_CreateToolbar_ShapeOptions { return ResourceManager.GetString("ShapeManager_CreateToolbar_ShapeOptions", resourceCulture); } } + + /// + /// Looks up a localized string similar Value of first step options. + /// + internal static string ShapeManager_CreateToolbar_StartingStepValue { + get { + return ResourceManager.GetString("ShapeManager_CreateToolbar_StartingStepValue", resourceCulture); + } + } /// /// Looks up a localized string similar to Undo. diff --git a/ShareX.ScreenCaptureLib/Properties/Resources.resx b/ShareX.ScreenCaptureLib/Properties/Resources.resx index 4ba885d85..18625d696 100644 --- a/ShareX.ScreenCaptureLib/Properties/Resources.resx +++ b/ShareX.ScreenCaptureLib/Properties/Resources.resx @@ -165,6 +165,9 @@ Distance: {6:0.00} px / Angle: {7:0.00}° Use letters + + Value of first step + Image size... diff --git a/ShareX.ScreenCaptureLib/Shapes/AnnotationOptions.cs b/ShareX.ScreenCaptureLib/Shapes/AnnotationOptions.cs index 61a48c88b..5a78a1e28 100644 --- a/ShareX.ScreenCaptureLib/Shapes/AnnotationOptions.cs +++ b/ShareX.ScreenCaptureLib/Shapes/AnnotationOptions.cs @@ -83,6 +83,7 @@ public class AnnotationOptions public Color StepFillColor { get; set; } = PrimaryColor; public int StepFontSize { get; set; } = 18; public bool StepUseLetters { get; set; } = false; + public int StartingStepNumber { get; set; } = 1; // Sticker drawing public List StickerPacks = new List() diff --git a/ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs b/ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs index c7e4e0a94..75535b48e 100644 --- a/ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs +++ b/ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs @@ -1474,7 +1474,7 @@ private void UpdateNodes() public void OrderStepShapes() { - int i = 1; + int i = AnnotationOptions.StartingStepNumber; foreach (StepDrawingShape shape in Shapes.OfType()) { diff --git a/ShareX.ScreenCaptureLib/Shapes/ShapeManagerMenu.cs b/ShareX.ScreenCaptureLib/Shapes/ShapeManagerMenu.cs index 39c29842b..756326c0c 100644 --- a/ShareX.ScreenCaptureLib/Shapes/ShapeManagerMenu.cs +++ b/ShareX.ScreenCaptureLib/Shapes/ShapeManagerMenu.cs @@ -52,7 +52,7 @@ internal partial class ShapeManager private ToolStripMenuItem tsmiArrowHeadsBothSide, tsmiShadow, tsmiShadowColor, tsmiStepUseLetters, tsmiUndo, tsmiDelete, tsmiDeleteAll, tsmiMoveTop, tsmiMoveUp, tsmiMoveDown, tsmiMoveBottom, tsmiRegionCapture, tsmiQuickCrop, tsmiShowMagnifier, tsmiImageEditorBackgroundColor; private ToolStripLabeledNumericUpDown tslnudBorderSize, tslnudCornerRadius, tslnudCenterPoints, tslnudBlurRadius, tslnudPixelateSize, tslnudStepFontSize, - tslnudMagnifierPixelCount; + tslnudMagnifierPixelCount, tslnudStartingStepValue; private ToolStripLabel tslDragLeft, tslDragRight; private ToolStripLabeledComboBox tscbImageInterpolationMode, tscbCursorTypes; @@ -546,6 +546,17 @@ internal void CreateToolbar() }; tsddbShapeOptions.DropDownItems.Add(tslnudStepFontSize); + tslnudStartingStepValue = new ToolStripLabeledNumericUpDown(Resources.ShapeManager_CreateToolbar_StartingStepValue); + tslnudStartingStepValue.Content.Minimum = 1; + tslnudStartingStepValue.Content.Maximum = 10000; + tslnudStartingStepValue.Content.ValueChanged = (sender, e) => + { + AnnotationOptions.StartingStepNumber = (int)tslnudStartingStepValue.Content.Value; + UpdateCurrentShape(); + }; + tsddbShapeOptions.DropDownItems.Add(tslnudStartingStepValue); + AnnotationOptions.StartingStepNumber = 1; + tsmiStepUseLetters = new ToolStripMenuItem(Resources.ShapeManager_CreateToolbar_UseLetters); tsmiStepUseLetters.Checked = false; tsmiStepUseLetters.CheckOnClick = true;