diff --git a/readme.md b/readme.md index f9aaef6..5579863 100644 --- a/readme.md +++ b/readme.md @@ -21,8 +21,12 @@ selected my multiple click on those: unfilled drawing -\> filled with pen color -\> filled with white -\> filled with black -- Arrow : +- Numbering : + transparent background -\> edit tag Number -\> white background -\> black background + +- Arrow : Arrow draw at the beginning -\> Arrow draw at the end + (*) : head position when tool is first selected can be modified by option - Text: Text left aligned -\> Text Right aligned diff --git a/src/FormCollection.cs b/src/FormCollection.cs index 6f78cb9..5ca9714 100644 --- a/src/FormCollection.cs +++ b/src/FormCollection.cs @@ -594,7 +594,9 @@ private Stroke AddArrowStroke(int CursorX0, int CursorY0, int CursorX, int Curso private Stroke AddNumberTagStroke(int CursorX0, int CursorY0, int CursorX, int CursorY,string txt) // arrow at starting point { - Stroke st = AddEllipseStroke(CursorX0, CursorY0, (int)(CursorX0 + Root.TextSize * 1.2), (int)(CursorY0 + Root.TextSize * 1.2),0); + // for the filling, filled color is not used but this state is used to note that we edit the tag number + Stroke st = AddEllipseStroke(CursorX0, CursorY0, (int)(CursorX0 + Root.TextSize * 1.2), (int)(CursorY0 + Root.TextSize * 1.2), Root.FilledSelected==1?0:Root.FilledSelected); + st.ExtendedProperties.Add(Root.ISSTROKE_GUID, true); Point pt = new Point(CursorX0, CursorY0); IC.Renderer.PixelToInkSpace(Root.FormDisplay.gOneStrokeCanvus, ref pt); st.ExtendedProperties.Add(Root.ISTAG_GUID, true); @@ -1229,7 +1231,7 @@ public void SelectTool(int tool, int filled = -1) btNumb.BackgroundImage = global::gInk.Properties.Resources.tool_numb; btText.BackgroundImage = global::gInk.Properties.Resources.tool_txtL; btEdit.BackgroundImage = global::gInk.Properties.Resources.tool_edit; - int[] applicableTool = { 0, 2, 3 }; + int[] applicableTool = { 0, 2, 3, 6 }; if (filled >= 0) Root.FilledSelected = filled; else if ((Array.IndexOf(applicableTool,tool )>= 0) && (tool == Root.ToolSelected)) @@ -1285,7 +1287,19 @@ public void SelectTool(int tool, int filled = -1) tool = 4; } else if (tool == 6) - btNumb.BackgroundImage = global::gInk.Properties.Resources.tool_numb_act; + { + if (Root.FilledSelected == 0) + btNumb.BackgroundImage = global::gInk.Properties.Resources.tool_numb_act; + else if (Root.FilledSelected == 1) + { // we use the state FilledColor to do the modification of the tag number + SetTagNumber(); + btNumb.BackgroundImage = global::gInk.Properties.Resources.tool_numb_act; + } + else if (Root.FilledSelected == 2) + btNumb.BackgroundImage = global::gInk.Properties.Resources.tool_numb_fillW; + else if (Root.FilledSelected == 3) + btNumb.BackgroundImage = global::gInk.Properties.Resources.tool_numb_fillB; + } else if (tool == 7) btEdit.BackgroundImage = global::gInk.Properties.Resources.tool_edit_act; else if ((tool == 8)|| (tool == 9)) @@ -2185,6 +2199,30 @@ public void btColor_Click(object sender, EventArgs e) } } + public void SetTagNumber() + { + tiSlide.Stop(); + IC.Enabled = false; + ToThrough(); + int k = -1; + FormInput inp = new FormInput(Root.Local.DlgTagCaption, Root.Local.DlgTagLabel, "", false, Root, null); + + while (!Int32.TryParse(inp.TextOut(), out k)) + { + inp.TextIn(Root.TagNumbering.ToString()); + if (inp.ShowDialog() == DialogResult.Cancel) + { + inp.TextIn(""); + break; + } + } + tiSlide.Start(); + IC.Enabled = true; + ToUnThrough(); + if (inp.TextOut().Length == 0) return; + Root.TagNumbering = k; + } + public void btTool_Click(object sender, EventArgs e) { if (ToolbarMoved) @@ -2213,29 +2251,10 @@ public void btTool_Click(object sender, EventArgs e) // i = (Root.DefaultArrow_start ||Root.ToolSelected==5) ?4:5 ; else if (((Button)sender).Name.Contains("Numb")) { - if (Root.ToolSelected == 6) // if already selected, we open the index dialog + /*if (Root.ToolSelected == 6) // if already selected, we open the index dialog { - tiSlide.Stop(); - IC.Enabled = false; - ToThrough(); - int k = -1; - FormInput inp = new FormInput(Root.Local.DlgTagCaption, Root.Local.DlgTagLabel, "", false, Root, null); - - while (!Int32.TryParse(inp.TextOut(), out k)) - { - inp.TextIn(Root.TagNumbering.ToString()); - if (inp.ShowDialog() == DialogResult.Cancel) - { - inp.TextIn(""); - break; - } - } - tiSlide.Start(); - IC.Enabled = true; - ToUnThrough(); - if (inp.TextOut().Length == 0) return; - Root.TagNumbering = k; - } + SetTagNumber(); + }*/ i = 6; } else if (((Button)sender).Name.Contains("Text")) diff --git a/src/FormDisplay.cs b/src/FormDisplay.cs index 4662242..2531bcf 100644 --- a/src/FormDisplay.cs +++ b/src/FormDisplay.cs @@ -254,10 +254,9 @@ public void DrawStrokes(Graphics g) foreach (Stroke st in Root.FormCollection.IC.Ink.Strokes) { if (st.ExtendedProperties.Contains(Root.ISHIDDEN_GUID)) - ; - else if (st.ExtendedProperties.Contains(Root.ISSTROKE_GUID)) - Root.FormCollection.IC.Renderer.Draw(g, st); - else //Should not be drawn as a stroke : for the moment only filled values. + continue; + //else //Should not be drawn as a stroke : for the moment only filled values. + if(st.ExtendedProperties.Contains(Root.ISFILLEDCOLOR_GUID) || st.ExtendedProperties.Contains(Root.ISFILLEDWHITE_GUID) || st.ExtendedProperties.Contains(Root.ISFILLEDBLACK_GUID) ) { SolidBrush bru; if (st.ExtendedProperties.Contains(Root.ISFILLEDCOLOR_GUID)) @@ -288,6 +287,10 @@ public void DrawStrokes(Graphics g) } } + /*else */ + if (st.ExtendedProperties.Contains(Root.ISSTROKE_GUID)) + Root.FormCollection.IC.Renderer.Draw(g, st); + if (st.ExtendedProperties.Contains(Root.TEXT_GUID)) { Point pt = new Point((int)(st.ExtendedProperties[Root.TEXTX_GUID].Data), (int)(st.ExtendedProperties[Root.TEXTY_GUID].Data)); diff --git a/src/Properties/Resources.Designer.cs b/src/Properties/Resources.Designer.cs index a6c21a8..36d0e11 100644 --- a/src/Properties/Resources.Designer.cs +++ b/src/Properties/Resources.Designer.cs @@ -470,6 +470,36 @@ public static System.Drawing.Bitmap tool_numb_act { } } + /// + /// Recherche une ressource localisée de type System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap tool_numb_fillB { + get { + object obj = ResourceManager.GetObject("tool_numb_fillB", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Recherche une ressource localisée de type System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap tool_numb_fillC { + get { + object obj = ResourceManager.GetObject("tool_numb_fillC", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Recherche une ressource localisée de type System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap tool_numb_fillW { + get { + object obj = ResourceManager.GetObject("tool_numb_fillW", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Recherche une ressource localisée de type System.Drawing.Bitmap. /// diff --git a/src/Properties/Resources.resx b/src/Properties/Resources.resx index 61863a1..0105094 100644 --- a/src/Properties/Resources.resx +++ b/src/Properties/Resources.resx @@ -298,4 +298,13 @@ ..\pan1_act.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\tool_numb_fillB.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\tool_numb_fillC.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\tool_numb_fillW.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/src/ppInk.csproj b/src/ppInk.csproj index b00cfab..7fa41bf 100644 --- a/src/ppInk.csproj +++ b/src/ppInk.csproj @@ -235,6 +235,9 @@ + + + diff --git a/src/tool_numb_fillB.png b/src/tool_numb_fillB.png new file mode 100644 index 0000000..91ab1aa Binary files /dev/null and b/src/tool_numb_fillB.png differ diff --git a/src/tool_numb_fillC.png b/src/tool_numb_fillC.png new file mode 100644 index 0000000..adcdd83 Binary files /dev/null and b/src/tool_numb_fillC.png differ diff --git a/src/tool_numb_fillW.png b/src/tool_numb_fillW.png new file mode 100644 index 0000000..5494798 Binary files /dev/null and b/src/tool_numb_fillW.png differ