本文整理汇总了C#中IVwEnv.CloseTableRow方法的典型用法代码示例。如果您正苦于以下问题:C# IVwEnv.CloseTableRow方法的具体用法?C# IVwEnv.CloseTableRow怎么用?C# IVwEnv.CloseTableRow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IVwEnv
的用法示例。
在下文中一共展示了IVwEnv.CloseTableRow方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CloseTableRow
/// ------------------------------------------------------------------------------------
/// <summary>
/// Closes the table row.
/// </summary>
/// <param name="vwenv">The view environment.</param>
/// <param name="ann">The annotation being displayed.</param>
/// ------------------------------------------------------------------------------------
private void CloseTableRow(IVwEnv vwenv, IScrScriptureNote ann)
{
if (ann.Hvo != SelectedNoteHvo)
{
// Display cell used for padding (to right-indent unselected annotations by
// the width of the frame used to highlight the selected annotation).
vwenv.OpenTableCell(1, 1);
vwenv.AddString(m_tssEmpty);
vwenv.CloseTableCell();
}
vwenv.CloseTableRow();
}
示例2: DisplayResponse
/// ------------------------------------------------------------------------------------
/// <summary>
/// Display a response to an annotation.
/// </summary>
/// <param name="vwenv"></param>
/// <param name="text">StJournalText containing the response</param>
/// <param name="expanded">whether response should be expanded</param>
/// ------------------------------------------------------------------------------------
private void DisplayResponse(IVwEnv vwenv, IStJournalText text, bool expanded)
{
#region Response text
// Display response text
vwenv.OpenTableRow();
// Display empty first, second, and third cells
vwenv.OpenTableCell(1, 3);
vwenv.CloseTableCell();
vwenv.set_IntProperty((int)FwTextPropType.ktptBorderTop,
(int)FwTextPropVar.ktpvMilliPoint, 500);
vwenv.OpenTableCell(1, 2);
vwenv.AddObjVecItems((int)StTextTags.kflidParagraphs, this, (int)StTextFrags.kfrPara);
vwenv.CloseTableCell();
vwenv.CloseTableRow();
#endregion
#region Author and creation date
// Author and creation date
vwenv.OpenTableRow();
// Display empty first, second, and third cells
vwenv.OpenTableCell(1, 3);
vwenv.CloseTableCell();
// Display author in the third cell
vwenv.OpenTableCell(1, 1);
SetDisabledColorForNote(vwenv);
vwenv.OpenConcPara(0, 0, 0, 0);
vwenv.AddString(m_authorLabel);
vwenv.CloseParagraph();
vwenv.CloseTableCell();
// Display creation date in the fourth cell
vwenv.OpenTableCell(1, 1);
vwenv.OpenConcPara(0, 0, 0, 0);
vwenv.AddString(m_createdLabel);
vwenv.AddString(m_tsStrFactory.MakeString(text.DateCreated.ToShortDateString(),
m_cache.DefaultUserWs));
vwenv.CloseParagraph();
vwenv.CloseTableCell();
vwenv.CloseTableRow();
#endregion
}
示例3: AddEditRow
/// ------------------------------------------------------------------------------------
/// <summary>
/// Add a table/row for editing a new object.
/// </summary>
/// <param name="vwenv">The vwenv.</param>
/// <param name="hvo">The hvo.</param>
/// ------------------------------------------------------------------------------------
private void AddEditRow(IVwEnv vwenv, int hvo)
{
// set the border color to gray
vwenv.set_IntProperty((int )FwTextPropType.ktptBorderColor,
(int)FwTextPropVar.ktpvDefault,
(int)RGB(BorderColor)); //SystemColors.ControlDark));
// Make a table
VwLength[] rglength = m_xbv.GetColWidthInfo();
int colCount = m_columns.Count;
if (m_fShowSelected)
colCount++;
VwLength vl100; // Length representing 100%.
vl100.unit = rglength[0].unit;
vl100.nVal = 1;
for (int i = 0; i < colCount; ++i)
{
Debug.Assert(vl100.unit == rglength[i].unit);
vl100.nVal += rglength[i].nVal;
}
vwenv.OpenTable(colCount, // this many columns
vl100, // using 100% of available space
72000 / 96, //0, // no border
VwAlignment.kvaLeft, // cells by default left aligned
// VwFramePosition.kvfpBelow, //.kvfpBox, //.kvfpVoid, // no frame
VwFramePosition.kvfpBelow | VwFramePosition.kvfpRhs,
VwRule.kvrlCols, // vertical lines between columns
0, // no space between cells
0, // no padding within cell.
false);
for (int i = 0; i < colCount; ++i)
vwenv.MakeColumns(1, rglength[i]);
// the table only has a body (no header or footer), and only one row.
vwenv.OpenTableBody();
vwenv.OpenTableRow();
IVwCacheDa cda = m_cache.DomainDataByFlid as IVwCacheDa;
// Make the cells.
if (m_fShowColumnsRTL)
{
for (int i = m_columns.Count; i > 0; --i)
AddEditCell(vwenv, cda, i);
}
else
{
for (int i = 1; i <= m_columns.Count; ++i)
AddEditCell(vwenv, cda, i);
}
vwenv.CloseTableRow();
vwenv.CloseTableBody();
vwenv.CloseTable();
}
示例4: Display
/// ------------------------------------------------------------------------------------
/// <summary>
/// Display the header or footer as a table containing three cells (left-, center-, and
/// right-aligned), each with a TS String taken from the given PubHeader
/// </summary>
/// <param name="vwenv"></param>
/// <param name="hvo">id of a PubHeader object</param>
/// <param name="frag">Constant (ignored)</param>
/// ------------------------------------------------------------------------------------
public override void Display(IVwEnv vwenv, int hvo, int frag)
{
CheckDisposed();
// If there is only data in the outside columns, then make a two column
// table. If there is only data in the center column then make a 1 column
// table. Otherwise make it three columns.
int columnCount = 3;
if (m_autoAdjustColumns)
{
if (!DataInOutsideColumns(hvo))
columnCount = 1;
else if (!DataInCenterColumn(hvo))
columnCount = 2;
}
VwLength width;
width.unit = VwUnit.kunPercent100;
width.nVal = 10000;
vwenv.OpenTable(columnCount, width, 0, VwAlignment.kvaLeft,
VwFramePosition.kvfpVoid, VwRule.kvrlNone, 0, 0, false);
switch(columnCount)
{
case 1: width.nVal = 10000; break;
case 2: width.nVal = 5000; break;
case 3: width.nVal = 3333; break;
}
vwenv.MakeColumns(columnCount, width);
vwenv.OpenTableBody();
vwenv.OpenTableRow();
// Left Column
if (columnCount > 1)
AddColumn(vwenv, FwTextAlign.ktalLeft, LeftElementFlid);
// Center Column
if (columnCount != 2)
AddColumn(vwenv, FwTextAlign.ktalCenter, PubHeader.PubHeaderTags.kflidCenteredText);
// Right Column
if (columnCount > 1)
AddColumn(vwenv, FwTextAlign.ktalRight, RightElementFlid);
vwenv.CloseTableRow();
vwenv.CloseTableBody();
vwenv.CloseTable();
}
示例5: Display
//.........这里部分代码省略.........
vwenv.set_IntProperty((int)FwTextPropType.ktptFontSize,
(int)FwTextPropVar.ktpvMilliPoint, 10000);
vwenv.AddString(m_tssTitle);
}
vwenv.CloseTableCell();
// Second cell has ws labels.
vwenv.set_IntProperty((int)FwTextPropType.ktptBackColor,
(int) FwTextPropVar.ktpvDefault, m_editBackColor);
vwenv.set_IntProperty((int)FwTextPropType.ktptBorderLeading,
(int)FwTextPropVar.ktpvMilliPoint, 1000);
if (i == 0)
vwenv.set_IntProperty((int)FwTextPropType.ktptBorderTop,
(int)FwTextPropVar.ktpvMilliPoint, 1000);
if (i == m_writingSystems.Length - 1)
vwenv.set_IntProperty((int)FwTextPropType.ktptBorderBottom,
(int)FwTextPropVar.ktpvMilliPoint, 1000);
vwenv.OpenTableCell(1,1);
vwenv.Props = m_ttpDataCellProps;
vwenv.Props = m_ttpWsLabel;
vwenv.AddString(m_WsLabels[i]);
vwenv.CloseTableCell();
// Third cell has the Title property, in a box.
vwenv.set_IntProperty((int)FwTextPropType.ktptBackColor,
(int) FwTextPropVar.ktpvDefault, m_editBackColor);
// Set the underlying directionality so that arrow keys work properly.
bool fRTL = m_writingSystems[i].RightToLeftScript;
vwenv.set_IntProperty((int)FwTextPropType.ktptRightToLeft,
(int)FwTextPropVar.ktpvEnum, fRTL ? -1 : 0);
vwenv.set_IntProperty((int)FwTextPropType.ktptAlign,
(int)FwTextPropVar.ktpvEnum,
fRTL ? (int)FwTextAlign.ktalRight : (int)FwTextAlign.ktalLeft);
if (i == 0)
vwenv.set_IntProperty((int)FwTextPropType.ktptBorderTop,
(int)FwTextPropVar.ktpvMilliPoint, 1000);
if (i == m_writingSystems.Length - 1)
vwenv.set_IntProperty((int)FwTextPropType.ktptBorderBottom,
(int)FwTextPropVar.ktpvMilliPoint, 1000);
vwenv.OpenTableCell(1,1);
vwenv.OpenParagraph();
vwenv.Props = m_ttpDataCellProps;
vwenv.set_IntProperty((int)FwTextPropType.ktptEditable, (int)FwTextPropVar.ktpvEnum,
this.Editable ? (int)TptEditable.ktptIsEditable : (int)TptEditable.ktptNotEditable);
if (IsScripture)
{
vwenv.AddStringAltMember(m_vtagStTextTitle, m_writingSystems[i].Handle, this);
}
else
{
vwenv.AddStringAltMember(CmMajorObjectTags.kflidName, m_writingSystems[i].Handle, this);
}
vwenv.CloseParagraph();
vwenv.CloseTableCell();
vwenv.set_IntProperty((int)FwTextPropType.ktptMarginTrailing,
(int)FwTextPropVar.ktpvMilliPoint, 10000);
vwenv.set_IntProperty((int)FwTextPropType.ktptBorderTrailing,
(int)FwTextPropVar.ktpvMilliPoint, 1000);
vwenv.OpenTableCell(1, 1);
vwenv.CloseTableCell();
vwenv.CloseTableRow();
}
//// Second row.
//vwenv.OpenTableRow();
//
//// First cell has 'Comments' label in bold.
//vwenv.Props = m_ttpBold;
//vwenv.OpenTableCell(1,1);
//vwenv.set_IntProperty((int)FwTextPropType.ktptMarginLeading,
// (int)FwTextPropVar.ktpvMilliPoint, 10000);
//vwenv.AddString(m_tssComments);
//vwenv.CloseTableCell();
//
//// Second cell has the Description property, in a box.
//vwenv.set_IntProperty((int)FwTextPropType.ktptMarginTrailing,
// (int)FwTextPropVar.ktpvMilliPoint, 10000);
//vwenv.OpenTableCell(1,1);
//vwenv.Props = m_ttpDataCellProps;
//vwenv.set_IntProperty((int)FwTextPropType.ktptBorderBottom,
// (int)FwTextPropVar.ktpvMilliPoint, 1000);
//vwenv.AddStringAltMember(
// (int)CmMajorObject.CmMajorObjectTags.kflidDescription, m_wsAnalysis, this);
//vwenv.CloseTableCell();
//
//vwenv.CloseTableRow();
vwenv.CloseTableBody();
vwenv.CloseTable();
break;
default:
throw new Exception("Bad frag id in TitleContentsVc");
}
}
示例6: Display
//.........这里部分代码省略.........
vwenv.set_IntProperty((int)FwTextPropType.ktptOffset, (int)FwTextPropVar.ktpvMilliPoint, -charOffset);
vwenv.OpenTableCell(1, 1);
vwenv.AddString(m_arrow);
vwenv.CloseTableCell();
// RHS cell
vwenv.Props = m_ctxtProps;
vwenv.set_IntProperty((int)FwTextPropType.ktptPadTop, (int)FwTextPropVar.ktpvMilliPoint, ctxtPadding);
vwenv.OpenTableCell(1, 1);
vwenv.OpenParagraph();
if (m_cache.GetVectorSize(hvo, (int)PhSegRuleRHS.PhSegRuleRHSTags.kflidStrucChange) > 0)
{
vwenv.AddObjVecItems((int)PhSegRuleRHS.PhSegRuleRHSTags.kflidStrucChange, this, kfragContext);
}
else
{
OpenContextPile(vwenv, false);
vwenv.Props = m_bracketProps;
vwenv.AddProp((int)PhSegRuleRHS.PhSegRuleRHSTags.kflidStrucChange, this, kfragEmpty);
CloseContextPile(vwenv, false);
}
vwenv.CloseParagraph();
vwenv.CloseTableCell();
// slash cell
vwenv.Props = m_charProps;
vwenv.set_IntProperty((int)FwTextPropType.ktptOffset, (int)FwTextPropVar.ktpvMilliPoint, -charOffset);
vwenv.OpenTableCell(1, 1);
vwenv.AddString(m_slash);
vwenv.CloseTableCell();
// left context cell
vwenv.Props = m_ctxtProps;
vwenv.set_IntProperty((int)FwTextPropType.ktptPadTop, (int)FwTextPropVar.ktpvMilliPoint, ctxtPadding);
vwenv.OpenTableCell(1, 1);
vwenv.OpenParagraph();
if (m_cache.GetObjProperty(hvo, (int)PhSegRuleRHS.PhSegRuleRHSTags.kflidLeftContext) != 0)
{
vwenv.AddObjProp((int)PhSegRuleRHS.PhSegRuleRHSTags.kflidLeftContext, this, kfragContext);
}
else
{
OpenContextPile(vwenv, false);
vwenv.Props = m_bracketProps;
vwenv.AddProp((int)PhSegRuleRHS.PhSegRuleRHSTags.kflidLeftContext, this, kfragEmpty);
CloseContextPile(vwenv, false);
}
vwenv.CloseParagraph();
vwenv.CloseTableCell();
// underscore cell
vwenv.Props = m_charProps;
vwenv.set_IntProperty((int)FwTextPropType.ktptOffset, (int)FwTextPropVar.ktpvMilliPoint, -charOffset);
vwenv.OpenTableCell(1, 1);
vwenv.AddString(m_underscore);
vwenv.CloseTableCell();
// right context cell
vwenv.Props = m_ctxtProps;
vwenv.set_IntProperty((int)FwTextPropType.ktptPadTop, (int)FwTextPropVar.ktpvMilliPoint, ctxtPadding);
vwenv.OpenTableCell(1, 1);
vwenv.OpenParagraph();
if (m_cache.GetObjProperty(hvo, (int)PhSegRuleRHS.PhSegRuleRHSTags.kflidRightContext) != 0)
{
vwenv.AddObjProp((int)PhSegRuleRHS.PhSegRuleRHSTags.kflidRightContext, this, kfragContext);
}
else
{
OpenContextPile(vwenv, false);
vwenv.Props = m_bracketProps;
vwenv.AddProp((int)PhSegRuleRHS.PhSegRuleRHSTags.kflidRightContext, this, kfragEmpty);
CloseContextPile(vwenv, false);
}
vwenv.CloseParagraph();
vwenv.CloseTableCell();
vwenv.CloseTableRow();
vwenv.CloseTableBody();
vwenv.CloseTable();
break;
case kfragRule:
if (m_cache.GetVectorSize(hvo, (int)PhRegularRule.PhSegmentRuleTags.kflidStrucDesc) > 0)
{
vwenv.AddObjVecItems((int)PhRegularRule.PhSegmentRuleTags.kflidStrucDesc, this, kfragContext);
}
else
{
OpenContextPile(vwenv, false);
vwenv.Props = m_bracketProps;
vwenv.AddProp((int)PhRegularRule.PhSegmentRuleTags.kflidStrucDesc, this, kfragEmpty);
CloseContextPile(vwenv, false);
}
break;
default:
base.Display(vwenv, hvo, frag);
break;
}
}
示例7: Display
//.........这里部分代码省略.........
// input header cell
vwenv.Props = m_headerProps;
vwenv.OpenTableCell(1, 1);
vwenv.AddString(m_inputStr);
vwenv.CloseTableCell();
// input left empty cell
vwenv.Props = m_ctxtProps;
vwenv.set_IntProperty((int)FwTextPropType.ktptBorderLeading, (int)FwTextPropVar.ktpvMilliPoint, 1000);
vwenv.OpenTableCell(1, 1);
vwenv.OpenParagraph();
OpenContextPile(vwenv, false);
vwenv.Props = m_bracketProps;
vwenv.AddProp(ktagLeftEmpty, this, kfragEmpty);
CloseContextPile(vwenv, false);
vwenv.CloseParagraph();
vwenv.CloseTableCell();
// input context cells
vwenv.AddObjVec(MoAffixProcessTags.kflidInput, this, kfragInput);
// input right empty cell
vwenv.Props = m_ctxtProps;
vwenv.OpenTableCell(1, 1);
vwenv.OpenParagraph();
OpenContextPile(vwenv, false);
vwenv.Props = m_bracketProps;
vwenv.AddProp(ktagRightEmpty, this, kfragEmpty);
CloseContextPile(vwenv, false);
vwenv.CloseParagraph();
vwenv.CloseTableCell();
vwenv.CloseTableRow();
vwenv.OpenTableRow();
// index header cell
vwenv.Props = m_headerProps;
vwenv.OpenTableCell(1, 1);
vwenv.AddString(m_indexStr);
vwenv.CloseTableCell();
// index left empty cell
vwenv.Props = m_indexProps;
vwenv.set_IntProperty((int)FwTextPropType.ktptBorderLeading, (int)FwTextPropVar.ktpvMilliPoint, 1000);
vwenv.OpenTableCell(1, 1);
vwenv.CloseTableCell();
// index cells
for (int i = 0; i < m_rule.InputOS.Count; i++)
{
vwenv.Props = m_indexProps;
vwenv.OpenTableCell(1, 1);
vwenv.AddString(tsf.MakeString(Convert.ToString(i + 1), userWs));
vwenv.CloseTableCell();
}
// index right empty cell
vwenv.Props = m_indexProps;
vwenv.OpenTableCell(1, 1);
vwenv.CloseTableCell();
vwenv.CloseTableRow();
vwenv.CloseTableBody();
vwenv.CloseTable();
vwenv.CloseTableCell();
示例8: DisplayWithWritingSystemLabel
private void DisplayWithWritingSystemLabel(IVwEnv vwenv, int ws)
{
ITsString tssLabel = NameOfWs(ws);
// We use a table to display
// encodings in column one and the strings in column two.
// The table uses 100% of the available width.
VwLength vlTable;
vlTable.nVal = 10000;
vlTable.unit = VwUnit.kunPercent100;
int dxs; // Width of displayed string.
int dys; // Height of displayed string (not used here).
vwenv.get_StringWidth(tssLabel, null, out dxs, out dys);
VwLength vlColWs; // 5-pt space plus max label width.
vlColWs.nVal = dxs + 5000;
vlColWs.unit = VwUnit.kunPoint1000;
// The Main column is relative and uses the rest of the space.
VwLength vlColMain;
vlColMain.nVal = 1;
vlColMain.unit = VwUnit.kunRelative;
// Enhance JohnT: possibly allow for right-to-left UI by reversing columns?
vwenv.OpenTable(2, // Two columns.
vlTable, // Table uses 100% of available width.
0, // Border thickness.
VwAlignment.kvaLeft, // Default alignment.
VwFramePosition.kvfpVoid, // No border.
VwRule.kvrlNone, // No rules between cells.
0, // No forced space between cells.
0, // No padding inside cells.
false);
// Specify column widths. The first argument is the number of columns,
// not a column index. The writing system column only occurs at all if its
// width is non-zero.
vwenv.MakeColumns(1, vlColWs);
vwenv.MakeColumns(1, vlColMain);
vwenv.OpenTableBody();
vwenv.OpenTableRow();
// First cell has writing system abbreviation displayed using m_ttpLabel.
//vwenv.Props = m_ttpLabel;
vwenv.OpenTableCell(1, 1);
vwenv.set_IntProperty((int)FwTextPropType.ktptEditable, (int)FwTextPropVar.ktpvEnum,
(int)TptEditable.ktptNotEditable);
vwenv.AddString(tssLabel);
vwenv.CloseTableCell();
// Second cell has the string contents for the alternative.
// DN version has some property setting, including trailing margin and RTL.
if (m_fRtlScript)
{
vwenv.set_IntProperty((int) FwTextPropType.ktptRightToLeft,
(int) FwTextPropVar.ktpvEnum,
(int) FwTextToggleVal.kttvForceOn);
vwenv.set_IntProperty((int) FwTextPropType.ktptAlign,
(int) FwTextPropVar.ktpvEnum,
(int) FwTextAlign.ktalTrailing);
}
//if (!m_editable)
//{
// vwenv.set_IntProperty((int)FwTextPropType.ktptEditable, (int)FwTextPropVar.ktpvEnum,
// (int)TptEditable.ktptNotEditable);
//}
vwenv.set_IntProperty((int) FwTextPropType.ktptPadTop, (int) FwTextPropVar.ktpvMilliPoint, 2000);
vwenv.OpenTableCell(1, 1);
vwenv.AddStringProp(m_flid, this);
vwenv.CloseTableCell();
vwenv.CloseTableRow();
vwenv.CloseTableBody();
vwenv.CloseTable();
}
示例9: PrintColumnGroupHeaders
private void PrintColumnGroupHeaders(int hvo, IVwEnv vwenv)
{
MakeTableAndRowWithStdWidths(vwenv, hvo, true);
MakeCellsMethod.OpenRowNumberCell(vwenv); // header for row numbers
vwenv.AddString(m_cache.MakeAnalysisTss("#"));
vwenv.CloseTableCell();
vwenv.AddObjProp((int)DsConstChart.DsChartTags.kflidTemplate, this, kfragTemplateHeader);
MakeCellsMethod.OpenStandardCell(vwenv, 1, false);
vwenv.AddString(m_cache.MakeAnalysisTss(DiscourseStrings.ksNotesColumnHeader));
vwenv.CloseTableCell();
vwenv.CloseTableRow();
vwenv.CloseTable();
}
示例10: Display
//.........这里部分代码省略.........
vwenv.CloseTableCell();
// RHS cell
vwenv.Props = m_ctxtProps;
vwenv.set_IntProperty((int)FwTextPropType.ktptPadTop, (int)FwTextPropVar.ktpvMilliPoint, ctxtPadding);
vwenv.OpenTableCell(1, 1);
vwenv.OpenParagraph();
if (m_rhs.StrucChangeOS.Count > 0)
{
vwenv.AddObjVecItems(PhSegRuleRHSTags.kflidStrucChange, this, kfragContext);
}
else
{
vwenv.NoteDependency(new[] {hvo}, new[] {PhSegRuleRHSTags.kflidStrucChange}, 1);
OpenSingleLinePile(vwenv, maxNumLines, false);
vwenv.Props = m_bracketProps;
vwenv.AddProp(PhSegRuleRHSTags.kflidStrucChange, this, kfragEmpty);
CloseSingleLinePile(vwenv, false);
}
vwenv.CloseParagraph();
vwenv.CloseTableCell();
// slash cell
vwenv.Props = m_charProps;
vwenv.set_IntProperty((int)FwTextPropType.ktptOffset, (int)FwTextPropVar.ktpvMilliPoint, -charOffset);
vwenv.OpenTableCell(1, 1);
vwenv.AddString(m_slash);
vwenv.CloseTableCell();
// left context cell
vwenv.Props = m_ctxtProps;
vwenv.set_IntProperty((int)FwTextPropType.ktptPadTop, (int)FwTextPropVar.ktpvMilliPoint, ctxtPadding);
vwenv.OpenTableCell(1, 1);
vwenv.OpenParagraph();
if (m_rhs.LeftContextOA != null)
{
vwenv.AddObjProp(PhSegRuleRHSTags.kflidLeftContext, this, kfragContext);
}
else
{
vwenv.NoteDependency(new[] { hvo }, new[] { PhSegRuleRHSTags.kflidLeftContext }, 1);
OpenSingleLinePile(vwenv, maxNumLines, false);
vwenv.Props = m_bracketProps;
vwenv.AddProp(PhSegRuleRHSTags.kflidLeftContext, this, kfragEmpty);
CloseSingleLinePile(vwenv, false);
}
vwenv.CloseParagraph();
vwenv.CloseTableCell();
// underscore cell
vwenv.Props = m_charProps;
vwenv.set_IntProperty((int)FwTextPropType.ktptOffset, (int)FwTextPropVar.ktpvMilliPoint, -charOffset);
vwenv.OpenTableCell(1, 1);
vwenv.AddString(m_underscore);
vwenv.CloseTableCell();
// right context cell
vwenv.Props = m_ctxtProps;
vwenv.set_IntProperty((int)FwTextPropType.ktptPadTop, (int)FwTextPropVar.ktpvMilliPoint, ctxtPadding);
vwenv.OpenTableCell(1, 1);
vwenv.OpenParagraph();
if (m_rhs.RightContextOA != null)
{
vwenv.AddObjProp(PhSegRuleRHSTags.kflidRightContext, this, kfragContext);
}
else
{
vwenv.NoteDependency(new[] { hvo }, new[] { PhSegRuleRHSTags.kflidRightContext }, 1);
OpenSingleLinePile(vwenv, maxNumLines, false);
vwenv.Props = m_bracketProps;
vwenv.AddProp(PhSegRuleRHSTags.kflidRightContext, this, kfragEmpty);
CloseSingleLinePile(vwenv, false);
}
vwenv.CloseParagraph();
vwenv.CloseTableCell();
vwenv.CloseTableRow();
vwenv.CloseTableBody();
vwenv.CloseTable();
break;
case kfragRule:
if (m_rhs.OwningRule.StrucDescOS.Count > 0)
{
vwenv.AddObjVecItems(PhSegmentRuleTags.kflidStrucDesc, this, kfragContext);
}
else
{
OpenSingleLinePile(vwenv, GetMaxNumLines(), false);
vwenv.Props = m_bracketProps;
vwenv.AddProp(PhSegmentRuleTags.kflidStrucDesc, this, kfragEmpty);
CloseSingleLinePile(vwenv, false);
}
break;
default:
base.Display(vwenv, hvo, frag);
break;
}
}
示例11: PrintIndividualColumnHeaders
private void PrintIndividualColumnHeaders(int hvo, IVwEnv vwenv)
{
MakeTableAndRowWithStdWidths(vwenv, hvo, true);
MakeCellsMethod.OpenRowNumberCell(vwenv); // blank cell under header for row numbers
vwenv.CloseTableCell();
for (int icol = 0; icol < m_chart.AllColumns.Length; icol++ )
{
MakeCellsMethod.OpenStandardCell(vwenv, 1, m_chart.Logic.GroupEndIndices.Contains(icol));
vwenv.AddString(m_cache.MakeAnalysisTss(m_chart.Logic.GetColumnLabel(icol)));
vwenv.CloseTableCell();
}
MakeCellsMethod.OpenStandardCell(vwenv, 1, false); // blank cell below Notes header
vwenv.CloseTableCell();
vwenv.CloseTableRow();
vwenv.CloseTable();
}
示例12: Display
public override void Display(IVwEnv vwenv, int hvo, int frag)
{
switch (frag)
{
case kfragPrintChart: // the whole chart with headings for printing.
if (hvo == 0)
return;
PrintColumnGroupHeaders(hvo, vwenv);
PrintIndividualColumnHeaders(hvo, vwenv);
// Rest is same as kfragChart
DisplayChartBody(vwenv);
break;
case kfragTemplateHeader: // Display the template as group headers.
vwenv.AddObjVecItems((int)CmPossibility.CmPossibilityTags.kflidSubPossibilities, this, kfragColumnGroupHeader);
break;
// This is only used for printing, the headers in the screen version are a separate control.
case kfragColumnGroupHeader:
int ccols = vwenv.DataAccess.get_VecSize(hvo, (int)CmPossibility.CmPossibilityTags.kflidSubPossibilities);
// If there are no subitems, we still want a blank cell as a placeholder.
MakeCellsMethod.OpenStandardCell(vwenv, Math.Max(ccols, 1), true);
if (ccols > 0)
{
// It's a group, include its name
vwenv.set_IntProperty((int)FwTextPropType.ktptAlign, (int)FwTextPropVar.ktpvEnum,
(int)FwTextAlign.ktalCenter);
vwenv.OpenParagraph();
vwenv.AddString(CmPossibility.BestAnalysisName(m_cache, hvo));
vwenv.CloseParagraph();
}
vwenv.CloseTableCell();
break;
case kfragChart: // the whole chart, a DsConstChart.
if (hvo == 0)
return;
DisplayChartBody(vwenv);
break;
case kfragChartRow: // one row, a CmIndirectAnnotation
{
MakeTableAndRowWithStdWidths(vwenv, hvo, false);
MakeCells(vwenv, hvo);
vwenv.CloseTableRow();
vwenv.CloseTable();
}
break;
case kfragCca: // a single group of words, the contents of one cell.
if (ConstituentChartLogic.IsWficGroup(m_cache, hvo))
vwenv.AddObjVec(kflidAppliesTo, this, kfragBundleVec);
else
{
// it's a moved text or missing-item placeholder.
int hvoClause;
if (m_chart.Logic.IsClausePlaceholder(hvo, out hvoClause))
DisplayClausePlaceholder(vwenv, hvoClause);
else if (vwenv.DataAccess.get_VecSize(hvo, kflidAppliesTo) == 0)
DisplayMissingMarker(vwenv);
else
DisplayMovedTextTag(hvo, vwenv);
}
break;
case kfragCcaMoved: // a single group of words, the contents of one cell, which is considered moved-within-line.
// can't be a placeholder.
string formatTag = m_chart.Logic.MovedTextTag(hvo);
ApplyFormatting(vwenv, formatTag);
vwenv.OpenSpan();
InsertOpenBracket(vwenv, formatTag);
vwenv.AddObjVec(kflidAppliesTo, this, kfragBundleVec);
InsertCloseBracket(vwenv, formatTag);
vwenv.CloseSpan();
break;
case kfragCcaListItem: // a single CCA, referring to a list item.
// can't be a placeholder.
ApplyFormatting(vwenv, "marker");
vwenv.OpenSpan();
InsertOpenBracket(vwenv, "marker");
vwenv.AddObjProp((int)CmBaseAnnotation.CmBaseAnnotationTags.kflidBeginObject,
this, kfragPossibility);
InsertCloseBracket(vwenv, "marker");
vwenv.CloseSpan();
break;
case kfragPossibility: // A CmPossibility, show it's abbreviation
int flid = (int)CmPossibility.CmPossibilityTags.kflidAbbreviation;
int retWs;
m_cache.LangProject.GetMagicStringAlt(LangProject.kwsFirstAnal, hvo, flid, false, out retWs);
// If we didn't find an abbreviation try for the name
ITsString tss = null;
if (retWs != 0)
tss = m_cache.GetMultiStringAlt(hvo, flid, retWs);
if (tss == null || string.IsNullOrEmpty(tss.Text))
{
flid = (int)CmPossibility.CmPossibilityTags.kflidName;
m_cache.LangProject.GetMagicStringAlt(LangProject.kwsFirstAnal, hvo, flid, false, out retWs);
}
// Unless we didn't get anything, go ahead and insert the best option we found.
if (retWs != 0)
vwenv.AddStringAltMember(flid, retWs, this);
// retWS was m_cache.DefaultAnalWs, this fixes LT-7838
break;
case kfragBundle: // One annotated word bundle; hvo is CmBaseAnnotation. Overrides behavior of InterlinVc
//.........这里部分代码省略.........
示例13: Display
public override void Display(IVwEnv vwenv, int hvo, int frag)
{
switch (frag)
{
case kfragPrintChart: // the whole chart with headings for printing.
if (hvo == 0)
return;
PrintColumnGroupHeaders(hvo, vwenv);
PrintIndividualColumnHeaders(hvo, vwenv);
// Rest is same as kfragChart
DisplayChartBody(vwenv);
break;
case kfragTemplateHeader: // Display the template as group headers.
vwenv.AddObjVecItems(CmPossibilityTags.kflidSubPossibilities, this, kfragColumnGroupHeader);
break;
// This is only used for printing, the headers in the screen version are a separate control.
case kfragColumnGroupHeader:
var ccols = vwenv.DataAccess.get_VecSize(hvo, CmPossibilityTags.kflidSubPossibilities);
// If there are no subitems, we still want a blank cell as a placeholder.
MakeCellsMethod.OpenStandardCell(vwenv, Math.Max(ccols, 1), true);
if (ccols > 0)
{
// It's a group, include its name
var possGroup = m_cache.ServiceLocator.GetInstance<ICmPossibilityRepository>().GetObject(hvo);
vwenv.set_IntProperty((int) FwTextPropType.ktptAlign, (int) FwTextPropVar.ktpvEnum,
(int) FwTextAlign.ktalCenter);
vwenv.OpenParagraph();
vwenv.AddString(possGroup.Name.BestAnalysisAlternative);
vwenv.CloseParagraph();
}
vwenv.CloseTableCell();
break;
case kfragChart: // the whole chart, a DsConstChart.
if (hvo == 0)
return;
DisplayChartBody(vwenv);
break;
case kfragChartRow: // one row, a ConstChartRow
{
MakeTableAndRowWithStdWidths(vwenv, hvo, false);
MakeCells(vwenv, hvo);
vwenv.CloseTableRow();
vwenv.CloseTable();
}
break;
case kfragCellPart: // a single group of words, the contents of one cell.
if (m_chart.Logic.IsWordGroup(hvo))
DisplayWordforms(vwenv, hvo);
else
{
// it's a moved text or clause reference placeholder.
int hvoClause;
if (m_chart.Logic.IsClausePlaceholder(hvo, out hvoClause))
DisplayClausePlaceholder(vwenv, hvoClause);
else
DisplayMovedTextTag(hvo, vwenv);
}
break;
case kfragMovedTextCellPart: // a single group of words (ConstChartWordGroup),
// the contents of one cell, which is considered moved-within-line.
// Can't be a placeholder.
var formatTag = m_chart.Logic.MovedTextTag(hvo);
ApplyFormatting(vwenv, formatTag);
vwenv.OpenSpan();
InsertOpenBracket(vwenv, formatTag);
DisplayWordforms(vwenv, hvo);
InsertCloseBracket(vwenv, formatTag);
vwenv.CloseSpan();
break;
case kfragChartListItem: // a single ConstChartTag, referring to a list item.
// can't be a placeholder.
ApplyFormatting(vwenv, "marker");
vwenv.OpenSpan();
InsertOpenBracket(vwenv, "marker");
vwenv.AddObjProp(ConstChartTagTags.kflidTag, this, kfragPossibility);
InsertCloseBracket(vwenv, "marker");
vwenv.CloseSpan();
break;
case kfragPossibility: // A CmPossibility, show it's abbreviation
var flid = CmPossibilityTags.kflidAbbreviation;
var retWs = WritingSystemServices.ActualWs(m_cache, WritingSystemServices.kwsFirstAnal, hvo, flid);
if (retWs == 0)
{
// No Abbreviation! Switch to Name
flid = CmPossibilityTags.kflidName;
retWs = WritingSystemServices.ActualWs(m_cache, WritingSystemServices.kwsFirstAnal, hvo, flid);
}
// Unless we didn't get anything, go ahead and insert the best option we found.
if (retWs != 0)
vwenv.AddStringAltMember(flid, retWs, this);
break;
case kfragBundle: // One annotated word bundle; hvo is IAnalysis object. Overrides behavior of InterlinVc
AddWordBundleInternal(hvo, vwenv);
break;
case kfragNotesString: // notes text
vwenv.AddStringProp(ConstChartRowTags.kflidNotes, this);
break;
case kfragComment: // hvo is a ConstChartRow
//.........这里部分代码省略.........
示例14: Display
public override void Display(IVwEnv vwenv, int hvo, int frag)
{
switch (frag)
{
case kfragRule:
m_rule = m_cache.ServiceLocator.GetInstance<IPhMetathesisRuleRepository>().GetObject(hvo);
if (m_rule.Disabled)
{
vwenv.set_StringProperty((int)FwTextPropType.ktptNamedStyle, "Disabled Text");
}
int maxNumLines = GetMaxNumLines();
VwLength tableLen;
tableLen.nVal = 10000;
tableLen.unit = VwUnit.kunPercent100;
vwenv.OpenTable(5, tableLen, 0, VwAlignment.kvaCenter, VwFramePosition.kvfpVoid, VwRule.kvrlNone, 0, 4000, false);
VwLength ctxtLen;
ctxtLen.nVal = 1;
ctxtLen.unit = VwUnit.kunRelative;
int resultx, inputx, dmpy;
vwenv.get_StringWidth(m_resultStr, m_colHeaderProps, out resultx, out dmpy);
vwenv.get_StringWidth(m_inputStr, m_colHeaderProps, out inputx, out dmpy);
VwLength headerLen;
headerLen.nVal = Math.Max(resultx, inputx) + 8000;
headerLen.unit = VwUnit.kunPoint1000;
vwenv.MakeColumns(1, headerLen);
vwenv.MakeColumns(4, ctxtLen);
vwenv.OpenTableBody();
vwenv.OpenTableRow();
vwenv.OpenTableCell(1, 1);
vwenv.CloseTableCell();
// left context header cell
vwenv.Props = m_colHeaderProps;
vwenv.set_IntProperty((int)FwTextPropType.ktptBorderTop, (int)FwTextPropVar.ktpvMilliPoint, 1000);
vwenv.set_IntProperty((int)FwTextPropType.ktptBorderLeading, (int)FwTextPropVar.ktpvMilliPoint, 1000);
vwenv.OpenTableCell(1, 1);
vwenv.AddString(m_leftEnvStr);
vwenv.CloseTableCell();
// switch header cell
vwenv.Props = m_colHeaderProps;
vwenv.set_IntProperty((int)FwTextPropType.ktptBorderTop, (int)FwTextPropVar.ktpvMilliPoint, 2000);
vwenv.set_IntProperty((int)FwTextPropType.ktptBorderLeading, (int)FwTextPropVar.ktpvMilliPoint, 2000);
vwenv.set_IntProperty((int)FwTextPropType.ktptBorderTrailing, (int)FwTextPropVar.ktpvMilliPoint, 2000);
vwenv.OpenTableCell(1, 2);
vwenv.AddString(m_switchStr);
vwenv.CloseTableCell();
// right context header cell
vwenv.Props = m_colHeaderProps;
vwenv.set_IntProperty((int)FwTextPropType.ktptBorderTop, (int)FwTextPropVar.ktpvMilliPoint, 1000);
vwenv.set_IntProperty((int)FwTextPropType.ktptBorderTrailing, (int)FwTextPropVar.ktpvMilliPoint, 1000);
vwenv.OpenTableCell(1, 1);
vwenv.AddString(m_rightEnvStr);
vwenv.CloseTableCell();
vwenv.CloseTableRow();
vwenv.OpenTableRow();
// input header cell
vwenv.Props = m_rowHeaderProps;
vwenv.OpenTableCell(1, 1);
vwenv.AddString(m_inputStr);
vwenv.CloseTableCell();
// input left context cell
vwenv.Props = m_inputCtxtProps;
vwenv.set_IntProperty((int)FwTextPropType.ktptBorderTop, (int)FwTextPropVar.ktpvMilliPoint, 1000);
vwenv.set_IntProperty((int)FwTextPropType.ktptBorderLeading, (int)FwTextPropVar.ktpvMilliPoint, 1000);
vwenv.set_IntProperty((int)FwTextPropType.ktptBorderBottom, (int)FwTextPropVar.ktpvMilliPoint, 1000);
vwenv.OpenTableCell(1, 1);
vwenv.OpenParagraph();
if (m_rule.LeftEnvIndex == -1)
{
OpenSingleLinePile(vwenv, maxNumLines, false);
vwenv.Props = m_bracketProps;
vwenv.AddProp(ktagLeftEnv, this, kfragEmpty);
CloseSingleLinePile(vwenv, false);
}
else
{
for (int i = 0; i < m_rule.LeftEnvLimit; i++)
vwenv.AddObj(m_rule.StrucDescOS[i].Hvo, this, kfragContext);
}
vwenv.CloseParagraph();
vwenv.CloseTableCell();
// input left switch cell
vwenv.Props = m_inputCtxtProps;
vwenv.set_IntProperty((int)FwTextPropType.ktptBorderTop, (int)FwTextPropVar.ktpvMilliPoint, 1000);
vwenv.set_IntProperty((int)FwTextPropType.ktptBorderLeading, (int)FwTextPropVar.ktpvMilliPoint, 2000);
//.........这里部分代码省略.........
示例15: Display
//.........这里部分代码省略.........
// Set qtss to a string representing the writing system.
vwenv.get_StringWidth(NameOfWs(i), m_ttpLabel, out dxs, out dys);
m_mDxmpLabelWidth = Math.Max(m_mDxmpLabelWidth, dxs);
}
VwLength vlColWs; // 5-pt space plus max label width.
vlColWs.nVal = m_mDxmpLabelWidth + 5000;
vlColWs.unit = VwUnit.kunPoint1000;
// Enhance JohnT: possibly allow for right-to-left UI by reversing columns?
// The Main column is relative and uses the rest of the space.
VwLength vlColMain;
vlColMain.nVal = 1;
vlColMain.unit = VwUnit.kunRelative;
vwenv.OpenTable(2, // Two columns.
vlTable, // Table uses 100% of available width.
0, // Border thickness.
VwAlignment.kvaLeft, // Default alignment.
VwFramePosition.kvfpVoid, // No border.
VwRule.kvrlNone, // No rules between cells.
0, // No forced space between cells.
0, // No padding inside cells.
false);
// Specify column widths. The first argument is the number of columns,
// not a column index. The writing system column only occurs at all if its
// width is non-zero.
vwenv.MakeColumns(1, vlColWs);
vwenv.MakeColumns(1, vlColMain);
vwenv.OpenTableBody();
var visibleWss = new Set<ILgWritingSystem>();
// if we passed in a view and have WritingSystemsToDisplay
// then we'll load that list in order to filter our larger m_rgws list.
AddViewWritingSystems(visibleWss);
for (int i = 0; i < m_rgws.Count; ++i)
{
if (SkipEmptyWritingSystem(visibleWss, i, hvo))
continue;
vwenv.OpenTableRow();
// First cell has writing system abbreviation displayed using m_ttpLabel.
vwenv.Props = m_ttpLabel;
vwenv.OpenTableCell(1,1);
vwenv.AddString(NameOfWs(i));
vwenv.CloseTableCell();
// Second cell has the string contents for the alternative.
// DN version has some property setting, including trailing margin and
// RTL.
if (m_rgws[i].RightToLeftScript)
{
vwenv.set_IntProperty((int)FwTextPropType.ktptRightToLeft,
(int)FwTextPropVar.ktpvEnum,
(int)FwTextToggleVal.kttvForceOn);
vwenv.set_IntProperty((int)FwTextPropType.ktptAlign,
(int)FwTextPropVar.ktpvEnum,
(int)FwTextAlign.ktalTrailing);
}
if (!m_editable)
{
vwenv.set_IntProperty((int)FwTextPropType.ktptEditable, (int)FwTextPropVar.ktpvEnum,
(int)TptEditable.ktptNotEditable);
}
vwenv.set_IntProperty((int)FwTextPropType.ktptPadTop, (int)FwTextPropVar.ktpvMilliPoint, 2000);
vwenv.OpenTableCell(1,1);
var wsdef = m_rgws[i] as WritingSystemDefinition;
if (wsdef != null && wsdef.IsVoice)
{
// We embed it in a conc paragraph to ensure it never takes more than a line.
// It will typically be covered up by a sound control.
// Also set foreground color to match the window, so nothing shows even if the sound doesn't overlap it perfectly.
// (transparent does not seem to work as a foreground color)
vwenv.set_IntProperty((int)FwTextPropType.ktptForeColor, (int)FwTextPropVar.ktpvDefault,
(int)ColorUtil.ConvertColorToBGR(Color.FromKnownColor(KnownColor.Window)));
// Must not spell-check a conc para, leads to layout failures when the paragraph tries to cast the source to
// a conc text source, if it is overridden by a spelling text source.
vwenv.set_IntProperty((int)FwTextPropType.ktptSpellCheck, (int)FwTextPropVar.ktpvEnum, (int)SpellingModes.ksmDoNotCheck);
vwenv.OpenConcPara(0, 1, VwConcParaOpts.kcpoDefault, 0);
vwenv.AddStringAltMember(m_flid, m_rgws[i].Handle, this);
vwenv.CloseParagraph();
}
else
{
if (!string.IsNullOrEmpty(TextStyle))
{
vwenv.set_StringProperty((int) FwTextPropType.ktptNamedStyle, TextStyle);
}
vwenv.AddStringAltMember(m_flid, m_rgws[i].Handle, this);
}
vwenv.CloseTableCell();
vwenv.CloseTableRow();
}
vwenv.CloseTableBody();
vwenv.CloseTable();
}