Skip to content

Commit d98fec6

Browse files
authored
Add help documentation to LT-22165 (#466)
1 parent 46fa33a commit d98fec6

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

Src/LexText/LexTextDll/HelpTopicPaths.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,9 @@
275275
<data name="khtpTryAWord" xml:space="preserve">
276276
<value>User_Interface/Menus/Parser/Try_a_word.htm</value>
277277
</data>
278+
<data name="khtpHCMaxCompoundRules" xml:space="preserve">
279+
<value>User_Interface/Menus/Parser/MaxApps_dialog_box.htm</value>
280+
</data>
278281
<data name="khtpField-LexEntry-CitationForm" xml:space="preserve">
279282
<value>User_Interface/Field_Descriptions/Lexicon/Lexicon_Edit_fields/Entry_level_fields/Citation_Form_field.htm</value>
280283
</data>

Src/LexText/ParserUI/HCMaxCompoundRulesDlg.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) 2025 SIL International
22
// This software is licensed under the LGPL, version 2.1 or later
33
// (http://www.gnu.org/licenses/lgpl-2.1.html)
4+
using SIL.FieldWorks.Common.FwUtils;
45
using SIL.LCModel;
56
using System;
67
using System.Data;
@@ -21,10 +22,12 @@ public partial class HCMaxCompoundRulesDlg : ParserParametersBase
2122
private const string m_MaxApps = "MaxApps";
2223
private const string m_Guid = "Guid";
2324
private const string m_CompoundRules = "CompoundRules";
25+
private const string HelpTopicID = "khtpHCMaxCompoundRules";
2426
private XElement m_ParserParametersElem;
2527

2628
private DataGrid m_dataGrid;
2729
private DataSet m_dsCompoundRules;
30+
private IHelpTopicProvider m_helpTopicProvider;
2831

2932
public HCMaxCompoundRulesDlg()
3033
{
@@ -34,13 +37,14 @@ public HCMaxCompoundRulesDlg()
3437
/// <summary>
3538
/// Set up the dlg in preparation to showing it.
3639
/// </summary>
37-
public void SetDlgInfo(string title, string parserParameters, ILcmOwningSequence<IMoCompoundRule> compoundRules)
40+
public void SetDlgInfo(string title, string parserParameters, ILcmOwningSequence<IMoCompoundRule> compoundRules, IHelpTopicProvider helpTopicProvider)
3841
{
3942
CheckDisposed();
4043

4144
XmlRep = parserParameters;
4245
m_ParserParametersElem = XElement.Parse(parserParameters);
4346
Text = title;
47+
m_helpTopicProvider = helpTopicProvider;
4448

4549
m_dsCompoundRules = new DataSet { DataSetName = m_CompoundRules };
4650

@@ -151,7 +155,7 @@ private XElement CreateCompoundRulesElementToStore(XElement elem)
151155

152156
private void btnHelp_Click(object sender, EventArgs e)
153157
{
154-
MessageBox.Show("Help clicked");
158+
ShowHelp.ShowHelpTopic(m_helpTopicProvider, HelpTopicID);
155159
}
156160

157161
protected void EnforceValidValue(XElement elem, string item, int min, int max, bool useMinIfZero)

Src/LexText/ParserUI/ParserParametersDlg.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ private void btnHCMaxCompoundRuleApps_Click(object sender, EventArgs e)
215215
{
216216
// create and show compound rule max apps dialog
217217
var dlg = new HCMaxCompoundRulesDlg();
218-
dlg.SetDlgInfo("MaxApps", XmlRep, m_compoundRules);
218+
dlg.SetDlgInfo("MaxApps", XmlRep, m_compoundRules, m_helpTopicProvider);
219219
dlg.ShowDialog(this);
220220
XmlRep = dlg.XmlRep;
221221
}

0 commit comments

Comments
 (0)