From 03b79d68fa0cbf8e8685c26069b7bc3ed33ff5e8 Mon Sep 17 00:00:00 2001 From: Ariel Rorabaugh Date: Wed, 8 Apr 2026 08:27:59 -0400 Subject: [PATCH 1/7] LT-21669: Use WS numbers data for headword numbers Change-Id: Idb7f188606c6a4354cefcbf36fc5a9ee4d35e0b4 --- Src/xWorks/HeadWordNumbersDlg.cs | 34 ++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/Src/xWorks/HeadWordNumbersDlg.cs b/Src/xWorks/HeadWordNumbersDlg.cs index dd7867ff0a..f1855ed634 100644 --- a/Src/xWorks/HeadWordNumbersDlg.cs +++ b/Src/xWorks/HeadWordNumbersDlg.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2017 SIL International +// Copyright (c) 2017 SIL International // This software is licensed under the LGPL, version 2.1 or later // (http://www.gnu.org/licenses/lgpl-2.1.html) @@ -25,6 +25,7 @@ namespace SIL.FieldWorks.XWorks public partial class HeadwordNumbersDlg : Form, IHeadwordNumbersView { private FwTextBox[] _digitBoxes; + private bool _isInitializing = false; public HeadwordNumbersDlg() { @@ -191,9 +192,17 @@ public string HomographWritingSystem get { return m_writingSystemCombo.Text; } set { - m_writingSystemCombo.SelectedIndex = m_writingSystemCombo.FindString(value); - if (m_writingSystemCombo.SelectedIndex < 0) - m_writingSystemCombo.SelectedIndex = 0; + _isInitializing = true; + try + { + m_writingSystemCombo.SelectedIndex = m_writingSystemCombo.FindString(value); + if (m_writingSystemCombo.SelectedIndex < 0) + m_writingSystemCombo.SelectedIndex = 0; + } + finally + { + _isInitializing = false; + } } } @@ -282,6 +291,23 @@ public void SetWsFactoryForCustomDigits(ILgWritingSystemFactory factory) private void m_writingSystemCombo_SelectedIndexChanged(object sender, EventArgs e) { UpdateWritingSystemCodeInDigits(); + + if (_isInitializing) + return; + + // Populate digits from ws. + var selectedWs = m_writingSystemCombo.SelectedItem as CoreWritingSystemDefinition; + if (selectedWs?.NumberingSystem != null) + { + var digits = selectedWs.NumberingSystem.Digits; + + if (!string.IsNullOrEmpty(digits)) + { + // Populate the custom digits from writing system, if all 10 digits are specified + if (digits.Length == 10) + CustomDigits = digits.ToCharArray().Select(c => c.ToString()).ToArray(); + } + } } } } From 3e1fc9a5d6d58118e7f458de458619e8923893d4 Mon Sep 17 00:00:00 2001 From: Ariel Rorabaugh Date: Tue, 14 Apr 2026 11:30:27 -0400 Subject: [PATCH 2/7] Make custom numbers in configured headword numbers read-only Change-Id: I4d07442c56d056d45372e01306cd6afe900b98de --- Src/Common/Controls/Widgets/FwTextBox.cs | 19 ++ Src/xWorks/HeadWordNumbersDlg.cs | 18 +- Src/xWorks/HeadWordNumbersDlg.designer.cs | 2 +- Src/xWorks/HeadWordNumbersDlg.resx | 381 +++++++++++++++------- 4 files changed, 290 insertions(+), 130 deletions(-) diff --git a/Src/Common/Controls/Widgets/FwTextBox.cs b/Src/Common/Controls/Widgets/FwTextBox.cs index 24cbed7c99..f6b5a24dc7 100644 --- a/Src/Common/Controls/Widgets/FwTextBox.cs +++ b/Src/Common/Controls/Widgets/FwTextBox.cs @@ -965,6 +965,25 @@ public override Color ForeColor } } + /// + /// Gets or sets a value indicating whether the text box is read-only. + /// + /// true if the text box is read-only; otherwise, false. + [Browsable(true), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public bool ReadOnlyView + { + get + { + CheckDisposed(); + return m_innerFwTextBox.ReadOnlyView; + } + set + { + CheckDisposed(); + m_innerFwTextBox.ReadOnlyView = value; + } + } + /// ------------------------------------------------------------------------------------ /// /// Allows the control to function like an ordinary text box, setting and reading its text. diff --git a/Src/xWorks/HeadWordNumbersDlg.cs b/Src/xWorks/HeadWordNumbersDlg.cs index f1855ed634..ec394d7c1f 100644 --- a/Src/xWorks/HeadWordNumbersDlg.cs +++ b/Src/xWorks/HeadWordNumbersDlg.cs @@ -25,7 +25,6 @@ namespace SIL.FieldWorks.XWorks public partial class HeadwordNumbersDlg : Form, IHeadwordNumbersView { private FwTextBox[] _digitBoxes; - private bool _isInitializing = false; public HeadwordNumbersDlg() { @@ -192,17 +191,9 @@ public string HomographWritingSystem get { return m_writingSystemCombo.Text; } set { - _isInitializing = true; - try - { - m_writingSystemCombo.SelectedIndex = m_writingSystemCombo.FindString(value); - if (m_writingSystemCombo.SelectedIndex < 0) - m_writingSystemCombo.SelectedIndex = 0; - } - finally - { - _isInitializing = false; - } + m_writingSystemCombo.SelectedIndex = m_writingSystemCombo.FindString(value); + if (m_writingSystemCombo.SelectedIndex < 0) + m_writingSystemCombo.SelectedIndex = 0; } } @@ -292,9 +283,6 @@ private void m_writingSystemCombo_SelectedIndexChanged(object sender, EventArgs { UpdateWritingSystemCodeInDigits(); - if (_isInitializing) - return; - // Populate digits from ws. var selectedWs = m_writingSystemCombo.SelectedItem as CoreWritingSystemDefinition; if (selectedWs?.NumberingSystem != null) diff --git a/Src/xWorks/HeadWordNumbersDlg.designer.cs b/Src/xWorks/HeadWordNumbersDlg.designer.cs index e4a4f037e0..2b97781a9c 100644 --- a/Src/xWorks/HeadWordNumbersDlg.designer.cs +++ b/Src/xWorks/HeadWordNumbersDlg.designer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2017 SIL International +// Copyright (c) 2017 SIL International // This software is licensed under the LGPL, version 2.1 or later // (http://www.gnu.org/licenses/lgpl-2.1.html) diff --git a/Src/xWorks/HeadWordNumbersDlg.resx b/Src/xWorks/HeadWordNumbersDlg.resx index 69990a15ca..8ee063f171 100644 --- a/Src/xWorks/HeadWordNumbersDlg.resx +++ b/Src/xWorks/HeadWordNumbersDlg.resx @@ -123,10 +123,14 @@ - 15, 161 + 20, 198 + + + + 4, 0, 4, 0 - 287, 13 + 356, 16 5 @@ -150,10 +154,13 @@ True - 6, 21 + 8, 26 + + + 4, 4, 4, 4 - 121, 17 + 152, 20 4 @@ -176,15 +183,17 @@ True - NoControl - 26, 40 + 35, 49 + + + 4, 4, 4, 4 - 96, 17 + 119, 20 5 @@ -205,10 +214,13 @@ 1 - 120, 3 + 160, 4 + + + 4, 4, 4, 4 - 75, 23 + 100, 28 6 @@ -229,10 +241,13 @@ 2 - 201, 3 + 268, 4 + + + 4, 4, 4, 4 - 75, 23 + 100, 28 7 @@ -253,10 +268,13 @@ 1 - 282, 3 + 376, 4 + + + 4, 4, 4, 4 - 75, 23 + 100, 28 8 @@ -280,10 +298,13 @@ True - 5, 19 + 7, 23 + + + 4, 4, 4, 4 - 56, 17 + 68, 20 0 @@ -307,10 +328,13 @@ True - 80, 20 + 107, 25 + + + 4, 4, 4, 4 - 47, 17 + 55, 20 1 @@ -340,10 +364,13 @@ Top, Left, Right - 3, 3 + 4, 4 + + + 4, 4, 4, 4 - 338, 46 + 451, 57 0 @@ -366,13 +393,16 @@ 0 - 3, 55 + 4, 69 + + + 4, 4, 4, 4 True - 338, 31 + 451, 38 1 @@ -397,10 +427,13 @@ Example-string DO NOT LOCALIZE THIS STRING TopDown - 6, 3 + 8, 4 + + + 4, 4, 4, 4 - 360, 97 + 480, 119 2 @@ -418,10 +451,16 @@ Example-string DO NOT LOCALIZE THIS STRING 0 - 6, 279 + 8, 345 + + + 4, 4, 4, 4 + + + 4, 4, 4, 4 - 270, 61 + 360, 75 1 @@ -448,10 +487,13 @@ Example-string DO NOT LOCALIZE THIS STRING NoControl - 153, 20 + 204, 25 + + + 4, 4, 4, 4 - 51, 17 + 61, 20 2 @@ -472,10 +514,16 @@ Example-string DO NOT LOCALIZE THIS STRING 0 - 6, 106 + 8, 131 + + + 4, 4, 4, 4 + + + 4, 4, 4, 4 - 270, 44 + 360, 54 0 @@ -502,10 +550,13 @@ Example-string DO NOT LOCALIZE THIS STRING RightToLeft - 6, 507 + 8, 624 + + + 4, 4, 4, 4 - 360, 31 + 480, 38 18 @@ -532,10 +583,13 @@ Example-string DO NOT LOCALIZE THIS STRING Microsoft Sans Serif, 100pt - 273, 31 + 364, 39 + + + 4, 4, 4, 4 - 25, 23 + 33, 27 18 @@ -544,7 +598,7 @@ Example-string DO NOT LOCALIZE THIS STRING m_digitNine - SIL.FieldWorks.Common.Widgets.FwTextBox, Widgets, Version=8.3.5.25382, Culture=neutral, PublicKeyToken=null + SIL.FieldWorks.Common.Widgets.FwTextBox, Widgets, Version=9.3.8.0, Culture=neutral, PublicKeyToken=null tableLayoutPanel1 @@ -559,10 +613,13 @@ Example-string DO NOT LOCALIZE THIS STRING Microsoft Sans Serif, 100pt - 243, 31 + 324, 39 + + + 4, 4, 4, 4 - 24, 23 + 32, 27 17 @@ -571,7 +628,7 @@ Example-string DO NOT LOCALIZE THIS STRING m_digitEight - SIL.FieldWorks.Common.Widgets.FwTextBox, Widgets, Version=8.3.5.25382, Culture=neutral, PublicKeyToken=null + SIL.FieldWorks.Common.Widgets.FwTextBox, Widgets, Version=9.3.8.0, Culture=neutral, PublicKeyToken=null tableLayoutPanel1 @@ -586,10 +643,13 @@ Example-string DO NOT LOCALIZE THIS STRING Microsoft Sans Serif, 100pt - 213, 31 + 284, 39 + + + 4, 4, 4, 4 - 24, 23 + 32, 27 16 @@ -598,7 +658,7 @@ Example-string DO NOT LOCALIZE THIS STRING m_digitSeven - SIL.FieldWorks.Common.Widgets.FwTextBox, Widgets, Version=8.3.5.25382, Culture=neutral, PublicKeyToken=null + SIL.FieldWorks.Common.Widgets.FwTextBox, Widgets, Version=9.3.8.0, Culture=neutral, PublicKeyToken=null tableLayoutPanel1 @@ -613,10 +673,13 @@ Example-string DO NOT LOCALIZE THIS STRING Microsoft Sans Serif, 100pt - 183, 31 + 244, 39 + + + 4, 4, 4, 4 - 24, 23 + 32, 27 15 @@ -625,7 +688,7 @@ Example-string DO NOT LOCALIZE THIS STRING m_digitSix - SIL.FieldWorks.Common.Widgets.FwTextBox, Widgets, Version=8.3.5.25382, Culture=neutral, PublicKeyToken=null + SIL.FieldWorks.Common.Widgets.FwTextBox, Widgets, Version=9.3.8.0, Culture=neutral, PublicKeyToken=null tableLayoutPanel1 @@ -640,10 +703,13 @@ Example-string DO NOT LOCALIZE THIS STRING Microsoft Sans Serif, 100pt - 153, 31 + 204, 39 + + + 4, 4, 4, 4 - 24, 23 + 32, 27 14 @@ -652,7 +718,7 @@ Example-string DO NOT LOCALIZE THIS STRING m_digitFive - SIL.FieldWorks.Common.Widgets.FwTextBox, Widgets, Version=8.3.5.25382, Culture=neutral, PublicKeyToken=null + SIL.FieldWorks.Common.Widgets.FwTextBox, Widgets, Version=9.3.8.0, Culture=neutral, PublicKeyToken=null tableLayoutPanel1 @@ -667,10 +733,13 @@ Example-string DO NOT LOCALIZE THIS STRING Microsoft Sans Serif, 100pt - 123, 31 + 164, 39 + + + 4, 4, 4, 4 - 24, 23 + 32, 27 13 @@ -679,7 +748,7 @@ Example-string DO NOT LOCALIZE THIS STRING m_digitFour - SIL.FieldWorks.Common.Widgets.FwTextBox, Widgets, Version=8.3.5.25382, Culture=neutral, PublicKeyToken=null + SIL.FieldWorks.Common.Widgets.FwTextBox, Widgets, Version=9.3.8.0, Culture=neutral, PublicKeyToken=null tableLayoutPanel1 @@ -694,10 +763,13 @@ Example-string DO NOT LOCALIZE THIS STRING Microsoft Sans Serif, 100pt - 93, 31 + 124, 39 + + + 4, 4, 4, 4 - 24, 23 + 32, 27 12 @@ -706,7 +778,7 @@ Example-string DO NOT LOCALIZE THIS STRING m_digitThree - SIL.FieldWorks.Common.Widgets.FwTextBox, Widgets, Version=8.3.5.25382, Culture=neutral, PublicKeyToken=null + SIL.FieldWorks.Common.Widgets.FwTextBox, Widgets, Version=9.3.8.0, Culture=neutral, PublicKeyToken=null tableLayoutPanel1 @@ -721,10 +793,13 @@ Example-string DO NOT LOCALIZE THIS STRING Microsoft Sans Serif, 100pt - 63, 31 + 84, 39 + + + 4, 4, 4, 4 - 24, 23 + 32, 27 11 @@ -733,7 +808,7 @@ Example-string DO NOT LOCALIZE THIS STRING m_digitTwo - SIL.FieldWorks.Common.Widgets.FwTextBox, Widgets, Version=8.3.5.25382, Culture=neutral, PublicKeyToken=null + SIL.FieldWorks.Common.Widgets.FwTextBox, Widgets, Version=9.3.8.0, Culture=neutral, PublicKeyToken=null tableLayoutPanel1 @@ -748,10 +823,13 @@ Example-string DO NOT LOCALIZE THIS STRING Microsoft Sans Serif, 100pt - 33, 31 + 44, 39 + + + 4, 4, 4, 4 - 24, 23 + 32, 27 10 @@ -760,7 +838,7 @@ Example-string DO NOT LOCALIZE THIS STRING m_digitOne - SIL.FieldWorks.Common.Widgets.FwTextBox, Widgets, Version=8.3.5.25382, Culture=neutral, PublicKeyToken=null + SIL.FieldWorks.Common.Widgets.FwTextBox, Widgets, Version=9.3.8.0, Culture=neutral, PublicKeyToken=null tableLayoutPanel1 @@ -775,10 +853,13 @@ Example-string DO NOT LOCALIZE THIS STRING Microsoft Sans Serif, 100pt - 3, 31 + 4, 39 + + + 4, 4, 4, 4 - 24, 23 + 32, 27 4 @@ -787,7 +868,7 @@ Example-string DO NOT LOCALIZE THIS STRING m_digitZero - SIL.FieldWorks.Common.Widgets.FwTextBox, Widgets, Version=8.3.5.25382, Culture=neutral, PublicKeyToken=null + SIL.FieldWorks.Common.Widgets.FwTextBox, Widgets, Version=9.3.8.0, Culture=neutral, PublicKeyToken=null tableLayoutPanel1 @@ -805,10 +886,13 @@ Example-string DO NOT LOCALIZE THIS STRING NoControl - 273, 0 + 364, 0 + + + 4, 0, 4, 0 - 25, 28 + 33, 35 9 @@ -841,10 +925,13 @@ Example-string DO NOT LOCALIZE THIS STRING NoControl - 243, 0 + 324, 0 + + + 4, 0, 4, 0 - 24, 28 + 32, 35 8 @@ -877,10 +964,13 @@ Example-string DO NOT LOCALIZE THIS STRING NoControl - 213, 0 + 284, 0 + + + 4, 0, 4, 0 - 24, 28 + 32, 35 7 @@ -913,10 +1003,13 @@ Example-string DO NOT LOCALIZE THIS STRING NoControl - 183, 0 + 244, 0 + + + 4, 0, 4, 0 - 24, 28 + 32, 35 6 @@ -949,10 +1042,13 @@ Example-string DO NOT LOCALIZE THIS STRING NoControl - 153, 0 + 204, 0 + + + 4, 0, 4, 0 - 24, 28 + 32, 35 5 @@ -985,10 +1081,13 @@ Example-string DO NOT LOCALIZE THIS STRING NoControl - 123, 0 + 164, 0 + + + 4, 0, 4, 0 - 24, 28 + 32, 35 4 @@ -1021,10 +1120,13 @@ Example-string DO NOT LOCALIZE THIS STRING NoControl - 93, 0 + 124, 0 + + + 4, 0, 4, 0 - 24, 28 + 32, 35 3 @@ -1057,10 +1159,13 @@ Example-string DO NOT LOCALIZE THIS STRING NoControl - 63, 0 + 84, 0 + + + 4, 0, 4, 0 - 24, 28 + 32, 35 2 @@ -1093,10 +1198,13 @@ Example-string DO NOT LOCALIZE THIS STRING NoControl - 33, 0 + 44, 0 + + + 4, 0, 4, 0 - 24, 28 + 32, 35 1 @@ -1126,10 +1234,13 @@ Example-string DO NOT LOCALIZE THIS STRING True - 3, 0 + 4, 0 + + + 4, 0, 4, 0 - 24, 28 + 32, 35 0 @@ -1153,13 +1264,16 @@ Example-string DO NOT LOCALIZE THIS STRING 19 - 7, 75 + 9, 92 + + + 4, 4, 4, 4 2 - 301, 57 + 401, 70 3 @@ -1180,19 +1294,22 @@ Example-string DO NOT LOCALIZE THIS STRING <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="m_digitNine" Row="1" RowSpan="1" Column="9" ColumnSpan="1" /><Control Name="m_digitEight" Row="1" RowSpan="1" Column="8" ColumnSpan="1" /><Control Name="m_digitSeven" Row="1" RowSpan="1" Column="7" ColumnSpan="1" /><Control Name="m_digitSix" Row="1" RowSpan="1" Column="6" ColumnSpan="1" /><Control Name="m_digitFive" Row="1" RowSpan="1" Column="5" ColumnSpan="1" /><Control Name="m_digitFour" Row="1" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="m_digitThree" Row="1" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="m_digitTwo" Row="1" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="m_digitOne" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="m_digitZero" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label11" Row="0" RowSpan="1" Column="9" ColumnSpan="1" /><Control Name="label10" Row="0" RowSpan="1" Column="8" ColumnSpan="1" /><Control Name="label9" Row="0" RowSpan="1" Column="7" ColumnSpan="1" /><Control Name="label8" Row="0" RowSpan="1" Column="6" ColumnSpan="1" /><Control Name="label7" Row="0" RowSpan="1" Column="5" ColumnSpan="1" /><Control Name="label6" Row="0" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="label4" Row="0" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="label3" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="label2" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label1" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,10,Percent,10,Percent,10,Percent,10,Percent,10,Percent,10,Percent,10,Percent,10,Percent,10,Percent,10" /><Rows Styles="Percent,50,Percent,50" /></TableLayoutSettings> - 6, 45 + 8, 55 + + + 4, 4, 4, 4 True - 346, 38 + 461, 47 2 - To use characters other than 0-9 for homograph and sense numbers enter the characters here: + If the selected Writing System uses custom numbers, they will be displayed below and used for homograph and sense numbers. Custom numbers can be specified in the Writing System configuration. m_customNumbersLabel @@ -1207,10 +1324,13 @@ Example-string DO NOT LOCALIZE THIS STRING 1 - 5, 18 + 7, 22 + + + 4, 4, 4, 4 - 184, 21 + 244, 24 1 @@ -1231,10 +1351,13 @@ Example-string DO NOT LOCALIZE THIS STRING True - 3, 2 + 4, 2 + + + 4, 0, 4, 0 - 246, 13 + 310, 16 0 @@ -1255,10 +1378,13 @@ Example-string DO NOT LOCALIZE THIS STRING 3 - 6, 346 + 8, 428 + + + 4, 4, 4, 4 - 341, 138 + 455, 170 22 @@ -1276,10 +1402,13 @@ Example-string DO NOT LOCALIZE THIS STRING 4 - 195, 29 + 260, 36 + + + 4, 4, 4, 4 - 75, 21 + 100, 26 3 @@ -1300,13 +1429,16 @@ Example-string DO NOT LOCALIZE THIS STRING 0 - 3, 3 + 4, 4 + + + 4, 4, 4, 4 True - 335, 24 + 447, 30 0 @@ -1327,10 +1459,13 @@ Example-string DO NOT LOCALIZE THIS STRING 1 - 3, 29 + 4, 36 + + + 4, 4, 4, 4 - 186, 21 + 247, 24 4 @@ -1348,10 +1483,13 @@ Example-string DO NOT LOCALIZE THIS STRING 2 - 6, 156 + 8, 193 + + + 4, 4, 4, 4 - 341, 57 + 455, 70 21 @@ -1372,10 +1510,13 @@ Example-string DO NOT LOCALIZE THIS STRING NoControl - 195, 27 + 260, 33 + + + 4, 4, 4, 4 - 75, 21 + 100, 26 6 @@ -1396,13 +1537,16 @@ Example-string DO NOT LOCALIZE THIS STRING 0 - 3, 0 + 4, 0 + + + 4, 4, 4, 4 True - 335, 24 + 447, 30 5 @@ -1423,10 +1567,13 @@ Example-string DO NOT LOCALIZE THIS STRING 1 - 3, 27 + 4, 33 + + + 4, 4, 4, 4 - 186, 21 + 247, 24 7 @@ -1444,10 +1591,13 @@ Example-string DO NOT LOCALIZE THIS STRING 2 - 6, 219 + 8, 271 + + + 4, 4, 4, 4 - 341, 54 + 455, 66 23 @@ -1471,16 +1621,16 @@ Example-string DO NOT LOCALIZE THIS STRING 0, 0 - 5, 5, 5, 5 + 7, 6, 7, 6 - 3, 0, 0, 0 + 4, 0, 0, 0 7 - 369, 541 + 492, 666 16 @@ -1504,13 +1654,16 @@ Example-string DO NOT LOCALIZE THIS STRING True - 6, 13 + 8, 16 - 369, 541 + 492, 666 + + + 4, 4, 4, 4 - 385, 580 + 507, 703 Configure Headword Numbers From 2c4455b8545e556c3783b6e9e299c4742ccc74a9 Mon Sep 17 00:00:00 2001 From: Ariel Rorabaugh Date: Tue, 14 Apr 2026 11:48:34 -0400 Subject: [PATCH 3/7] Update ws custom number message Change-Id: I12eb1013eb7a58f6f21d291d3f21bcd03acf8cb1 --- Src/xWorks/HeadWordNumbersDlg.resx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/xWorks/HeadWordNumbersDlg.resx b/Src/xWorks/HeadWordNumbersDlg.resx index 8ee063f171..3cd953da6a 100644 --- a/Src/xWorks/HeadWordNumbersDlg.resx +++ b/Src/xWorks/HeadWordNumbersDlg.resx @@ -1309,7 +1309,7 @@ Example-string DO NOT LOCALIZE THIS STRING 2 - If the selected Writing System uses custom numbers, they will be displayed below and used for homograph and sense numbers. Custom numbers can be specified in the Writing System configuration. + If the writing system uses custom numbers, they will be displayed below. Custom numbers can be specified in writing system configuration. m_customNumbersLabel From cd14532e085f5e8464f13ef0c1ed2d6cfe5a3736 Mon Sep 17 00:00:00 2001 From: Ariel Rorabaugh Date: Wed, 15 Apr 2026 11:54:20 -0400 Subject: [PATCH 4/7] Remove homograph number customization options from dict config Change-Id: I1c1f70733d15cd4b2a439be7ec60aa22e6c650f7 --- Src/xWorks/ConfiguredLcmGenerator.cs | 8 ++++-- Src/xWorks/DictionaryConfigurationModel.cs | 18 ++++++------ Src/xWorks/HeadWordNumbersController.cs | 26 ++++++++++-------- Src/xWorks/HeadWordNumbersDlg.cs | 32 +++++++++------------- Src/xWorks/HeadWordNumbersDlg.designer.cs | 10 +++++++ Src/xWorks/IHeadwordNumbersView.cs | 1 - 6 files changed, 51 insertions(+), 44 deletions(-) diff --git a/Src/xWorks/ConfiguredLcmGenerator.cs b/Src/xWorks/ConfiguredLcmGenerator.cs index d302e9c60f..7f64037632 100644 --- a/Src/xWorks/ConfiguredLcmGenerator.cs +++ b/Src/xWorks/ConfiguredLcmGenerator.cs @@ -2476,12 +2476,14 @@ private static string GetSenseNumber(string numberingStyle, ILexSense sense, break; default: // handles %d and %O. We no longer support "%z" (1 b iii) because users can hand-configure its equivalent nextNumber = senseCount.ToString(); - // Use the digits from the CustomHomographNumbers if they are defined - if (info.HomographConfig.CustomHomographNumbers.Count == 10) + // Use writing system's numbering system for sense numbers. + var wsString = GetWsForEntryType(sense, sense?.Cache); + var writingSystem = sense?.Cache.ServiceLocator.WritingSystemManager.Get(wsString); + if (writingSystem != null && writingSystem.NumberingSystem.Digits.Length == 10) { for (var digit = 0; digit < 10; ++digit) { - nextNumber = nextNumber.Replace(digit.ToString(), info.HomographConfig.CustomHomographNumbers[digit]); + nextNumber = nextNumber.Replace(digit.ToString(), writingSystem.NumberingSystem.Digits[digit].ToString()); } } break; diff --git a/Src/xWorks/DictionaryConfigurationModel.cs b/Src/xWorks/DictionaryConfigurationModel.cs index 9e7a06da32..0a7bb821a8 100644 --- a/Src/xWorks/DictionaryConfigurationModel.cs +++ b/Src/xWorks/DictionaryConfigurationModel.cs @@ -201,7 +201,7 @@ public void Load(LcmCache cache) else { HomographConfiguration.HomographWritingSystem = string.Empty; - HomographConfiguration.CustomHomographNumbers = string.Empty; + //HomographConfiguration.CustomHomographNumbers = string.Empty; } } @@ -370,7 +370,7 @@ public DictionaryHomographConfiguration(DictionaryHomographConfiguration other) ShowSenseNumberReversal = other.ShowSenseNumberReversal; HomographNumberBefore = other.HomographNumberBefore; HomographWritingSystem = other.HomographWritingSystem; - CustomHomographNumberList = other.CustomHomographNumberList != null ? new List(other.CustomHomographNumberList) : null; + //CustomHomographNumberList = other.CustomHomographNumberList != null ? new List(other.CustomHomographNumberList) : null; } public DictionaryHomographConfiguration(HomographConfiguration config) @@ -382,7 +382,7 @@ public DictionaryHomographConfiguration(HomographConfiguration config) ShowHwNumInCrossRef = config.ShowHomographNumber(HomographConfiguration.HeadwordVariant.DictionaryCrossRef); ShowHwNumInReversalCrossRef = config.ShowHomographNumber(HomographConfiguration.HeadwordVariant.ReversalCrossRef); HomographWritingSystem = config.WritingSystem; - CustomHomographNumberList = config.CustomHomographNumbers; + //CustomHomographNumberList = config.CustomHomographNumbers; } /// @@ -397,11 +397,11 @@ public void ExportToHomographConfiguration(HomographConfiguration config) config.SetShowHomographNumber(HomographConfiguration.HeadwordVariant.DictionaryCrossRef, ShowHwNumInCrossRef); config.SetShowHomographNumber(HomographConfiguration.HeadwordVariant.ReversalCrossRef, ShowHwNumInReversalCrossRef); config.WritingSystem = HomographWritingSystem; - config.CustomHomographNumbers = CustomHomographNumberList; + //config.CustomHomographNumbers = CustomHomographNumberList; } - [XmlIgnore] - public List CustomHomographNumberList { get; internal set; } + //[XmlIgnore] + //public List CustomHomographNumberList { get; internal set; } [XmlAttribute("showHwNumInReversalCrossRef")] public bool ShowHwNumInReversalCrossRef { get; set; } @@ -421,8 +421,8 @@ public void ExportToHomographConfiguration(HomographConfiguration config) [XmlAttribute("homographNumberBefore")] public bool HomographNumberBefore { get; set; } - [XmlAttribute("customHomographNumbers")] - public string CustomHomographNumbers + //[XmlAttribute("customHomographNumbers")] + /*public string CustomHomographNumbers { get { @@ -432,7 +432,7 @@ public string CustomHomographNumbers { CustomHomographNumberList = new List(WebUtility.HtmlDecode(value).Split(new []{','}, StringSplitOptions.RemoveEmptyEntries)); } - } + }*/ [XmlAttribute("homographWritingSystem")] public string HomographWritingSystem { get; set; } diff --git a/Src/xWorks/HeadWordNumbersController.cs b/Src/xWorks/HeadWordNumbersController.cs index e71f236264..de4e66398d 100644 --- a/Src/xWorks/HeadWordNumbersController.cs +++ b/Src/xWorks/HeadWordNumbersController.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2017 SIL International +// Copyright (c) 2017 SIL International // This software is licensed under the LGPL, version 2.1 or later // (http://www.gnu.org/licenses/lgpl-2.1.html) @@ -35,7 +35,6 @@ public HeadwordNumbersController(IHeadwordNumbersView view, DictionaryConfigurat model.Label); _view.SetWsFactoryForCustomDigits(cache.WritingSystemFactory); _view.AvailableWritingSystems = cache.LangProject.CurrentAnalysisWritingSystems.Union(cache.LangProject.CurrentVernacularWritingSystems); - _view.CustomDigits = _homographConfig.CustomHomographNumberList; if (_cache.LangProject.AllWritingSystems.Any(ws => ws.Id == _homographConfig.HomographWritingSystem)) { _view.HomographWritingSystem = string.IsNullOrEmpty(_homographConfig.HomographWritingSystem) @@ -46,19 +45,23 @@ public HeadwordNumbersController(IHeadwordNumbersView view, DictionaryConfigurat { _view.HomographWritingSystem = _cache.LangProject.AllWritingSystems.First().DisplayLabel; } + // If possible, get digits from the writing system's numbering system, + // otherwise use an empty list (which will be treated as default digits in the view). + IEnumerable wsCustomDigits = new List(); + var writingSystem = cache.ServiceLocator.WritingSystemManager.Get(_homographConfig.HomographWritingSystem); + if (writingSystem != null && writingSystem.NumberingSystem.Digits.Length == 10) + { + for (var digit = 0; digit < 10; ++digit) + { + wsCustomDigits = wsCustomDigits.Append(writingSystem.NumberingSystem.Digits[digit].ToString()); + } + } + _view.CustomDigits = wsCustomDigits; _view.HomographBefore = _homographConfig.HomographNumberBefore; _view.ShowHomograph = _homographConfig.ShowHwNumber; _view.ShowHomographOnCrossRef = _model.IsReversal ? _homographConfig.ShowHwNumInReversalCrossRef : _homographConfig.ShowHwNumInCrossRef; _view.ShowSenseNumber = _model.IsReversal ? _homographConfig.ShowSenseNumberReversal : _homographConfig.ShowSenseNumber; - _view.OkButtonEnabled = _homographConfig.CustomHomographNumberList == null - || !_homographConfig.CustomHomographNumberList.Any() || _homographConfig.CustomHomographNumberList.Count == 10; - _view.CustomDigitsChanged += OnViewCustomDigitsChanged; - } - - private void OnViewCustomDigitsChanged(object sender, EventArgs eventArgs) - { - _view.OkButtonEnabled = !_view.CustomDigits.Any() - || _view.CustomDigits.Count(digit => !string.IsNullOrWhiteSpace(digit)) == 10; + _view.OkButtonEnabled = true; } /// @@ -93,7 +96,6 @@ public void Save() } _homographConfig.HomographWritingSystem = string.IsNullOrEmpty(_view.HomographWritingSystem) ? null : _cache.LangProject.AllWritingSystems.First(ws => ws.DisplayLabel == _view.HomographWritingSystem).Id; - _homographConfig.CustomHomographNumberList = _view.CustomDigits == null ? new List() : new List(_view.CustomDigits); _model.HomographConfiguration = _homographConfig; _homographConfig.ExportToHomographConfiguration(_cache.ServiceLocator.GetInstance()); } diff --git a/Src/xWorks/HeadWordNumbersDlg.cs b/Src/xWorks/HeadWordNumbersDlg.cs index ec394d7c1f..b4807a9b9a 100644 --- a/Src/xWorks/HeadWordNumbersDlg.cs +++ b/Src/xWorks/HeadWordNumbersDlg.cs @@ -213,6 +213,17 @@ private void UpdateWritingSystemCodeInDigits() } } + /// + /// Set the font in each digit textbox + /// + private void UpdateFontInDigits(System.Drawing.Font digitFont) + { + foreach (var digit in _digitBoxes) + { + digit.Font = digitFont; + } + } + public IEnumerable AvailableWritingSystems { set @@ -240,24 +251,6 @@ public IEnumerable CustomDigits get { return _digitBoxes.Select(db => db.Text).Where(text => !string.IsNullOrEmpty(text)); } } - public event EventHandler CustomDigitsChanged - { - add - { - foreach (var textBox in _digitBoxes) - { - textBox.TextChanged += value; - } - } - remove - { - foreach (var textBox in _digitBoxes) - { - textBox.TextChanged -= value; - } - } - } - public bool OkButtonEnabled { get { return m_btnOk.Enabled; } set { m_btnOk.Enabled = value; } } public LcmStyleSheet SetStyleSheet @@ -288,7 +281,8 @@ private void m_writingSystemCombo_SelectedIndexChanged(object sender, EventArgs if (selectedWs?.NumberingSystem != null) { var digits = selectedWs.NumberingSystem.Digits; - + UpdateFontInDigits(new System.Drawing.Font(string.IsNullOrWhiteSpace(selectedWs.DefaultFontName) ? "Segoe" : selectedWs.DefaultFontName, + selectedWs.DefaultFontSize == 0.0f ? 12 : selectedWs.DefaultFontSize)); ; if (!string.IsNullOrEmpty(digits)) { // Populate the custom digits from writing system, if all 10 digits are specified diff --git a/Src/xWorks/HeadWordNumbersDlg.designer.cs b/Src/xWorks/HeadWordNumbersDlg.designer.cs index 2b97781a9c..8abce6f9bd 100644 --- a/Src/xWorks/HeadWordNumbersDlg.designer.cs +++ b/Src/xWorks/HeadWordNumbersDlg.designer.cs @@ -270,6 +270,7 @@ private void InitializeComponent() this.m_digitNine.controlID = null; this.m_digitNine.HasBorder = true; this.m_digitNine.Name = "m_digitNine"; + this.m_digitNine.ReadOnlyView = true; this.m_digitNine.SuppressEnter = false; this.m_digitNine.WordWrap = false; // @@ -282,6 +283,7 @@ private void InitializeComponent() this.m_digitEight.controlID = null; this.m_digitEight.HasBorder = true; this.m_digitEight.Name = "m_digitEight"; + this.m_digitEight.ReadOnlyView = true; this.m_digitEight.SuppressEnter = false; this.m_digitEight.WordWrap = false; // @@ -294,6 +296,7 @@ private void InitializeComponent() this.m_digitSeven.controlID = null; this.m_digitSeven.HasBorder = true; this.m_digitSeven.Name = "m_digitSeven"; + this.m_digitSeven.ReadOnlyView = true; this.m_digitSeven.SuppressEnter = false; this.m_digitSeven.WordWrap = false; // @@ -306,6 +309,7 @@ private void InitializeComponent() this.m_digitSix.controlID = null; this.m_digitSix.HasBorder = true; this.m_digitSix.Name = "m_digitSix"; + this.m_digitSix.ReadOnlyView = true; this.m_digitSix.SuppressEnter = false; this.m_digitSix.WordWrap = false; // @@ -318,6 +322,7 @@ private void InitializeComponent() this.m_digitFive.controlID = null; this.m_digitFive.HasBorder = true; this.m_digitFive.Name = "m_digitFive"; + this.m_digitFive.ReadOnlyView = true; this.m_digitFive.SuppressEnter = false; this.m_digitFive.WordWrap = false; // @@ -330,6 +335,7 @@ private void InitializeComponent() this.m_digitFour.controlID = null; this.m_digitFour.HasBorder = true; this.m_digitFour.Name = "m_digitFour"; + this.m_digitFour.ReadOnlyView = true; this.m_digitFour.SuppressEnter = false; this.m_digitFour.WordWrap = false; // @@ -342,6 +348,7 @@ private void InitializeComponent() this.m_digitThree.controlID = null; this.m_digitThree.HasBorder = true; this.m_digitThree.Name = "m_digitThree"; + this.m_digitThree.ReadOnlyView = true; this.m_digitThree.SuppressEnter = false; this.m_digitThree.WordWrap = false; // @@ -354,6 +361,7 @@ private void InitializeComponent() this.m_digitTwo.controlID = null; this.m_digitTwo.HasBorder = true; this.m_digitTwo.Name = "m_digitTwo"; + this.m_digitTwo.ReadOnlyView = true; this.m_digitTwo.SuppressEnter = false; this.m_digitTwo.WordWrap = false; // @@ -366,6 +374,7 @@ private void InitializeComponent() this.m_digitOne.controlID = null; this.m_digitOne.HasBorder = true; this.m_digitOne.Name = "m_digitOne"; + this.m_digitOne.ReadOnlyView = true; this.m_digitOne.SuppressEnter = false; this.m_digitOne.WordWrap = false; // @@ -378,6 +387,7 @@ private void InitializeComponent() this.m_digitZero.controlID = null; this.m_digitZero.HasBorder = true; this.m_digitZero.Name = "m_digitZero"; + this.m_digitZero.ReadOnlyView = true; this.m_digitZero.SuppressEnter = false; this.m_digitZero.WordWrap = false; // diff --git a/Src/xWorks/IHeadwordNumbersView.cs b/Src/xWorks/IHeadwordNumbersView.cs index 5d65a339aa..e0813e597f 100644 --- a/Src/xWorks/IHeadwordNumbersView.cs +++ b/Src/xWorks/IHeadwordNumbersView.cs @@ -16,7 +16,6 @@ namespace SIL.FieldWorks.XWorks public interface IHeadwordNumbersView { event EventHandler RunStylesDialog; - event EventHandler CustomDigitsChanged; bool HomographBefore { get; set; } bool ShowHomograph { get; set; } bool ShowHomographOnCrossRef { get; set; } From b9eeaa62eceac1a418ec9cf229fad0e644dac73c Mon Sep 17 00:00:00 2001 From: Ariel Rorabaugh Date: Wed, 22 Apr 2026 09:45:32 -0400 Subject: [PATCH 5/7] Handle UTF-16 surrogate pairs in WS numbers Also, change Configure Headword Numbers dlg to use Winforms labels for WS number display instead of Fwtextboxes, which don't display all glyphs correctly Change-Id: I72e3209a37fba682a67666ba3d02141c9a5a5edb --- Src/xWorks/ConfiguredLcmGenerator.cs | 5 +- Src/xWorks/DictionaryDetailsController.cs | 1 - Src/xWorks/HeadWordNumbersController.cs | 10 +- Src/xWorks/HeadWordNumbersDlg.cs | 50 +-- Src/xWorks/HeadWordNumbersDlg.designer.cs | 141 +------ Src/xWorks/HeadWordNumbersDlg.resx | 493 +++++++++++++++------- Src/xWorks/HeadWordNumbersHelper.cs | 34 ++ Src/xWorks/IHeadwordNumbersView.cs | 1 - 8 files changed, 397 insertions(+), 338 deletions(-) create mode 100644 Src/xWorks/HeadWordNumbersHelper.cs diff --git a/Src/xWorks/ConfiguredLcmGenerator.cs b/Src/xWorks/ConfiguredLcmGenerator.cs index 7f64037632..6f548701a8 100644 --- a/Src/xWorks/ConfiguredLcmGenerator.cs +++ b/Src/xWorks/ConfiguredLcmGenerator.cs @@ -2479,11 +2479,12 @@ private static string GetSenseNumber(string numberingStyle, ILexSense sense, // Use writing system's numbering system for sense numbers. var wsString = GetWsForEntryType(sense, sense?.Cache); var writingSystem = sense?.Cache.ServiceLocator.WritingSystemManager.Get(wsString); - if (writingSystem != null && writingSystem.NumberingSystem.Digits.Length == 10) + var unicodeCharacters = HeadWordNumbersHelper.GetUnicodeCharacters(writingSystem?.NumberingSystem?.Digits); + if (unicodeCharacters != null) { for (var digit = 0; digit < 10; ++digit) { - nextNumber = nextNumber.Replace(digit.ToString(), writingSystem.NumberingSystem.Digits[digit].ToString()); + nextNumber = nextNumber.Replace(digit.ToString(), unicodeCharacters[digit]); } } break; diff --git a/Src/xWorks/DictionaryDetailsController.cs b/Src/xWorks/DictionaryDetailsController.cs index 151e812761..05bf2ba91b 100644 --- a/Src/xWorks/DictionaryDetailsController.cs +++ b/Src/xWorks/DictionaryDetailsController.cs @@ -873,7 +873,6 @@ private void HandleHeadwordNumbersButton() // ReSharper disable once AccessToDisposedClosure - can only be used before the dialog is disposed dlg.RunStylesDialog += (sender, e) => HandleStylesBtn((ComboBox) sender, ((ComboBox)sender).Text); dlg.SetupDialog(m_propertyTable.GetValue("HelpTopicProvider")); - dlg.SetStyleSheet = FontHeightAdjuster.StyleSheetFromPropertyTable(m_propertyTable); //dlg.StartPosition = FormStartPosition.CenterScreen; if (dlg.ShowDialog(View.TopLevelControl) != DialogResult.OK) return; diff --git a/Src/xWorks/HeadWordNumbersController.cs b/Src/xWorks/HeadWordNumbersController.cs index de4e66398d..b87edeb66d 100644 --- a/Src/xWorks/HeadWordNumbersController.cs +++ b/Src/xWorks/HeadWordNumbersController.cs @@ -33,7 +33,7 @@ public HeadwordNumbersController(IHeadwordNumbersView view, DictionaryConfigurat model.IsReversal ? xWorksStrings.ReversalIndex : xWorksStrings.Dictionary, Environment.NewLine, model.Label); - _view.SetWsFactoryForCustomDigits(cache.WritingSystemFactory); + //_view.SetWsFactoryForCustomDigits(cache.WritingSystemFactory); _view.AvailableWritingSystems = cache.LangProject.CurrentAnalysisWritingSystems.Union(cache.LangProject.CurrentVernacularWritingSystems); if (_cache.LangProject.AllWritingSystems.Any(ws => ws.Id == _homographConfig.HomographWritingSystem)) { @@ -49,12 +49,10 @@ public HeadwordNumbersController(IHeadwordNumbersView view, DictionaryConfigurat // otherwise use an empty list (which will be treated as default digits in the view). IEnumerable wsCustomDigits = new List(); var writingSystem = cache.ServiceLocator.WritingSystemManager.Get(_homographConfig.HomographWritingSystem); - if (writingSystem != null && writingSystem.NumberingSystem.Digits.Length == 10) + var unicodeCharacters = HeadWordNumbersHelper.GetUnicodeCharacters(writingSystem?.NumberingSystem?.Digits); + if (unicodeCharacters != null) { - for (var digit = 0; digit < 10; ++digit) - { - wsCustomDigits = wsCustomDigits.Append(writingSystem.NumberingSystem.Digits[digit].ToString()); - } + wsCustomDigits = unicodeCharacters; } _view.CustomDigits = wsCustomDigits; _view.HomographBefore = _homographConfig.HomographNumberBefore; diff --git a/Src/xWorks/HeadWordNumbersDlg.cs b/Src/xWorks/HeadWordNumbersDlg.cs index b4807a9b9a..d7dfb7e998 100644 --- a/Src/xWorks/HeadWordNumbersDlg.cs +++ b/Src/xWorks/HeadWordNumbersDlg.cs @@ -24,7 +24,7 @@ namespace SIL.FieldWorks.XWorks /// public partial class HeadwordNumbersDlg : Form, IHeadwordNumbersView { - private FwTextBox[] _digitBoxes; + private Label[] _digitBoxes; public HeadwordNumbersDlg() { @@ -42,7 +42,6 @@ public HeadwordNumbersDlg() m_digitZero, m_digitOne, m_digitTwo, m_digitThree, m_digitFour, m_digitFive, m_digitSix, m_digitSeven, m_digitEight, m_digitNine }; - Shown += (sender, args) => { UpdateWritingSystemCodeInDigits(); }; } /// @@ -197,22 +196,6 @@ public string HomographWritingSystem } } - /// - /// Set the writing system code in each digit textbox - /// - private void UpdateWritingSystemCodeInDigits() - { - var wsHandle = ((CoreWritingSystemDefinition)m_writingSystemCombo.SelectedItem).Handle; - foreach (var digit in _digitBoxes) - { - digit.WritingSystemCode = wsHandle; - digit.SelectAll(); - digit.ApplyWS(wsHandle); - digit.ApplyStyle("UiElement"); - digit.RemoveSelection(); - } - } - /// /// Set the font in each digit textbox /// @@ -245,6 +228,7 @@ public IEnumerable CustomDigits for (var i = 0; i < 10; ++i) { _digitBoxes[i].Text = digitsArray[i]; + _digitBoxes[i].Visible = true; } } @@ -253,41 +237,19 @@ public IEnumerable CustomDigits public bool OkButtonEnabled { get { return m_btnOk.Enabled; } set { m_btnOk.Enabled = value; } } - public LcmStyleSheet SetStyleSheet - { - set - { - for (var i = 0; i < 10; ++i) - { - _digitBoxes[i].StyleSheet = value; - } - } - } - - public void SetWsFactoryForCustomDigits(ILgWritingSystemFactory factory) - { - for (var i = 0; i < 10; ++i) - { - _digitBoxes[i].WritingSystemFactory = factory; - } - } - private void m_writingSystemCombo_SelectedIndexChanged(object sender, EventArgs e) { - UpdateWritingSystemCodeInDigits(); - // Populate digits from ws. var selectedWs = m_writingSystemCombo.SelectedItem as CoreWritingSystemDefinition; if (selectedWs?.NumberingSystem != null) { var digits = selectedWs.NumberingSystem.Digits; - UpdateFontInDigits(new System.Drawing.Font(string.IsNullOrWhiteSpace(selectedWs.DefaultFontName) ? "Segoe" : selectedWs.DefaultFontName, - selectedWs.DefaultFontSize == 0.0f ? 12 : selectedWs.DefaultFontSize)); ; if (!string.IsNullOrEmpty(digits)) { - // Populate the custom digits from writing system, if all 10 digits are specified - if (digits.Length == 10) - CustomDigits = digits.ToCharArray().Select(c => c.ToString()).ToArray(); + // Populate the custom digits from writing system, if all digits are specified. + var unicodeCharacters = HeadWordNumbersHelper.GetUnicodeCharacters(digits); + if (unicodeCharacters != null) + CustomDigits = unicodeCharacters; } } } diff --git a/Src/xWorks/HeadWordNumbersDlg.designer.cs b/Src/xWorks/HeadWordNumbersDlg.designer.cs index 8abce6f9bd..01cba0d214 100644 --- a/Src/xWorks/HeadWordNumbersDlg.designer.cs +++ b/Src/xWorks/HeadWordNumbersDlg.designer.cs @@ -52,16 +52,16 @@ private void InitializeComponent() this.buttonLayoutPanel = new System.Windows.Forms.FlowLayoutPanel(); this.customNumbersPanel = new System.Windows.Forms.Panel(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); - this.m_digitNine = new SIL.FieldWorks.Common.Widgets.FwTextBox(); - this.m_digitEight = new SIL.FieldWorks.Common.Widgets.FwTextBox(); - this.m_digitSeven = new SIL.FieldWorks.Common.Widgets.FwTextBox(); - this.m_digitSix = new SIL.FieldWorks.Common.Widgets.FwTextBox(); - this.m_digitFive = new SIL.FieldWorks.Common.Widgets.FwTextBox(); - this.m_digitFour = new SIL.FieldWorks.Common.Widgets.FwTextBox(); - this.m_digitThree = new SIL.FieldWorks.Common.Widgets.FwTextBox(); - this.m_digitTwo = new SIL.FieldWorks.Common.Widgets.FwTextBox(); - this.m_digitOne = new SIL.FieldWorks.Common.Widgets.FwTextBox(); - this.m_digitZero = new SIL.FieldWorks.Common.Widgets.FwTextBox(); + this.m_digitNine = new System.Windows.Forms.Label(); + this.m_digitEight = new System.Windows.Forms.Label(); + this.m_digitSeven = new System.Windows.Forms.Label(); + this.m_digitSix = new System.Windows.Forms.Label(); + this.m_digitFive = new System.Windows.Forms.Label(); + this.m_digitFour = new System.Windows.Forms.Label(); + this.m_digitThree = new System.Windows.Forms.Label(); + this.m_digitTwo = new System.Windows.Forms.Label(); + this.m_digitOne = new System.Windows.Forms.Label(); + this.m_digitZero = new System.Windows.Forms.Label(); this.label11 = new System.Windows.Forms.Label(); this.label10 = new System.Windows.Forms.Label(); this.label9 = new System.Windows.Forms.Label(); @@ -90,16 +90,6 @@ private void InitializeComponent() this.buttonLayoutPanel.SuspendLayout(); this.customNumbersPanel.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.m_digitNine)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.m_digitEight)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.m_digitSeven)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.m_digitSix)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.m_digitFive)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.m_digitFour)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.m_digitThree)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.m_digitTwo)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.m_digitOne)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.m_digitZero)).BeginInit(); this.homographStylePanel.SuspendLayout(); this.senseNumberStylePanel.SuspendLayout(); this.SuspendLayout(); @@ -263,133 +253,54 @@ private void InitializeComponent() // // m_digitNine // - this.m_digitNine.AcceptsReturn = false; - this.m_digitNine.AdjustStringHeight = true; resources.ApplyResources(this.m_digitNine, "m_digitNine"); - this.m_digitNine.BackColor = System.Drawing.SystemColors.Window; - this.m_digitNine.controlID = null; - this.m_digitNine.HasBorder = true; + this.m_digitNine.BackColor = System.Drawing.SystemColors.Control; this.m_digitNine.Name = "m_digitNine"; - this.m_digitNine.ReadOnlyView = true; - this.m_digitNine.SuppressEnter = false; - this.m_digitNine.WordWrap = false; // // m_digitEight // - this.m_digitEight.AcceptsReturn = false; - this.m_digitEight.AdjustStringHeight = true; resources.ApplyResources(this.m_digitEight, "m_digitEight"); - this.m_digitEight.BackColor = System.Drawing.SystemColors.Window; - this.m_digitEight.controlID = null; - this.m_digitEight.HasBorder = true; this.m_digitEight.Name = "m_digitEight"; - this.m_digitEight.ReadOnlyView = true; - this.m_digitEight.SuppressEnter = false; - this.m_digitEight.WordWrap = false; // // m_digitSeven // - this.m_digitSeven.AcceptsReturn = false; - this.m_digitSeven.AdjustStringHeight = true; resources.ApplyResources(this.m_digitSeven, "m_digitSeven"); - this.m_digitSeven.BackColor = System.Drawing.SystemColors.Window; - this.m_digitSeven.controlID = null; - this.m_digitSeven.HasBorder = true; this.m_digitSeven.Name = "m_digitSeven"; - this.m_digitSeven.ReadOnlyView = true; - this.m_digitSeven.SuppressEnter = false; - this.m_digitSeven.WordWrap = false; // // m_digitSix // - this.m_digitSix.AcceptsReturn = false; - this.m_digitSix.AdjustStringHeight = true; resources.ApplyResources(this.m_digitSix, "m_digitSix"); - this.m_digitSix.BackColor = System.Drawing.SystemColors.Window; - this.m_digitSix.controlID = null; - this.m_digitSix.HasBorder = true; this.m_digitSix.Name = "m_digitSix"; - this.m_digitSix.ReadOnlyView = true; - this.m_digitSix.SuppressEnter = false; - this.m_digitSix.WordWrap = false; // // m_digitFive // - this.m_digitFive.AcceptsReturn = false; - this.m_digitFive.AdjustStringHeight = true; resources.ApplyResources(this.m_digitFive, "m_digitFive"); - this.m_digitFive.BackColor = System.Drawing.SystemColors.Window; - this.m_digitFive.controlID = null; - this.m_digitFive.HasBorder = true; this.m_digitFive.Name = "m_digitFive"; - this.m_digitFive.ReadOnlyView = true; - this.m_digitFive.SuppressEnter = false; - this.m_digitFive.WordWrap = false; // // m_digitFour // - this.m_digitFour.AcceptsReturn = false; - this.m_digitFour.AdjustStringHeight = true; resources.ApplyResources(this.m_digitFour, "m_digitFour"); - this.m_digitFour.BackColor = System.Drawing.SystemColors.Window; - this.m_digitFour.controlID = null; - this.m_digitFour.HasBorder = true; this.m_digitFour.Name = "m_digitFour"; - this.m_digitFour.ReadOnlyView = true; - this.m_digitFour.SuppressEnter = false; - this.m_digitFour.WordWrap = false; // // m_digitThree // - this.m_digitThree.AcceptsReturn = false; - this.m_digitThree.AdjustStringHeight = true; resources.ApplyResources(this.m_digitThree, "m_digitThree"); - this.m_digitThree.BackColor = System.Drawing.SystemColors.Window; - this.m_digitThree.controlID = null; - this.m_digitThree.HasBorder = true; this.m_digitThree.Name = "m_digitThree"; - this.m_digitThree.ReadOnlyView = true; - this.m_digitThree.SuppressEnter = false; - this.m_digitThree.WordWrap = false; // // m_digitTwo // - this.m_digitTwo.AcceptsReturn = false; - this.m_digitTwo.AdjustStringHeight = true; resources.ApplyResources(this.m_digitTwo, "m_digitTwo"); - this.m_digitTwo.BackColor = System.Drawing.SystemColors.Window; - this.m_digitTwo.controlID = null; - this.m_digitTwo.HasBorder = true; this.m_digitTwo.Name = "m_digitTwo"; - this.m_digitTwo.ReadOnlyView = true; - this.m_digitTwo.SuppressEnter = false; - this.m_digitTwo.WordWrap = false; // // m_digitOne // - this.m_digitOne.AcceptsReturn = false; - this.m_digitOne.AdjustStringHeight = true; resources.ApplyResources(this.m_digitOne, "m_digitOne"); - this.m_digitOne.BackColor = System.Drawing.SystemColors.Window; - this.m_digitOne.controlID = null; - this.m_digitOne.HasBorder = true; this.m_digitOne.Name = "m_digitOne"; - this.m_digitOne.ReadOnlyView = true; - this.m_digitOne.SuppressEnter = false; - this.m_digitOne.WordWrap = false; // // m_digitZero // - this.m_digitZero.AcceptsReturn = false; - this.m_digitZero.AdjustStringHeight = true; resources.ApplyResources(this.m_digitZero, "m_digitZero"); - this.m_digitZero.BackColor = System.Drawing.SystemColors.Window; - this.m_digitZero.controlID = null; - this.m_digitZero.HasBorder = true; this.m_digitZero.Name = "m_digitZero"; - this.m_digitZero.ReadOnlyView = true; - this.m_digitZero.SuppressEnter = false; - this.m_digitZero.WordWrap = false; // // label11 // @@ -543,16 +454,6 @@ private void InitializeComponent() this.customNumbersPanel.PerformLayout(); this.tableLayoutPanel1.ResumeLayout(false); this.tableLayoutPanel1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.m_digitNine)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.m_digitEight)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.m_digitSeven)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.m_digitSix)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.m_digitFive)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.m_digitFour)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.m_digitThree)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.m_digitTwo)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.m_digitOne)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.m_digitZero)).EndInit(); this.homographStylePanel.ResumeLayout(false); this.homographStylePanel.PerformLayout(); this.senseNumberStylePanel.ResumeLayout(false); @@ -603,15 +504,15 @@ private void InitializeComponent() private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label1; - private Common.Widgets.FwTextBox m_digitNine; - private Common.Widgets.FwTextBox m_digitEight; - private Common.Widgets.FwTextBox m_digitSeven; - private Common.Widgets.FwTextBox m_digitSix; - private Common.Widgets.FwTextBox m_digitFive; - private Common.Widgets.FwTextBox m_digitFour; - private Common.Widgets.FwTextBox m_digitThree; - private Common.Widgets.FwTextBox m_digitTwo; - private Common.Widgets.FwTextBox m_digitOne; - private Common.Widgets.FwTextBox m_digitZero; + private System.Windows.Forms.Label m_digitNine; + private System.Windows.Forms.Label m_digitEight; + private System.Windows.Forms.Label m_digitSeven; + private System.Windows.Forms.Label m_digitSix; + private System.Windows.Forms.Label m_digitFive; + private System.Windows.Forms.Label m_digitFour; + private System.Windows.Forms.Label m_digitThree; + private System.Windows.Forms.Label m_digitTwo; + private System.Windows.Forms.Label m_digitOne; + private System.Windows.Forms.Label m_digitZero; } } diff --git a/Src/xWorks/HeadWordNumbersDlg.resx b/Src/xWorks/HeadWordNumbersDlg.resx index 3cd953da6a..24b05a9fc4 100644 --- a/Src/xWorks/HeadWordNumbersDlg.resx +++ b/Src/xWorks/HeadWordNumbersDlg.resx @@ -360,26 +360,6 @@ Top, Bottom, Left, Right - - Top, Left, Right - - - 4, 4 - - - 4, 4, 4, 4 - - - 451, 57 - - - 0 - - - Configure the homograph and sense numbers that appear on: -• entry headwords -• references to entries and senses - dialogDescription @@ -392,25 +372,6 @@ 0 - - 4, 69 - - - 4, 4, 4, 4 - - - True - - - 451, 38 - - - 1 - - - These settings affect the current TYPESTRING configuration: -Example-string DO NOT LOCALIZE THIS STRING - m_configurationDescription @@ -480,27 +441,6 @@ Example-string DO NOT LOCALIZE THIS STRING 1 - - True - - - NoControl - - - 204, 25 - - - 4, 4, 4, 4 - - - 61, 20 - - - 2 - - - None - m_radioNone @@ -580,7 +520,7 @@ Example-string DO NOT LOCALIZE THIS STRING Top, Bottom, Left, Right - Microsoft Sans Serif, 100pt + Segoe UI Symbol, 7.8pt 364, 39 @@ -594,11 +534,14 @@ Example-string DO NOT LOCALIZE THIS STRING 18 + + MiddleCenter + m_digitNine - SIL.FieldWorks.Common.Widgets.FwTextBox, Widgets, Version=9.3.8.0, Culture=neutral, PublicKeyToken=null + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 tableLayoutPanel1 @@ -609,8 +552,11 @@ Example-string DO NOT LOCALIZE THIS STRING Top, Bottom, Left, Right + + True + - Microsoft Sans Serif, 100pt + Segoe UI Symbol, 7.8pt 324, 39 @@ -624,11 +570,14 @@ Example-string DO NOT LOCALIZE THIS STRING 17 + + MiddleCenter + m_digitEight - SIL.FieldWorks.Common.Widgets.FwTextBox, Widgets, Version=9.3.8.0, Culture=neutral, PublicKeyToken=null + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 tableLayoutPanel1 @@ -639,8 +588,11 @@ Example-string DO NOT LOCALIZE THIS STRING Top, Bottom, Left, Right + + True + - Microsoft Sans Serif, 100pt + Segoe UI Symbol, 7.8pt 284, 39 @@ -654,11 +606,14 @@ Example-string DO NOT LOCALIZE THIS STRING 16 + + MiddleCenter + m_digitSeven - SIL.FieldWorks.Common.Widgets.FwTextBox, Widgets, Version=9.3.8.0, Culture=neutral, PublicKeyToken=null + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 tableLayoutPanel1 @@ -669,8 +624,11 @@ Example-string DO NOT LOCALIZE THIS STRING Top, Bottom, Left, Right + + True + - Microsoft Sans Serif, 100pt + Segoe UI Symbol, 7.8pt 244, 39 @@ -684,11 +642,14 @@ Example-string DO NOT LOCALIZE THIS STRING 15 + + MiddleCenter + m_digitSix - SIL.FieldWorks.Common.Widgets.FwTextBox, Widgets, Version=9.3.8.0, Culture=neutral, PublicKeyToken=null + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 tableLayoutPanel1 @@ -699,8 +660,11 @@ Example-string DO NOT LOCALIZE THIS STRING Top, Bottom, Left, Right + + True + - Microsoft Sans Serif, 100pt + Segoe UI Symbol, 7.8pt 204, 39 @@ -714,11 +678,14 @@ Example-string DO NOT LOCALIZE THIS STRING 14 + + MiddleCenter + m_digitFive - SIL.FieldWorks.Common.Widgets.FwTextBox, Widgets, Version=9.3.8.0, Culture=neutral, PublicKeyToken=null + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 tableLayoutPanel1 @@ -729,8 +696,11 @@ Example-string DO NOT LOCALIZE THIS STRING Top, Bottom, Left, Right + + True + - Microsoft Sans Serif, 100pt + Segoe UI Symbol, 7.8pt 164, 39 @@ -744,11 +714,14 @@ Example-string DO NOT LOCALIZE THIS STRING 13 + + MiddleCenter + m_digitFour - SIL.FieldWorks.Common.Widgets.FwTextBox, Widgets, Version=9.3.8.0, Culture=neutral, PublicKeyToken=null + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 tableLayoutPanel1 @@ -759,8 +732,11 @@ Example-string DO NOT LOCALIZE THIS STRING Top, Bottom, Left, Right + + True + - Microsoft Sans Serif, 100pt + Segoe UI Symbol, 7.8pt 124, 39 @@ -774,11 +750,14 @@ Example-string DO NOT LOCALIZE THIS STRING 12 + + MiddleCenter + m_digitThree - SIL.FieldWorks.Common.Widgets.FwTextBox, Widgets, Version=9.3.8.0, Culture=neutral, PublicKeyToken=null + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 tableLayoutPanel1 @@ -789,8 +768,11 @@ Example-string DO NOT LOCALIZE THIS STRING Top, Bottom, Left, Right + + True + - Microsoft Sans Serif, 100pt + Segoe UI Symbol, 7.8pt 84, 39 @@ -804,11 +786,14 @@ Example-string DO NOT LOCALIZE THIS STRING 11 + + MiddleCenter + m_digitTwo - SIL.FieldWorks.Common.Widgets.FwTextBox, Widgets, Version=9.3.8.0, Culture=neutral, PublicKeyToken=null + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 tableLayoutPanel1 @@ -819,8 +804,11 @@ Example-string DO NOT LOCALIZE THIS STRING Top, Bottom, Left, Right + + True + - Microsoft Sans Serif, 100pt + Segoe UI Symbol, 7.8pt 44, 39 @@ -834,11 +822,14 @@ Example-string DO NOT LOCALIZE THIS STRING 10 + + MiddleCenter + m_digitOne - SIL.FieldWorks.Common.Widgets.FwTextBox, Widgets, Version=9.3.8.0, Culture=neutral, PublicKeyToken=null + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 tableLayoutPanel1 @@ -849,8 +840,11 @@ Example-string DO NOT LOCALIZE THIS STRING Top, Bottom, Left, Right + + True + - Microsoft Sans Serif, 100pt + Segoe UI Symbol, 7.8pt 4, 39 @@ -864,11 +858,14 @@ Example-string DO NOT LOCALIZE THIS STRING 4 + + MiddleCenter + m_digitZero - SIL.FieldWorks.Common.Widgets.FwTextBox, Widgets, Version=9.3.8.0, Culture=neutral, PublicKeyToken=null + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 tableLayoutPanel1 @@ -1401,6 +1398,258 @@ Example-string DO NOT LOCALIZE THIS STRING 4 + + _homographStyleButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + homographStylePanel + + + 0 + + + styleLabel + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + homographStylePanel + + + 1 + + + _homographStyleCombo + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + homographStylePanel + + + 2 + + + 8, 193 + + + 4, 4, 4, 4 + + + 455, 70 + + + 21 + + + homographStylePanel + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + mainLayoutTable + + + 5 + + + _senseNumberStyleBtn + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + senseNumberStylePanel + + + 0 + + + _senseStyleLabel + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + senseNumberStylePanel + + + 1 + + + _senseStyleCombo + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + senseNumberStylePanel + + + 2 + + + 8, 271 + + + 4, 4, 4, 4 + + + 455, 66 + + + 23 + + + senseNumberStylePanel + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + mainLayoutTable + + + 6 + + + Fill + + + 0, 0 + + + 7, 6, 7, 6 + + + 4, 0, 0, 0 + + + 7 + + + 492, 666 + + + 16 + + + mainLayoutTable + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="descriptionPanel" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="referenceNumberGroup" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="groupBox1" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="buttonLayoutPanel" Row="6" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="customNumbersPanel" Row="5" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="homographStylePanel" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="senseNumberStylePanel" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,100" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0" /></TableLayoutSettings> + + + Top, Left, Right + + + 4, 4 + + + 4, 4, 4, 4 + + + 451, 57 + + + 0 + + + Configure the homograph and sense numbers that appear on: +• entry headwords +• references to entries and senses + + + dialogDescription + + + System.Windows.Forms.RichTextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + descriptionPanel + + + 0 + + + 4, 69 + + + 4, 4, 4, 4 + + + True + + + 451, 38 + + + 1 + + + These settings affect the current TYPESTRING configuration: +Example-string DO NOT LOCALIZE THIS STRING + + + m_configurationDescription + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + descriptionPanel + + + 1 + + + True + + + NoControl + + + 204, 25 + + + 4, 4, 4, 4 + + + 61, 20 + + + 2 + + + None + + + m_radioNone + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 0 + 260, 36 @@ -1482,30 +1731,6 @@ Example-string DO NOT LOCALIZE THIS STRING 2 - - 8, 193 - - - 4, 4, 4, 4 - - - 455, 70 - - - 21 - - - homographStylePanel - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - mainLayoutTable - - - 5 - NoControl @@ -1590,66 +1815,6 @@ Example-string DO NOT LOCALIZE THIS STRING 2 - - 8, 271 - - - 4, 4, 4, 4 - - - 455, 66 - - - 23 - - - senseNumberStylePanel - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - mainLayoutTable - - - 6 - - - Fill - - - 0, 0 - - - 7, 6, 7, 6 - - - 4, 0, 0, 0 - - - 7 - - - 492, 666 - - - 16 - - - mainLayoutTable - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 0 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="descriptionPanel" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="referenceNumberGroup" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="groupBox1" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="buttonLayoutPanel" Row="6" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="customNumbersPanel" Row="5" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="homographStylePanel" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="senseNumberStylePanel" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,100" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0" /></TableLayoutSettings> - True diff --git a/Src/xWorks/HeadWordNumbersHelper.cs b/Src/xWorks/HeadWordNumbersHelper.cs new file mode 100644 index 0000000000..98ef887fe7 --- /dev/null +++ b/Src/xWorks/HeadWordNumbersHelper.cs @@ -0,0 +1,34 @@ +using System.Collections.Generic; + +namespace SIL.FieldWorks.XWorks +{ + public static class HeadWordNumbersHelper + { + public static List GetUnicodeCharacters(string digits) + { + if (!string.IsNullOrEmpty(digits)) + { + // Note that some digits use surrogate pairs in UTF-16, so it's not as simple as splitting into a char array. + // We need to check for surrogate pairs to split everything correctly into Unicode characters. + var characters = new List(); + for (int i = 0; i < digits.Length; i++) + { + // The first part of a surrogate pair is the high surrogate and the second part is the low surrogate. + if (char.IsHighSurrogate(digits[i]) && i + 1 < digits.Length && + char.IsLowSurrogate(digits[i + 1])) + { + characters.Add(digits.Substring(i, 2)); + i++; // Skip the next char since it's part of the surrogate pair we just added. + } + else + { + characters.Add(digits[i].ToString()); + } + } + if (characters.Count == 10) + return characters; + } + return null; + } + } +} diff --git a/Src/xWorks/IHeadwordNumbersView.cs b/Src/xWorks/IHeadwordNumbersView.cs index e0813e597f..487c96076e 100644 --- a/Src/xWorks/IHeadwordNumbersView.cs +++ b/Src/xWorks/IHeadwordNumbersView.cs @@ -25,6 +25,5 @@ public interface IHeadwordNumbersView string HomographWritingSystem { get; set; } IEnumerable AvailableWritingSystems { set; } IEnumerable CustomDigits { get; set; } - void SetWsFactoryForCustomDigits(ILgWritingSystemFactory factory); } } \ No newline at end of file From 6d84dc9d924b9e043028389ec2979bd455379451 Mon Sep 17 00:00:00 2001 From: Ariel Rorabaugh Date: Tue, 28 Apr 2026 13:15:01 -0400 Subject: [PATCH 6/7] Update expected headword numbers behavior in tests Also, handle KeyNotFound exceptions in getting CoreWritingSystemDefinition for sense numbers in ConfiguredLcmGenerator and HeadWordNumbersController. Change-Id: I6067175b41657f9cf514b7a2a264b6cb11173376 --- Src/xWorks/ConfiguredLcmGenerator.cs | 27 +- Src/xWorks/HeadWordNumbersController.cs | 12 +- Src/xWorks/HeadWordNumbersDlg.cs | 2 + Src/xWorks/HeadWordNumbersDlg.resx | 416 +++++++----------- .../DictionaryConfigurationModelTests.cs | 2 - .../HeadwordNumbersControllerTests.cs | 81 ++-- 6 files changed, 219 insertions(+), 321 deletions(-) diff --git a/Src/xWorks/ConfiguredLcmGenerator.cs b/Src/xWorks/ConfiguredLcmGenerator.cs index 6f548701a8..f668efebbd 100644 --- a/Src/xWorks/ConfiguredLcmGenerator.cs +++ b/Src/xWorks/ConfiguredLcmGenerator.cs @@ -2476,15 +2476,28 @@ private static string GetSenseNumber(string numberingStyle, ILexSense sense, break; default: // handles %d and %O. We no longer support "%z" (1 b iii) because users can hand-configure its equivalent nextNumber = senseCount.ToString(); - // Use writing system's numbering system for sense numbers. - var wsString = GetWsForEntryType(sense, sense?.Cache); - var writingSystem = sense?.Cache.ServiceLocator.WritingSystemManager.Get(wsString); - var unicodeCharacters = HeadWordNumbersHelper.GetUnicodeCharacters(writingSystem?.NumberingSystem?.Digits); - if (unicodeCharacters != null) + // For the sense numbers, use the numbering system associated with the sense number writing system, if there is one. + var senseNumberWs = info.HomographConfig.WritingSystem; + if (senseNumberWs != null) { - for (var digit = 0; digit < 10; ++digit) + CoreWritingSystemDefinition writingSystem = null; + try { - nextNumber = nextNumber.Replace(digit.ToString(), unicodeCharacters[digit]); + writingSystem = sense?.Cache.ServiceLocator.WritingSystemManager.Get(senseNumberWs); + } + catch (KeyNotFoundException) + { + //Don't replace sense number digits. + break; + } + var unicodeCharacters = HeadWordNumbersHelper.GetUnicodeCharacters(writingSystem?.NumberingSystem?.Digits); + if (unicodeCharacters != null) + { + for (var digit = 0; digit < 10; ++digit) + { + nextNumber = nextNumber.Replace(digit.ToString(), + unicodeCharacters[digit]); + } } } break; diff --git a/Src/xWorks/HeadWordNumbersController.cs b/Src/xWorks/HeadWordNumbersController.cs index b87edeb66d..ca6b55b831 100644 --- a/Src/xWorks/HeadWordNumbersController.cs +++ b/Src/xWorks/HeadWordNumbersController.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Linq; using SIL.LCModel; +using SIL.LCModel.Core.WritingSystems; using SIL.LCModel.DomainImpl; namespace SIL.FieldWorks.XWorks @@ -48,7 +49,16 @@ public HeadwordNumbersController(IHeadwordNumbersView view, DictionaryConfigurat // If possible, get digits from the writing system's numbering system, // otherwise use an empty list (which will be treated as default digits in the view). IEnumerable wsCustomDigits = new List(); - var writingSystem = cache.ServiceLocator.WritingSystemManager.Get(_homographConfig.HomographWritingSystem); + CoreWritingSystemDefinition writingSystem = null; + try + { + writingSystem = cache.ServiceLocator.WritingSystemManager?.Get(_homographConfig.HomographWritingSystem); + } + catch(KeyNotFoundException) + { + // Do nothing; writingSystem is already null. + } + //var writingSystem = cache.ServiceLocator.WritingSystemManager?.Get(_homographConfig.HomographWritingSystem); var unicodeCharacters = HeadWordNumbersHelper.GetUnicodeCharacters(writingSystem?.NumberingSystem?.Digits); if (unicodeCharacters != null) { diff --git a/Src/xWorks/HeadWordNumbersDlg.cs b/Src/xWorks/HeadWordNumbersDlg.cs index d7dfb7e998..b95bdc90fc 100644 --- a/Src/xWorks/HeadWordNumbersDlg.cs +++ b/Src/xWorks/HeadWordNumbersDlg.cs @@ -229,6 +229,8 @@ public IEnumerable CustomDigits { _digitBoxes[i].Text = digitsArray[i]; _digitBoxes[i].Visible = true; + // Set UseCompatibleTextRendering to false. This causes WindowsForms to use TextRenderer, which provides better fallback font performance. + _digitBoxes[i].UseCompatibleTextRendering = false; } } diff --git a/Src/xWorks/HeadWordNumbersDlg.resx b/Src/xWorks/HeadWordNumbersDlg.resx index 24b05a9fc4..cd6c3818e9 100644 --- a/Src/xWorks/HeadWordNumbersDlg.resx +++ b/Src/xWorks/HeadWordNumbersDlg.resx @@ -360,6 +360,26 @@ Top, Bottom, Left, Right + + Top, Left, Right + + + 4, 4 + + + 4, 4, 4, 4 + + + 451, 57 + + + 0 + + + Configure the homograph and sense numbers that appear on: +• entry headwords +• references to entries and senses + dialogDescription @@ -372,6 +392,25 @@ 0 + + 4, 69 + + + 4, 4, 4, 4 + + + True + + + 451, 38 + + + 1 + + + These settings affect the current TYPESTRING configuration: +Example-string DO NOT LOCALIZE THIS STRING + m_configurationDescription @@ -441,6 +480,27 @@ 1 + + True + + + NoControl + + + 204, 25 + + + 4, 4, 4, 4 + + + 61, 20 + + + 2 + + + None + m_radioNone @@ -520,7 +580,7 @@ Top, Bottom, Left, Right - Segoe UI Symbol, 7.8pt + Segoe UI, 7.8pt 364, 39 @@ -556,7 +616,7 @@ True - Segoe UI Symbol, 7.8pt + Segoe UI, 7.8pt 324, 39 @@ -592,7 +652,7 @@ True - Segoe UI Symbol, 7.8pt + Segoe UI, 7.8pt 284, 39 @@ -628,7 +688,7 @@ True - Segoe UI Symbol, 7.8pt + Segoe UI, 7.8pt 244, 39 @@ -664,7 +724,7 @@ True - Segoe UI Symbol, 7.8pt + Segoe UI, 7.8pt 204, 39 @@ -700,7 +760,7 @@ True - Segoe UI Symbol, 7.8pt + Segoe UI, 7.8pt 164, 39 @@ -736,7 +796,7 @@ True - Segoe UI Symbol, 7.8pt + Segoe UI, 7.8pt 124, 39 @@ -772,7 +832,7 @@ True - Segoe UI Symbol, 7.8pt + Segoe UI, 7.8pt 84, 39 @@ -808,7 +868,7 @@ True - Segoe UI Symbol, 7.8pt + Segoe UI, 7.8pt 44, 39 @@ -844,7 +904,7 @@ True - Segoe UI Symbol, 7.8pt + Segoe UI, 7.8pt 4, 39 @@ -1398,258 +1458,6 @@ 4 - - _homographStyleButton - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - homographStylePanel - - - 0 - - - styleLabel - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - homographStylePanel - - - 1 - - - _homographStyleCombo - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - homographStylePanel - - - 2 - - - 8, 193 - - - 4, 4, 4, 4 - - - 455, 70 - - - 21 - - - homographStylePanel - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - mainLayoutTable - - - 5 - - - _senseNumberStyleBtn - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - senseNumberStylePanel - - - 0 - - - _senseStyleLabel - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - senseNumberStylePanel - - - 1 - - - _senseStyleCombo - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - senseNumberStylePanel - - - 2 - - - 8, 271 - - - 4, 4, 4, 4 - - - 455, 66 - - - 23 - - - senseNumberStylePanel - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - mainLayoutTable - - - 6 - - - Fill - - - 0, 0 - - - 7, 6, 7, 6 - - - 4, 0, 0, 0 - - - 7 - - - 492, 666 - - - 16 - - - mainLayoutTable - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 0 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="descriptionPanel" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="referenceNumberGroup" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="groupBox1" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="buttonLayoutPanel" Row="6" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="customNumbersPanel" Row="5" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="homographStylePanel" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="senseNumberStylePanel" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,100" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0" /></TableLayoutSettings> - - - Top, Left, Right - - - 4, 4 - - - 4, 4, 4, 4 - - - 451, 57 - - - 0 - - - Configure the homograph and sense numbers that appear on: -• entry headwords -• references to entries and senses - - - dialogDescription - - - System.Windows.Forms.RichTextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - descriptionPanel - - - 0 - - - 4, 69 - - - 4, 4, 4, 4 - - - True - - - 451, 38 - - - 1 - - - These settings affect the current TYPESTRING configuration: -Example-string DO NOT LOCALIZE THIS STRING - - - m_configurationDescription - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - descriptionPanel - - - 1 - - - True - - - NoControl - - - 204, 25 - - - 4, 4, 4, 4 - - - 61, 20 - - - 2 - - - None - - - m_radioNone - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 0 - 260, 36 @@ -1731,6 +1539,30 @@ Example-string DO NOT LOCALIZE THIS STRING 2 + + 8, 193 + + + 4, 4, 4, 4 + + + 455, 70 + + + 21 + + + homographStylePanel + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + mainLayoutTable + + + 5 + NoControl @@ -1815,6 +1647,66 @@ Example-string DO NOT LOCALIZE THIS STRING 2 + + 8, 271 + + + 4, 4, 4, 4 + + + 455, 66 + + + 23 + + + senseNumberStylePanel + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + mainLayoutTable + + + 6 + + + Fill + + + 0, 0 + + + 7, 6, 7, 6 + + + 4, 0, 0, 0 + + + 7 + + + 492, 666 + + + 16 + + + mainLayoutTable + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="descriptionPanel" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="referenceNumberGroup" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="groupBox1" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="buttonLayoutPanel" Row="6" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="customNumbersPanel" Row="5" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="homographStylePanel" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="senseNumberStylePanel" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,100" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0" /></TableLayoutSettings> + True diff --git a/Src/xWorks/xWorksTests/DictionaryConfigurationModelTests.cs b/Src/xWorks/xWorksTests/DictionaryConfigurationModelTests.cs index 98691d9b36..62ae86eef8 100644 --- a/Src/xWorks/xWorksTests/DictionaryConfigurationModelTests.cs +++ b/Src/xWorks/xWorksTests/DictionaryConfigurationModelTests.cs @@ -501,7 +501,6 @@ public void Save_HomographConfigurationValidatesAgainstSchema() Label = "root", HomographConfiguration = new DictionaryHomographConfiguration { - CustomHomographNumbers = "0;1;2;3;4;5;6;7;8;9", HomographNumberBefore = true, HomographWritingSystem = "en", ShowHwNumber = true, @@ -1234,7 +1233,6 @@ public void CanDeepClone() // If we were on NUnit 4 // Assert.That(model.HomographConfiguration, Is.EqualTo(clone.HomographConfiguration).UsingPropertiesComparer()); // But we're not, so we have to do it manually or implement otherwise unnecessary equality interfaces - Assert.That(model.HomographConfiguration.CustomHomographNumbers, Is.EqualTo(clone.HomographConfiguration.CustomHomographNumbers)); Assert.That(model.HomographConfiguration.HomographNumberBefore, Is.EqualTo(clone.HomographConfiguration.HomographNumberBefore)); Assert.That(model.HomographConfiguration.HomographWritingSystem, Is.EqualTo(clone.HomographConfiguration.HomographWritingSystem)); Assert.That(model.HomographConfiguration.ShowHwNumber, Is.EqualTo(clone.HomographConfiguration.ShowHwNumber)); diff --git a/Src/xWorks/xWorksTests/HeadwordNumbersControllerTests.cs b/Src/xWorks/xWorksTests/HeadwordNumbersControllerTests.cs index 68b78005de..88c7d29a2f 100644 --- a/Src/xWorks/xWorksTests/HeadwordNumbersControllerTests.cs +++ b/Src/xWorks/xWorksTests/HeadwordNumbersControllerTests.cs @@ -9,6 +9,9 @@ using SIL.LCModel.Core.WritingSystems; using SIL.LCModel.Core.KernelInterfaces; using SIL.LCModel.DomainImpl; +using DocumentFormat.OpenXml.EMMA; +using Paratext.Data.Linguistics.Morph; +using SIL.WritingSystems; namespace SIL.FieldWorks.XWorks { @@ -138,49 +141,34 @@ public void Save_SetsModelContents_Reversal() public void Ok_Enabled_WithNoCustomNumbers() { // Test enabled on initial setup - var view = new TestHeadwordNumbersView {OkButtonEnabled = false}; + var view = new TestHeadwordNumbersView { OkButtonEnabled = false }; var model = new DictionaryConfigurationModel(); var controller = new HeadwordNumbersController(view, model, Cache); // verify ok button enabled on setup with no numbers - Assert.That(view.OkButtonEnabled, Is.True, "Ok not enabled by controller constructor"); - view.OkButtonEnabled = false; - // verify ok button enabled when event is triggered and there are no custom numbers - view.TriggerCustomDigitsChanged(); - Assert.That(view.OkButtonEnabled, Is.True, "Ok button not enabled when event is fired"); + Assert.That(view.OkButtonEnabled, Is.True, + "Ok not enabled by controller constructor"); } [Test] - public void Ok_Enabled_WithAllTenNumbers() + public void CustomDigits_Default_Ok_Enabled_WhenNotAllTenNumbersSet() { - // Test enabled on initial setup - var view = new TestHeadwordNumbersView { OkButtonEnabled = false }; - var model = new DictionaryConfigurationModel + var model = new DictionaryConfigurationModel() { - HomographConfiguration = new DictionaryHomographConfiguration - { - CustomHomographNumbers = "a,b,c,d,e,f,g,h,i,j" - } + HomographConfiguration = new DictionaryHomographConfiguration() }; - var controller = new HeadwordNumbersController(view, model, Cache); - // verify ok button enabled on setup with 10 numbers - Assert.That(view.OkButtonEnabled, Is.True, "Ok not enabled by controller constructor"); - view.OkButtonEnabled = false; - // verify ok button enabled when event is triggered and there are 10 custom numbers - view.TriggerCustomDigitsChanged(); - Assert.That(view.OkButtonEnabled, Is.True, "Ok button not enabled when event is fired"); - } + var view = new TestHeadwordNumbersView() + { + HomographWritingSystem = model.HomographConfiguration.HomographWritingSystem = "en" + }; + var writingSystem = Cache.ServiceLocator.WritingSystemManager.Get(view.HomographWritingSystem); + writingSystem.NumberingSystem = NumberingSystemDefinition.CreateCustomSystem("1"); - [Test] - public void Ok_Disabled_WhenNotAllTenNumbersSet() - { - // Test enabled on initial setup - var view = new TestHeadwordNumbersView(); - var model = new DictionaryConfigurationModel(); - var controller = new HeadwordNumbersController(view, model, Cache); - view.OkButtonEnabled = true; - view.CustomDigits = new List { "1" }; - view.TriggerCustomDigitsChanged(); - Assert.That(view.OkButtonEnabled, Is.False, "Ok button still enabled after event is fired"); + // If the writing system doesn't have a valid numbering system with 10 digits, + // the view should fall back to the default latin digits and still enable Ok. + var defaultNumberingSystem = NumberingSystemDefinition.CreateCustomSystem("0123456789"); + var testController = new HeadwordNumbersController(view, model, Cache); + Assert.That(view.CustomDigits, Is.EqualTo(HeadWordNumbersHelper.GetUnicodeCharacters(defaultNumberingSystem.Digits))); + Assert.That(view.OkButtonEnabled, Is.True, "Ok button not enabled after event is fired"); } [Test] @@ -235,20 +223,21 @@ public void ConstructorSetsDefaultWritingSystemInView() } [Test] - public void ConstructorSetsCustomHeadwordNumbersInView() + public void ConstructorSetsHeadwordWritingSystemNumbersInView() { - var view = new TestHeadwordNumbersView(); - var model = new DictionaryConfigurationModel + var model = new DictionaryConfigurationModel() { - HomographConfiguration = new DictionaryHomographConfiguration - { - CustomHomographNumbers = "a;b;c;d;e;f;g;h;i;j;k" - } + HomographConfiguration = new DictionaryHomographConfiguration() }; - // ReSharper disable once UnusedVariable - // SUT + var view = new TestHeadwordNumbersView() + { + HomographWritingSystem = model.HomographConfiguration.HomographWritingSystem = "en" + }; + var writingSystem = Cache.ServiceLocator.WritingSystemManager.Get(view.HomographWritingSystem); + writingSystem.NumberingSystem = NumberingSystemDefinition.CreateCustomSystem("abcdefghij"); + var testController = new HeadwordNumbersController(view, model, Cache); - Assert.That(view.CustomDigits, Is.EqualTo(model.HomographConfiguration.CustomHomographNumberList)); + Assert.That(view.CustomDigits, Is.EqualTo(HeadWordNumbersHelper.GetUnicodeCharacters(writingSystem.NumberingSystem.Digits))); } public class TestHeadwordNumbersView : IHeadwordNumbersView @@ -267,13 +256,7 @@ public class TestHeadwordNumbersView : IHeadwordNumbersView #pragma warning restore 67 public IEnumerable AvailableWritingSystems { private get; set; } public IEnumerable CustomDigits { get; set; } - public event EventHandler CustomDigitsChanged; public bool OkButtonEnabled { get; set; } - - internal void TriggerCustomDigitsChanged() - { - CustomDigitsChanged(this, null); - } public void SetWsFactoryForCustomDigits(ILgWritingSystemFactory factory) { } } } From f1f2c3e94568a3514990037dea11c2103926406d Mon Sep 17 00:00:00 2001 From: Ariel Rorabaugh Date: Tue, 28 Apr 2026 13:44:40 -0400 Subject: [PATCH 7/7] Cleanup commented & unused code Change-Id: Iacf90f64213f4f2da1c751952256cd518ac70202 --- Src/Common/Controls/Widgets/FwTextBox.cs | 19 ------------------ Src/xWorks/DictionaryConfigurationModel.cs | 20 ------------------- Src/xWorks/HeadWordNumbersController.cs | 2 -- Src/xWorks/HeadWordNumbersDlg.cs | 11 ---------- .../HeadwordNumbersControllerTests.cs | 2 -- 5 files changed, 54 deletions(-) diff --git a/Src/Common/Controls/Widgets/FwTextBox.cs b/Src/Common/Controls/Widgets/FwTextBox.cs index f6b5a24dc7..24cbed7c99 100644 --- a/Src/Common/Controls/Widgets/FwTextBox.cs +++ b/Src/Common/Controls/Widgets/FwTextBox.cs @@ -965,25 +965,6 @@ public override Color ForeColor } } - /// - /// Gets or sets a value indicating whether the text box is read-only. - /// - /// true if the text box is read-only; otherwise, false. - [Browsable(true), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public bool ReadOnlyView - { - get - { - CheckDisposed(); - return m_innerFwTextBox.ReadOnlyView; - } - set - { - CheckDisposed(); - m_innerFwTextBox.ReadOnlyView = value; - } - } - /// ------------------------------------------------------------------------------------ /// /// Allows the control to function like an ordinary text box, setting and reading its text. diff --git a/Src/xWorks/DictionaryConfigurationModel.cs b/Src/xWorks/DictionaryConfigurationModel.cs index 0a7bb821a8..4155c604d2 100644 --- a/Src/xWorks/DictionaryConfigurationModel.cs +++ b/Src/xWorks/DictionaryConfigurationModel.cs @@ -201,7 +201,6 @@ public void Load(LcmCache cache) else { HomographConfiguration.HomographWritingSystem = string.Empty; - //HomographConfiguration.CustomHomographNumbers = string.Empty; } } @@ -370,7 +369,6 @@ public DictionaryHomographConfiguration(DictionaryHomographConfiguration other) ShowSenseNumberReversal = other.ShowSenseNumberReversal; HomographNumberBefore = other.HomographNumberBefore; HomographWritingSystem = other.HomographWritingSystem; - //CustomHomographNumberList = other.CustomHomographNumberList != null ? new List(other.CustomHomographNumberList) : null; } public DictionaryHomographConfiguration(HomographConfiguration config) @@ -382,7 +380,6 @@ public DictionaryHomographConfiguration(HomographConfiguration config) ShowHwNumInCrossRef = config.ShowHomographNumber(HomographConfiguration.HeadwordVariant.DictionaryCrossRef); ShowHwNumInReversalCrossRef = config.ShowHomographNumber(HomographConfiguration.HeadwordVariant.ReversalCrossRef); HomographWritingSystem = config.WritingSystem; - //CustomHomographNumberList = config.CustomHomographNumbers; } /// @@ -397,12 +394,8 @@ public void ExportToHomographConfiguration(HomographConfiguration config) config.SetShowHomographNumber(HomographConfiguration.HeadwordVariant.DictionaryCrossRef, ShowHwNumInCrossRef); config.SetShowHomographNumber(HomographConfiguration.HeadwordVariant.ReversalCrossRef, ShowHwNumInReversalCrossRef); config.WritingSystem = HomographWritingSystem; - //config.CustomHomographNumbers = CustomHomographNumberList; } - //[XmlIgnore] - //public List CustomHomographNumberList { get; internal set; } - [XmlAttribute("showHwNumInReversalCrossRef")] public bool ShowHwNumInReversalCrossRef { get; set; } @@ -421,19 +414,6 @@ public void ExportToHomographConfiguration(HomographConfiguration config) [XmlAttribute("homographNumberBefore")] public bool HomographNumberBefore { get; set; } - //[XmlAttribute("customHomographNumbers")] - /*public string CustomHomographNumbers - { - get - { - return CustomHomographNumberList == null ? string.Empty : WebUtility.HtmlEncode(string.Join(",", CustomHomographNumberList)); - } - set - { - CustomHomographNumberList = new List(WebUtility.HtmlDecode(value).Split(new []{','}, StringSplitOptions.RemoveEmptyEntries)); - } - }*/ - [XmlAttribute("homographWritingSystem")] public string HomographWritingSystem { get; set; } } diff --git a/Src/xWorks/HeadWordNumbersController.cs b/Src/xWorks/HeadWordNumbersController.cs index ca6b55b831..5f074ffe1f 100644 --- a/Src/xWorks/HeadWordNumbersController.cs +++ b/Src/xWorks/HeadWordNumbersController.cs @@ -34,7 +34,6 @@ public HeadwordNumbersController(IHeadwordNumbersView view, DictionaryConfigurat model.IsReversal ? xWorksStrings.ReversalIndex : xWorksStrings.Dictionary, Environment.NewLine, model.Label); - //_view.SetWsFactoryForCustomDigits(cache.WritingSystemFactory); _view.AvailableWritingSystems = cache.LangProject.CurrentAnalysisWritingSystems.Union(cache.LangProject.CurrentVernacularWritingSystems); if (_cache.LangProject.AllWritingSystems.Any(ws => ws.Id == _homographConfig.HomographWritingSystem)) { @@ -58,7 +57,6 @@ public HeadwordNumbersController(IHeadwordNumbersView view, DictionaryConfigurat { // Do nothing; writingSystem is already null. } - //var writingSystem = cache.ServiceLocator.WritingSystemManager?.Get(_homographConfig.HomographWritingSystem); var unicodeCharacters = HeadWordNumbersHelper.GetUnicodeCharacters(writingSystem?.NumberingSystem?.Digits); if (unicodeCharacters != null) { diff --git a/Src/xWorks/HeadWordNumbersDlg.cs b/Src/xWorks/HeadWordNumbersDlg.cs index b95bdc90fc..78b5b6376d 100644 --- a/Src/xWorks/HeadWordNumbersDlg.cs +++ b/Src/xWorks/HeadWordNumbersDlg.cs @@ -196,17 +196,6 @@ public string HomographWritingSystem } } - /// - /// Set the font in each digit textbox - /// - private void UpdateFontInDigits(System.Drawing.Font digitFont) - { - foreach (var digit in _digitBoxes) - { - digit.Font = digitFont; - } - } - public IEnumerable AvailableWritingSystems { set diff --git a/Src/xWorks/xWorksTests/HeadwordNumbersControllerTests.cs b/Src/xWorks/xWorksTests/HeadwordNumbersControllerTests.cs index 88c7d29a2f..8eee92e86b 100644 --- a/Src/xWorks/xWorksTests/HeadwordNumbersControllerTests.cs +++ b/Src/xWorks/xWorksTests/HeadwordNumbersControllerTests.cs @@ -9,8 +9,6 @@ using SIL.LCModel.Core.WritingSystems; using SIL.LCModel.Core.KernelInterfaces; using SIL.LCModel.DomainImpl; -using DocumentFormat.OpenXml.EMMA; -using Paratext.Data.Linguistics.Morph; using SIL.WritingSystems; namespace SIL.FieldWorks.XWorks