Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
<layout class="MoAffixAllomorph" type="detail" name="AsLexemeFormBasic">
<part ref="AsLexemeForm" label="Lexeme Form" expansion="expanded">
<indent indent="true">
<part ref="IsAbstractBasic" label="Is Abstract Form" visibility="never" /> <!-- could use 'ifTrue' if we had it -->
<part ref="AllomorphStatus" label="Allomorph Status" visibility="ifdata" />
<part ref="MorphTypeBasic" visibility="ifdata"/>
<part ref="PhoneEnvBasic" visibility="ifdata"/>
<part ref="AsPosition" visibility="always"/>
Expand All @@ -121,7 +121,7 @@
<layout class="MoStemAllomorph" type="detail" name="AsLexemeFormBasic">
<part ref="AsLexemeForm" label="Lexeme Form" expansion="expanded">
<indent indent="true">
<part ref="IsAbstractBasic" label="Is Abstract Form" visibility="never" /> <!-- could use 'ifTrue' if we had it -->
<part ref="AllomorphStatus" label="Allomorph Status" visibility="ifdata" />
<part ref="MorphTypeBasic" visibility="ifdata"/>
<part ref="PhoneEnvBasic" visibility="ifdata"/>
<part ref="StemNameForLexemeForm" visibility="ifdata"/>
Expand All @@ -134,7 +134,7 @@
<layout class="MoAffixProcess" type="detail" name="AsLexemeFormBasic">
<part ref="AsLexemeForm" shouldNotMerge="true" label="Lexeme Form" expansion="expanded">
<indent indent="true">
<part ref="IsAbstractBasic" label="Is Abstract Form" visibility="never" /> <!-- could use 'ifTrue' if we had it -->
<part ref="IsAbstractBasic" label="Is Abstract Form" visibility="ifdata" />
<part ref="MorphTypeBasic" visibility="ifdata"/>
<part ref="RuleFormulaBasic" expansion="expanded" label="Affix Process Rule"/>
<part ref="InflectionClassesForLexemeForm" visibility="ifdata"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,15 @@

<!-- IsAbstract At Entry section -->
<part id="MoForm-Detail-IsAbstractBasic" type="Detail">
<slice field="IsAbstract" label="IsAbstract" editor="Checkbox"/>
</part>
<slice field="IsAbstract" label="IsAbstract" editor="Checkbox"/>
</part>
<part id="MoForm-Detail-AllomorphStatus" type="Detail">
<slice field="IsAbstract" label="IsAbstract" editor="enumComboBox">
<deParams>
<stringList group="AllomorphStatus" ids="IsElsewhereForm, IsAbstractForm"/>
</deParams>
</slice>
</part>

<!-- IsAbstract in Allomorph section -->
<part id="MoForm-Detail-IsAbstract" type="Detail">
Expand Down
4 changes: 4 additions & 0 deletions DistFiles/Language Explorer/Configuration/strings-en.xml
Original file line number Diff line number Diff line change
Expand Up @@ -488,4 +488,8 @@
<string id="EditGramFunc" txt="Edit Grammatical Info."/>
</group>
</group>
<group id="AllomorphStatus">
<string id="IsElsewhereForm" txt="Is Elsewhere Form"/>
<string id="IsAbstractForm" txt="Is Abstract Form"/>
</group>
</strings>
5 changes: 5 additions & 0 deletions Src/Common/Controls/DetailControls/DataTree.cs
Original file line number Diff line number Diff line change
Expand Up @@ -974,6 +974,11 @@ public virtual void ShowObject(ICmObject root, string layoutName, string layoutC
return;

string toolName = m_propertyTable.GetStringProperty("currentContentControl", null);
if (root is ILexEntry)
{
// We are in the Lexicon Edit Popup window
toolName = "lexiconEdit";
}
// Initialize our internal state with the state of the PropertyTable
m_fShowAllFields = m_propertyTable.GetBoolProperty("ShowHiddenFields-" + toolName, false, PropertyTable.SettingsGroup.LocalSettings);
m_propertyTable.SetPropertyPersistence("ShowHiddenFields-" + toolName, true, PropertyTable.SettingsGroup.LocalSettings);
Expand Down
30 changes: 27 additions & 3 deletions Src/Common/Controls/DetailControls/EnumComboSlice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
using SIL.FieldWorks.Common.FwUtils;
using SIL.PlatformUtilities;
using SIL.Utils;
using SIL.LCModel.Core.Cellar;

namespace SIL.FieldWorks.Common.Framework.DetailControls
{
Expand Down Expand Up @@ -166,11 +167,34 @@ protected override void UpdateDisplayFromDatabase()
{
if (!Object.IsValidObject)
return; // If the object is not valid our data needs to be refreshed, skip until data is valid again
int currentValue = m_cache.DomainDataByFlid.get_IntProp(Object.Hvo, m_flid);
int currentValue = GetPropValue();
//nb: we are assuming that an enumerations start with 0
m_combo.SelectedIndex = currentValue;
}

private int GetPropValue()
{
var type = m_cache.MetaDataCacheAccessor.GetFieldType(m_flid);
if (type == (int)CellarPropertyType.Boolean)
{
return m_cache.DomainDataByFlid.get_BooleanProp(Object.Hvo, m_flid) ? 1 : 0;
}
return m_cache.DomainDataByFlid.get_IntProp(Object.Hvo, m_flid);
}

private void SetPropValue(int value)
{
var type = m_cache.MetaDataCacheAccessor.GetFieldType(m_flid);
if (type == (int)CellarPropertyType.Boolean)
{
m_cache.DomainDataByFlid.SetBoolean(Object.Hvo, m_flid, value == 1);
}
else
{
m_cache.DomainDataByFlid.SetInt(Object.Hvo, m_flid, value);
}
}

/// <summary>
/// Event handler for selection changed in combo box.
/// </summary>
Expand All @@ -183,15 +207,15 @@ protected void SelectionChanged(object sender, EventArgs e)
return; // don't want to update things while the user is manipulating the list. (See FWR-1728.)
if (!Object.IsValidObject)
return; // If the object is not valid our data needs to be refreshed, skip until data is valid again
int oldValue = m_cache.DomainDataByFlid.get_IntProp(Object.Hvo, m_flid);
int oldValue = GetPropValue();
int newValue = m_combo.SelectedIndex;
// No sense in setting it to the same value.
if (oldValue != newValue)
{
m_cache.DomainDataByFlid.BeginUndoTask(
String.Format(DetailControlsStrings.ksUndoSet, m_fieldName),
String.Format(DetailControlsStrings.ksRedoSet, m_fieldName));
m_cache.DomainDataByFlid.SetInt(Object.Hvo, m_flid, newValue);
SetPropValue(newValue);
string sideEffectMethod = XmlUtils.GetAttributeValue(m_configurationNode, "sideEffect", null);
if (!string.IsNullOrEmpty(sideEffectMethod))
{
Expand Down
Loading