本文整理汇总了C#中IVwEnv.AddStringProp方法的典型用法代码示例。如果您正苦于以下问题:C# IVwEnv.AddStringProp方法的具体用法?C# IVwEnv.AddStringProp怎么用?C# IVwEnv.AddStringProp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IVwEnv
的用法示例。
在下文中一共展示了IVwEnv.AddStringProp方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Display
public override void Display(IVwEnv vwenv, int hvo, int frag)
{
switch (frag)
{
default:
break;
case HelloViewView.kfrText:
vwenv.AddStringProp(HelloViewView.ktagProp, this);
break;
}
}
示例2: Display
public override void Display(IVwEnv vwenv, int hvo, int frag)
{
switch (frag)
{
default:
break;
case InterlinearView.kfrText:
vwenv.OpenParagraph();
vwenv.AddObjVecItems(InterlinearView.ktagText_Words, this, InterlinearView.kfrWord);
vwenv.CloseParagraph();
break;
case InterlinearView.kfrWord:
vwenv.set_IntProperty((int)FwKernelLib.FwTextPropType.ktptMarginTrailing,
(int)FwKernelLib.FwTextPropVar.ktpvMilliPoint, 10000);
vwenv.OpenInnerPile();
vwenv.AddStringProp(InterlinearView.ktagWord_Form, this);
vwenv.AddStringProp(InterlinearView.ktagWord_Type, this);
vwenv.CloseInnerPile();
break;
}
}
示例3: Display
/// ------------------------------------------------------------------------------------
/// <summary>
/// Displays the specified vwenv.
/// </summary>
/// <param name="vwenv">The vwenv.</param>
/// <param name="hvo">The hvo.</param>
/// <param name="frag">The frag.</param>
/// ------------------------------------------------------------------------------------
public override void Display(IVwEnv vwenv, int hvo, int frag)
{
switch (frag)
{
case kfragScrFootnotes:
{
vwenv.AddObjVecItems(ScriptureTags.kflidScriptureBooks, this,
kfragBookFootnotes);
break;
}
case kfragBookFootnotes:
{
vwenv.AddObjVecItems(ScrBookTags.kflidFootnotes, this,
kfragFootnote);
break;
}
case kfragFootnote:
{
// Display each dummy footnote as a rectangle a half inch high, which allows us
// to accurately predict the height of a known number of them. Also put in a very
// short editable string, which we use for some other tests, but should not
// affect the paragraph height.
vwenv.set_IntProperty((int)FwTextPropType.ktptMarginTop,
(int)FwTextPropVar.ktpvMilliPoint, MiscUtils.kdzmpInch / 10);
vwenv.set_IntProperty((int)FwTextPropType.ktptMarginBottom,
(int)FwTextPropVar.ktpvMilliPoint, MiscUtils.kdzmpInch / 5);
vwenv.OpenParagraph();
if (m_fWantStrings)
vwenv.AddStringProp(StFootnoteTags.kflidFootnoteMarker, this);
vwenv.AddSimpleRect(0, MiscUtils.kdzmpInch / 2, MiscUtils.kdzmpInch / 2, 0);
vwenv.CloseParagraph();
break;
}
}
}
示例4: Display
/// ------------------------------------------------------------------------------------
/// <summary>
///
/// </summary>
/// <param name="vwenv"></param>
/// <param name="hvo"></param>
/// <param name="frag"></param>
/// ------------------------------------------------------------------------------------
public override void Display(IVwEnv vwenv, int hvo, int frag)
{
if ((m_displayType & DisplayType.kLiteralStringLabels) != 0)
{
ITsStrFactory factory = TsStrFactoryClass.Create();
vwenv.AddString(factory.MakeString("Label" + m_counter++, m_wsDefault));
}
switch(frag)
{
case 1: // the root; display the subitems, first using non-lazy view, then lazy one.
if ((m_displayType & DisplayType.kFootnoteDetailsSeparateParas) == DisplayType.kFootnoteDetailsSeparateParas)
vwenv.AddObjVecItems(m_flid, this, 10);
if ((m_displayType & DisplayType.kFootnoteDetailsSinglePara) == DisplayType.kFootnoteDetailsSinglePara)
vwenv.AddObjVecItems(m_flid, this, 11);
else
{
if ((m_displayType & DisplayType.kNormal) == DisplayType.kNormal)
{
vwenv.AddObjVecItems(m_flid, this, 3);
}
if ((m_displayType & DisplayType.kLazy) == DisplayType.kLazy)
{
vwenv.AddObjVecItems(m_flid, this, 2);
}
}
if ((m_displayType & DisplayType.kTitle) == DisplayType.kTitle)
vwenv.AddObjProp(SimpleRootsiteTestsConstants.kflidDocTitle, this, 3);
if (m_displayType == DisplayType.kOuterObjDetails)
vwenv.AddObjVecItems(m_flid, this, 6);
break;
case 2: // An StText, display paragraphs lazily
if ((m_displayType & DisplayType.kWithTopMargin) == DisplayType.kWithTopMargin)
vwenv.AddLazyVecItems(SimpleRootsiteTestsConstants.kflidTextParas, this, 4);
vwenv.AddLazyVecItems(SimpleRootsiteTestsConstants.kflidTextParas, this, 5);
break;
case 3: // An StText, display paragraphs not lazily.
if ((m_displayType & DisplayType.kWithTopMargin) == DisplayType.kWithTopMargin)
vwenv.AddObjVecItems(SimpleRootsiteTestsConstants.kflidTextParas, this, 4);
vwenv.AddObjVecItems(SimpleRootsiteTestsConstants.kflidTextParas, this, 5);
if ((m_displayType & DisplayType.kDuplicateParagraphs) != 0)
vwenv.AddObjVecItems(SimpleRootsiteTestsConstants.kflidTextParas, this, 5);
break;
case 4: // StTxtPara, display contents with top margin
OpenParaIfNeeded(vwenv, hvo);
vwenv.set_IntProperty((int)FwTextPropType.ktptMarginTop,
(int)FwTextPropVar.ktpvMilliPoint, kMarginTop);
AddParagraphContents(vwenv);
break;
case 5: // StTxtPara, display contents without top margin
OpenParaIfNeeded(vwenv, hvo);
AddParagraphContents(vwenv);
break;
case 6: // StTxtPara, display details of our outer object
int hvoOuter, tag, ihvo;
vwenv.GetOuterObject(vwenv.EmbeddingLevel - 1, out hvoOuter, out tag, out ihvo);
ITsString tss = TsStringHelper.MakeTSS("Hvo = " + hvoOuter + "; Tag = " + tag + "; Ihvo = " + ihvo,
m_wsDefault);
vwenv.AddString(tss);
break;
case SimpleRootsiteTestsConstants.kflidDocDivisions:
vwenv.AddObjVecItems(SimpleRootsiteTestsConstants.kflidDocDivisions, this,
SimpleRootsiteTestsConstants.kflidSectionStuff);
break;
case SimpleRootsiteTestsConstants.kflidSectionStuff:
if ((m_displayType & DisplayType.kNormal) == DisplayType.kNormal)
vwenv.AddObjProp(frag, this, 3);
if ((m_displayType & DisplayType.kLazy) == DisplayType.kLazy)
vwenv.AddObjProp(frag, this, 2);
break;
case 7: // ScrBook
vwenv.OpenDiv();
vwenv.AddObjVecItems(SimpleRootsiteTestsConstants.kflidDocFootnotes, this, 8);
vwenv.CloseDiv();
break;
case 8: // StFootnote
vwenv.AddObjVecItems(SimpleRootsiteTestsConstants.kflidTextParas, this,
9);
break;
case 9: // StTxtPara
vwenv.AddStringProp(SimpleRootsiteTestsConstants.kflidParaContents, null);
break;
case 10:
// Display a Footnote by displaying its "FootnoteMarker" in a paragraph
// by itself, followed by the sequence of paragraphs.
vwenv.AddStringProp(SimpleRootsiteTestsConstants.kflidFootnoteMarker, null);
vwenv.AddObjVecItems(SimpleRootsiteTestsConstants.kflidTextParas, this,
9);
break;
case 11:
// Display a Footnote by displaying its "FootnoteMarker" followed by the
// contents of its first paragraph (similar to the way footnotes are displayed in
// real life.
//.........这里部分代码省略.........
示例5: Display
/// ------------------------------------------------------------------------------------
/// <summary>
/// Displays the specified vwenv.
/// </summary>
/// <param name="vwenv">The vwenv.</param>
/// <param name="hvo">The hvo.</param>
/// <param name="frag">The frag.</param>
/// ------------------------------------------------------------------------------------
public override void Display(IVwEnv vwenv, int hvo, int frag)
{
CheckDisposed();
switch(frag)
{
case kfragLazyScripture:
{
// The configure method insists on trying to make an initial selection.
// If there isn't something selectable there, it expands everything.
vwenv.AddStringProp((int)Scripture.ScriptureTags.kflidChapterVerseSepr, this);
vwenv.AddLazyVecItems((int)Scripture.ScriptureTags.kflidScriptureBooks, this,
kfragLazyBook);
break;
}
case kfragLazyBook:
{
vwenv.AddLazyVecItems((int)ScrBook.ScrBookTags.kflidSections, this,
kfragDummySection);
break;
}
case kfragDummySection:
{
vwenv.AddObjProp((int)ScrSection.ScrSectionTags.kflidHeading, this,
kfragDummyStText);
vwenv.AddObjProp((int)ScrSection.ScrSectionTags.kflidContent, this,
kfragDummyStText);
break;
}
case kfragDummyStText:
{
vwenv.AddObjVecItems((int)StText.StTextTags.kflidParagraphs, this,
m_fParaWithContent ? kfragDummyParaWithContent : kfragDummyPara);
break;
}
case kfragDummyPara:
{
// Display each dummy paragraph as a rectangle an inch high, which allows us
// to accurately predict the height of a known number of them.
vwenv.AddSimpleRect(0, MiscUtils.kdzmpInch, MiscUtils.kdzmpInch, 0);
break;
}
case kfragDummyParaWithContent:
{
vwenv.OpenMappedTaggedPara();
vwenv.AddStringProp((int)StTxtPara.StTxtParaTags.kflidContents, null);
vwenv.CloseParagraph();
break;
}
}
}
示例6: AddExtraTwficRows
/// <summary>
/// The hvo is for a Wfic (CmBaseAnnotation).
/// </summary>
/// <param name="vwenv"></param>
/// <param name="hvoWfic"></param>
internal override void AddExtraTwficRows(IVwEnv vwenv, int hvoWfic)
{
SetTrailingAlignmentIfNeeded(vwenv, hvoWfic);
vwenv.AddStringProp(TextTagAnnotFlid, this);
}
示例7: Display
/// <summary>
/// All our display method does is to display the name of each item in the fake virtual property.
/// If it is the active object we are editing, at the relevant position in the relevant owner,
/// we display the name using the special marker property.
/// </summary>
/// <param name="vwenv"></param>
/// <param name="hvo"></param>
/// <param name="frag"></param>
public override void Display(IVwEnv vwenv, int hvo, int frag)
{
int hvoParent, tag, ihvo;
switch(frag)
{
case kfragName:
vwenv.GetOuterObject(vwenv.EmbeddingLevel - 1, out hvoParent, out tag, out ihvo);
if (m_fGotFocus && hvo == m_hvoTa && hvoParent == m_hvoParent && ihvo == m_ihvoTa)
vwenv.AddStringProp(m_taTagName, this);
else
vwenv.AddStringProp(m_snTagName, this);
break;
default:
throw new Exception("Unexpected fragment ID in TypeAheadSupportVc");
}
}
示例8: Display
/// ------------------------------------------------------------------------------------
/// <summary>
/// The main method just displays the text with the appropriate properties.
/// </summary>
/// <param name="vwenv">The view environment</param>
/// <param name="hvo">The HVo of the object to display</param>
/// <param name="frag">The fragment to lay out</param>
/// ------------------------------------------------------------------------------------
public override void Display(IVwEnv vwenv, int hvo, int frag)
{
CheckDisposed();
switch (frag)
{
case InnerFwListBox.kfragRoot:
Font f = m_listbox.Font;
if (m_listbox.StyleSheet == null)
{
// Try to get items a reasonable size based on whatever font has been set for the
// combo as a whole. We don't want to do this if a stylesheet has been set, because
// it will override the sizes specified in the stylesheet.
// Enhance JohnT: there are several more properties we could readily copy over
// from the font, but this is a good start.
vwenv.set_IntProperty((int)FwTextPropType.ktptFontSize,
(int)FwTextPropVar.ktpvMilliPoint, (int)(f.SizeInPoints * 1000));
}
// Setting the font family here appears to override the fonts associated with the
// TsString data. This causes trouble for non-Microsoft Sans Serif writing systems.
// See LT-551 for the bug report that revealed this problem.
// vwenv.set_StringProperty((int) FwTextPropType.ktptFontFamily,
// f.FontFamily.Name);
vwenv.set_IntProperty((int)FwTextPropType.ktptForeColor,
(int)FwTextPropVar.ktpvDefault, (int)ColorUtil.ConvertColorToBGR(m_listbox.ForeColor));
DisplayList(vwenv);
break;
case InnerFwListBox.kfragItems:
int index, hvoDummy, tagDummy;
int clev = vwenv.EmbeddingLevel;
vwenv.GetOuterObject(clev - 1, out hvoDummy, out tagDummy, out index);
bool fHighlighted = m_listbox.Owner.IsHighlighted(index);
if (fHighlighted && m_listbox.ShowHighlight)
{
vwenv.set_IntProperty((int)FwTextPropType.ktptForeColor,
(int)FwTextPropVar.ktpvDefault, (int)ColorUtil.ConvertColorToBGR(Color.FromKnownColor(KnownColor.HighlightText)));
vwenv.set_IntProperty((int)FwTextPropType.ktptBackColor,
(int)FwTextPropVar.ktpvDefault, (int)ColorUtil.ConvertColorToBGR(Color.FromKnownColor(KnownColor.Highlight)));
}
vwenv.OpenParagraph();
if (fHighlighted && m_listbox.ShowHighlight)
{
// Insert a string that has the foreground color not set, so the foreground color set above can take effect.
ITsStrBldr bldr = vwenv.DataAccess.get_StringProp(hvo, InnerFwListBox.ktagText).GetBldr();
bldr.SetIntPropValues(0, bldr.Length, (int) FwTextPropType.ktptForeColor, -1, -1);
vwenv.AddString(bldr.GetString());
}
else
{
vwenv.AddStringProp(InnerFwListBox.ktagText, this);
}
vwenv.AddString(m_tssBlanks);
vwenv.CloseParagraph();
break;
}
}
示例9: Display
public override void Display(IVwEnv vwenv, int hvo, int frag)
{
if (m_fMultilingual)
{
SetParaRtlIfNeeded(vwenv, m_wsDefault);
vwenv.AddStringAltMember(m_flid, m_wsDefault, this);
}
else
{
// Set the underlying paragraph to RTL if the first writing system in the
// string is RTL.
if (m_cache != null)
{
ITsString tss = m_cache.DomainDataByFlid.get_StringProp(hvo, m_flid);
ITsTextProps ttp = tss.get_Properties(0);
int var;
int ws = ttp.GetIntPropValues((int)FwTextPropType.ktptWs, out var);
if (ws == 0)
ws = m_wsDefault;
if (ws == 0)
ws = m_cache.DefaultAnalWs;
if (ws != 0)
{
SetParaRtlIfNeeded(vwenv, ws);
if (m_fShowWsLabel)
{
DisplayWithWritingSystemLabel(vwenv, ws);
return;
}
}
}
vwenv.AddStringProp(m_flid, this);
}
}
示例10: Display
public override void Display(IVwEnv vwenv, int hvo, int frag)
{
CheckDisposed();
// Enhance JohnT: make the alignment position a function of window width.
// Enhance JohnT: change background if this is the selected context line.
vwenv.OpenConcPara(m_info.ContextStringStartOffset,
m_info.ContextStringStartOffset + m_info.ContextStringLength,
VwConcParaOpts.kcpoDefault,
72 * 2 * 1000); // 72 pts per inch * 2 inches * 1000 -> 2" in millipoints.
if (m_info.Hvo == 0 || m_info.ContentStringFlid == 0)
{
vwenv.AddString(m_info.ContentString);
}
else
{
Debug.Assert(hvo == m_info.Hvo);
vwenv.AddStringProp(m_info.ContentStringFlid, this);
}
vwenv.CloseParagraph();
}
示例11: AddColumn
/// ------------------------------------------------------------------------------------
/// <summary>
/// Add a column to the header/footer
/// </summary>
/// <param name="vwenv"></param>
/// <param name="align"></param>
/// <param name="flid"></param>
/// ------------------------------------------------------------------------------------
private void AddColumn(IVwEnv vwenv, FwTextAlign align, PubHeader.PubHeaderTags flid)
{
vwenv.OpenTableCell(1, 1);
if (HeaderFooterParaStyle != null && HeaderFooterParaStyle != string.Empty)
{
vwenv.set_StringProperty((int)FwTextPropType.ktptNamedStyle,
HeaderFooterParaStyle);
}
vwenv.set_IntProperty((int)FwTextPropType.ktptAlign,
(int)FwTextPropVar.ktpvEnum, (int)align);
vwenv.OpenMappedPara();
vwenv.AddStringProp((int)flid, this);
vwenv.CloseParagraph();
vwenv.CloseTableCell();
}
示例12: Display
public override void Display(IVwEnv vwenv, int hvo, int frag)
{
switch (frag)
{
default:
break;
case kfrBook:
vwenv.set_IntProperty((int)FwKernelLib.FwTextPropType.ktptFontSize, (int)FwKernelLib.FwTextPropVar.ktpvMilliPoint, 24000);
vwenv.set_IntProperty((int)FwKernelLib.FwTextPropType.ktptBold, (int)FwKernelLib.FwTextPropVar.ktpvEnum,
(int)FwKernelLib.FwTextToggleVal.kttvOn);
vwenv.set_IntProperty((int)FwKernelLib.FwTextPropType.ktptAlign, (int)FwKernelLib.FwTextPropVar.ktpvEnum,
(int)FwKernelLib.FwTextAlign.ktalCenter);
vwenv.AddStringProp(ktagBookName, this);
vwenv.AddLazyVecItems(ktagBookSections, this, kfrSection);
break;
case kfrSection:
vwenv.set_IntProperty((int)FwKernelLib.FwTextPropType.ktptItalic, (int)FwKernelLib.FwTextPropVar.ktpvEnum,
(int)FwKernelLib.FwTextToggleVal.kttvOn);
vwenv.OpenParagraph();
vwenv.AddStringProp(ktagSectionTitle, this);
vwenv.AddString(m_tssLeftParen);
vwenv.AddStringProp(ktagSectionRefs, this);
vwenv.AddString(m_tssRightParen);
vwenv.CloseParagraph();
vwenv.AddLazyVecItems(ktagSectionParas, this, kfrDoublePara);
break;
case kfrDoublePara:
AddDoublePara(vwenv, hvo);
// Now insert an interlinear version of the paragraph. This is basically editable.
vwenv.set_IntProperty((int)FwKernelLib.FwTextPropType.ktptBackColor,
(int)FwKernelLib.FwTextPropVar.ktpvDefault, m_colorEditable);
vwenv.OpenParagraph();
vwenv.AddObjVecItems(ktagParaBundles, this, kfrBundle);
vwenv.CloseParagraph();
break;
case kfrBundle:
// Put a little space after each bundle to separate them.
vwenv.set_IntProperty((int)FwKernelLib.FwTextPropType.ktptMarginTrailing,
(int)FwKernelLib.FwTextPropVar.ktpvMilliPoint, 5000);
vwenv.OpenInnerPile();
vwenv.AddStringProp(ktagBundleBase, this);
vwenv.set_IntProperty((int)FwKernelLib.FwTextPropType.ktptBold,
(int)FwKernelLib.FwTextPropVar.ktpvEnum,
(int)FwKernelLib.FwTextToggleVal.kttvOn);
vwenv.set_IntProperty((int)FwKernelLib.FwTextPropType.ktptFontSize,
(int)FwKernelLib.FwTextPropVar.ktpvMilliPoint, 13000);
vwenv.AddStringProp(ktagBundleIdiom, this);
vwenv.set_IntProperty((int)FwKernelLib.FwTextPropType.ktptFontSize,
(int)FwKernelLib.FwTextPropVar.ktpvMilliPoint, 8000);
vwenv.AddStringProp(ktagBundleLing, this);
vwenv.CloseInnerPile();
break;
}
}
示例13: Display
/// <summary>
/// This is the basic method needed for the view constructor.
/// </summary>
public override void Display(IVwEnv vwenv, int hvo, int frag)
{
switch (frag)
{
case VectorReferenceView.kfragTargetVector:
// Check for an empty vector.
if (hvo == 0 || m_cache.DomainDataByFlid.get_VecSize(hvo, m_flid) == 0)
{
vwenv.set_IntProperty((int)FwTextPropType.ktptForeColor,
(int)FwTextPropVar.ktpvDefault,
(int)ColorUtil.ConvertColorToBGR(Color.Gray));
vwenv.set_IntProperty((int)FwTextPropType.ktptLeadingIndent,
(int)FwTextPropVar.ktpvMilliPoint, 18000);
vwenv.set_IntProperty((int)FwTextPropType.ktptEditable,
(int)FwTextPropVar.ktpvDefault,
(int)TptEditable.ktptNotEditable);
vwenv.set_IntProperty((int)FwTextPropType.ktptAlign,
(int)FwTextPropVar.ktpvEnum, (int)FwTextAlign.ktalRight);
//vwenv.AddString(m_cache.MakeUserTss("Click to select -->"));
if (hvo != 0)
vwenv.NoteDependency(new[] { hvo }, new[] { m_flid }, 1);
}
else
{
if (!string.IsNullOrEmpty(TextStyle))
{
vwenv.set_StringProperty((int)FwTextPropType.ktptNamedStyle, TextStyle);
}
vwenv.OpenParagraph();
vwenv.AddObjVec(m_flid, this, frag);
vwenv.CloseParagraph();
}
break;
case VectorReferenceView.kfragTargetObj:
// Display one object from the vector.
{
ILgWritingSystemFactory wsf =
m_cache.WritingSystemFactory;
vwenv.set_IntProperty((int)FwTextPropType.ktptEditable,
(int)FwTextPropVar.ktpvDefault,
(int)TptEditable.ktptNotEditable);
ITsString tss;
ITsStrFactory tsf = m_cache.TsStrFactory;
Debug.Assert(hvo != 0);
#if USEBESTWS
if (m_displayWs != null && m_displayWs.StartsWith("best"))
{
// The flid can be a variety of types, so deal with those.
Debug.WriteLine("Using 'best ws': " + m_displayWs);
int magicWsId = LgWritingSystem.GetMagicWsIdFromName(m_displayWs);
int actualWS = m_cache.LanguageProject.ActualWs(magicWsId, hvo, m_flid);
Debug.WriteLine("Actual ws: " + actualWS.ToString());
}
else
{
#endif
// Use reflection to get a prebuilt name if we can. Otherwise
// settle for piecing together a string.
Debug.Assert(m_cache != null);
var obj = m_cache.ServiceLocator.GetInstance<ICmObjectRepository>().GetObject(hvo);
Debug.Assert(obj != null);
Type type = obj.GetType();
System.Reflection.PropertyInfo pi = type.GetProperty("TsName",
System.Reflection.BindingFlags.Instance |
System.Reflection.BindingFlags.Public |
System.Reflection.BindingFlags.FlattenHierarchy);
if (pi != null)
{
tss = (ITsString)pi.GetValue(obj, null);
}
else
{
if (!string.IsNullOrEmpty(m_displayNameProperty))
{
pi = type.GetProperty(m_displayNameProperty,
System.Reflection.BindingFlags.Instance |
System.Reflection.BindingFlags.Public |
System.Reflection.BindingFlags.FlattenHierarchy);
}
int ws = wsf.GetWsFromStr(obj.SortKeyWs);
if (ws == 0)
ws = m_cache.ServiceLocator.WritingSystems.DefaultAnalysisWritingSystem.Handle;
if (pi != null)
{
object s = pi.GetValue(obj, null);
if (s is ITsString)
tss = (ITsString)s;
else
tss = tsf.MakeString((string)s, ws);
}
else
{
// ShortNameTss sometimes gets PropChanged, so worth letting the view know that's
// what we're inserting.
var flid = Cache.MetaDataCacheAccessor.GetFieldId2(obj.ClassID, "ShortNameTSS", true);
vwenv.AddStringProp(flid, this);
//.........这里部分代码省略.........
示例14: DisplayMorphForm
private void DisplayMorphForm(IVwEnv vwenv, int hvo, int frag, int ws, int choiceIndex)
{
int hvoMorphForm = vwenv.DataAccess.get_ObjectProp(hvo, ktagSbMorphForm);
// Allow editing of the morpheme breakdown line.
SetColor(vwenv, m_choices.LabelRGBFor(choiceIndex));
// On this line we want an icon only for the first column (and only if it is the first
// occurrence of the flid).
bool fWantIcon = m_fIsMorphemeFormEditable && (frag == kfragFirstMorph) && m_choices.IsFirstOccurrenceOfFlid(choiceIndex);
if (!fWantIcon)
SetIndentForMissingIcon(vwenv);
vwenv.OpenParagraph();
bool fFirstMorphLine = (m_choices.IndexOf(InterlinLineChoices.kflidMorphemes) == choiceIndex);
if (fWantIcon) // Review JohnT: should we do the 'edit box' for all first columns?
{
AddPullDownIcon(vwenv, ktagMorphFormIcon);
// Create an edit box that stays visible when the user deletes
// the first morpheme (like the WordGloss box).
// This is especially useful if the user wants to
// delete the entire MorphForm line (cf. LT-1621).
vwenv.set_IntProperty((int)FwTextPropType.ktptMarginTrailing,
(int)FwTextPropVar.ktpvMilliPoint,
kmpIconMargin);
vwenv.set_IntProperty((int)FwTextPropType.ktptPadTrailing,
(int)FwTextPropVar.ktpvMilliPoint,
2000);
vwenv.set_IntProperty((int)FwTextPropType.ktptPadLeading,
(int)FwTextPropVar.ktpvMilliPoint,
2000);
vwenv.set_IntProperty((int)FwTextPropType.ktptBackColor,
(int)FwTextPropVar.ktpvDefault, krgbEditable);
}
// Per LT-14891, morpheme form is not editable except for the default vernacular.
if (m_fIsMorphemeFormEditable && m_choices.IsFirstOccurrenceOfFlid(choiceIndex))
MakeNextFlowObjectEditable(vwenv);
else
MakeNextFlowObjectReadOnly(vwenv);
vwenv.OpenInnerPile();
vwenv.OpenParagraph();
if (fFirstMorphLine)
vwenv.AddStringProp(ktagSbMorphPrefix, this);
// This is never missing, but may, or may not, be editable.
vwenv.AddObjProp(ktagSbMorphForm, this, kfragNamedObjectNameChoices + choiceIndex);
if (fFirstMorphLine)
vwenv.AddStringProp(ktagSbMorphPostfix, this);
// close the special edit box we opened for the first morpheme.
vwenv.CloseParagraph();
vwenv.CloseInnerPile();
vwenv.CloseParagraph();
}
示例15: Display
/// ------------------------------------------------------------------------------------
/// <summary>
/// This is the main interesting method of displaying objects and fragments of them.
/// Scripture Footnotes are displayed by displaying each footnote's reference and text.
/// The text is displayed using the standard view constructor for StText.
/// </summary>
/// <param name="vwenv"></param>
/// <param name="hvo"></param>
/// <param name="frag"></param>
/// ------------------------------------------------------------------------------------
public override void Display(IVwEnv vwenv, int hvo, int frag)
{
switch (frag)
{
case (int)StTextFrags.kfrFootnote:
{
// FWR-1640: Make the sequence of footnote paragraphs non-editable
// since we only allow one para per footnote. This will cause
// pasting multiple paragraphs to work correctly.
vwenv.set_IntProperty((int)FwTextPropType.ktptEditable,
(int)FwTextPropVar.ktpvEnum,
(int)TptEditable.ktptNotEditable);
base.Display(vwenv, hvo, frag);
break;
}
case (int)FootnoteFrags.kfrScripture:
{
vwenv.NoteDependency(new int[] { m_cache.LanguageProject.TranslatedScriptureOA.Hvo },
new int[] { (int)ScriptureTags.kflidScriptureBooks }, 1);
vwenv.AddLazyVecItems(BooksTag, this, (int)FootnoteFrags.kfrBook);
break;
}
case (int)FootnoteFrags.kfrRootInPageSeq:
{
vwenv.AddObjVec(ScrBookTags.kflidFootnotes, this, (int)FootnoteFrags.kfrAllFootnotesWithinPagePara);
break;
}
case (int)FootnoteFrags.kfrFootnoteWithinPagePara:
{
// Insert the marker and reference
vwenv.AddObj(hvo, this, (int)StTextFrags.kfrFootnoteMarker);
vwenv.AddObj(hvo, this,(int)StTextFrags.kfrFootnoteReference);
// Insert (we hope only one) paragraph contents.
vwenv.AddObjVecItems(StTextTags.kflidParagraphs, this, (int)FootnoteFrags.kfrFootnoteParaWithinPagePara);
break;
}
case (int) FootnoteFrags.kfrFootnoteParaWithinPagePara:
{
if (!InsertParaContentsUserPrompt(vwenv, hvo))
{
// Display the text paragraph contents, or its user prompt.
vwenv.AddStringProp(StTxtParaTags.kflidContents, null);
}
break;
}
case (int)FootnoteFrags.kfrBook:
{
vwenv.OpenDiv();
vwenv.AddObjVecItems(ScrBookTags.kflidFootnotes, this,
(int)StTextFrags.kfrFootnote);
vwenv.CloseDiv();
break;
}
case (int)StTextFrags.kfrFootnoteReference:
{
DisplayFootnoteReference(vwenv, hvo);
break;
}
default:
base.Display(vwenv, hvo, frag);
break;
}
}