C# Class SIL.FieldWorks.Discourse.ConstituentChart

A constituent chart is used to organize words (and perhaps eventally somehow morphemes) into a table where rows roughtly correspond to clauses and columns to key parts of a clause. A typical chart has two pre-nuclear columns, three or four nuclear ones (SVO and perhaps indirect object) and one or two post-nuclear ones. Currently the constituent chart is displayed as a tab in the interlinear window. It is created by reflection because it needs to refer to the interlinear assembly (in order to display words in interlinear mode), so the interlinear assembly can't know about this one.
Inheritance: System.Windows.Forms.UserControl, IxCoreColleague
显示文件 Open project: sillsdev/FieldWorks Class Usage Examples

Private Properties

Property Type Description
BuildBottomStuffUI void
BuildTopStuffUI void
BuildUIComponents void
ColWidthId string
ComputeButtonWidths void
ConstituentChart System
CreateChartInNonUndoableUOW void
DetectAndReportTemplateProblem void
DisposeContextMenu void
EnableAllMoveHereButtons void
EnsureDpiX void
FindAndCleanUpMyChart void
GetAncestorBookmark SIL.FieldWorks.IText.InterAreaBookmark
GetAndScrollToBookmark void
GetBtnName string
GetColumnOfButton int
GetColumnWidths void
GetLineChoice void
GetLineChoices SIL.FieldWorks.IText.InterlinLineChoices
GetTextParagraphByIndex IStTxtPara
InitializeComponent void
MaxUseableWidth int
MpToPixelX int
PersistColumnWidths void
PixelToMpX int
PrepareForChOrphInsert void
RestoreColumnWidths bool
ScrollToEndOfChart void
SetDefaultColumnWidths void
SetDefaultColumnWidthsRtL void
SetEligibleButtons void
SetupMoveHereButtonsToMatchTemplate void
btnContextMenu_Click void
btnMoveHere_Click void
contextMenuStrip_Closed void
m_buttonRow_Layout void
m_headerMainCols_ColumnAutoResize void
m_headerMainCols_ColumnWidthChanged void
m_headerMainCols_ColumnWidthChanging void
m_headerMainCols_Layout void
m_headerMainCols_SizeChanged void
m_logic_Ribbon_Changed void

Public Methods

Method Description
ConstituentChart ( SIL.FieldWorks.FDO.FdoCache cache ) : System

Make one. Usually called by reflection.

GetMessageTargets ( ) : IxCoreColleague[]

Get things that would like to receive commands. The main chart would like to receive Print and Edit commands.

GetUnchartedWordForBookmark ( ) : AnalysisOccurrence

This public method enables call by reflection from InterlinMaster of internal Logic method that retrieves a 'bookmarkable' Wordform from the Ribbon.

Init ( XCore.Mediator mediator, System configurationParameters ) : void

Basic initialization.

OnDisplayExportDiscourse ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool

If this control is a colleague, export Discourse should be available.

OnDisplayRepeatLastMoveLeft ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool

Enable the command and make visible when relevant

OnDisplayRepeatLastMoveRight ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool

Enable the command and make visible when relevant

OnExportDiscourse ( object argument ) : bool

Implement export of discourse material.

OnRepeatLastMoveLeft ( object args ) : bool

Implements repeat move left.

OnRepeatLastMoveRight ( object args ) : bool

Implements repeat move right.

SelectBookmark ( IStTextBookmark bookmark ) : void

This public version enables call by reflection from InterlinMaster of the internal CCBody method that selects (and scrolls to) the bookmarked location in the constituent chart.

SelectOccurrence ( AnalysisOccurrence point ) : void
SetRoot ( int hvo ) : void

Set the root object.

Protected Methods

Method Description
DisableAllContextButtons ( ) : void

Shuts off all the little down-arrow buttons next to the MoveHere buttons. For use when the next input is a ChOrph.

Dispose ( bool disposing ) : void

Clean up any resources being used.

EnableAllContextButtons ( ) : void

Turns back on all the little down-arrow buttons next to the MoveHere buttons. For use when the next input is no longer a ChOrph.

GetWidth ( string text, Font fnt ) : int
OnGotFocus ( EventArgs e ) : void
OnLoad ( EventArgs e ) : void
OnSizeChanged ( EventArgs e ) : void
SetHeaderColAndButtonWidths ( ) : void

Private Methods

Method Description
BuildBottomStuffUI ( ) : void
BuildTopStuffUI ( ) : void
BuildUIComponents ( ) : void
ColWidthId ( ) : string
ComputeButtonWidths ( ) : void
ConstituentChart ( SIL.FieldWorks.FDO.FdoCache cache, ConstituentChartLogic logic ) : System

Make one. This variant is used in testing (to plug in a known logic class).

CreateChartInNonUndoableUOW ( ) : void
DetectAndReportTemplateProblem ( ) : void
DisposeContextMenu ( object sender, EventArgs e ) : void
EnableAllMoveHereButtons ( ) : void
EnsureDpiX ( ) : void
FindAndCleanUpMyChart ( int hvoStText ) : void
GetAncestorBookmark ( Control curLevelControl, IStText basedOnRa ) : InterAreaBookmark
GetAndScrollToBookmark ( ) : void

Try to get the bookmark from InterlinMaster, if there are rows in the chart.

GetBtnName ( string strName, int pxUseable ) : string

Figure out what substring of the column name to put on the button.

GetColumnOfButton ( Button btn ) : int
GetColumnWidths ( ) : void
GetLineChoice ( SIL.FieldWorks.IText.InterlinLineChoices dest, SIL.FieldWorks.IText.InterlinLineChoices source, int flid ) : void

Make sure there is SOME lineChoice for the specified flid in m_lineChoices. If lineChoices is non-null and contains one for the right flid, choose the first.

GetLineChoices ( ) : SIL.FieldWorks.IText.InterlinLineChoices
GetTextParagraphByIndex ( int iPara ) : IStTxtPara
InitializeComponent ( ) : void

Required method for Designer support - do not modify the contents of this method with the code editor.

MaxUseableWidth ( ) : int
MpToPixelX ( int dxmp ) : int
PersistColumnWidths ( ) : void

Save the current column widths in the mediator's property table.

PixelToMpX ( int dx ) : int
PrepareForChOrphInsert ( int iPara, int offset ) : void

Main Chart part of preparation. Calls Chart Logic part. Scroll to ChartOrphan, highlight cell insert possibilities, disable ineligible MoveHere buttons

RestoreColumnWidths ( ) : bool

Restore column widths if any are persisted for this chart

ScrollToEndOfChart ( ) : void
SetDefaultColumnWidths ( ) : void
SetDefaultColumnWidthsRtL ( ) : void
SetEligibleButtons ( bool goodColumns ) : void

Disable all MoveHere buttons whose column corresponds to a false entry in the parameter bool array.

SetupMoveHereButtonsToMatchTemplate ( ) : void

Sets up Move Here buttons and also determines ChOrph status by raising Ribbon Changed event.

btnContextMenu_Click ( object sender, EventArgs e ) : void

Handles clicking of the down arrow button beside a column button.

btnMoveHere_Click ( object sender, EventArgs e ) : void
contextMenuStrip_Closed ( object sender, System.Windows.Forms.ToolStripDropDownClosedEventArgs e ) : void
m_buttonRow_Layout ( object sender, System.Windows.Forms.LayoutEventArgs e ) : void

Temporary layout thing until we make it align properly with the chart.

m_headerMainCols_ColumnAutoResize ( int icolChanged ) : void
m_headerMainCols_ColumnWidthChanged ( object sender, System.Windows.Forms.ColumnWidthChangedEventArgs e ) : void
m_headerMainCols_ColumnWidthChanging ( object sender, System.Windows.Forms.ColumnWidthChangingEventArgs e ) : void
m_headerMainCols_Layout ( object sender, System.Windows.Forms.LayoutEventArgs e ) : void
m_headerMainCols_SizeChanged ( object sender, EventArgs e ) : void
m_logic_Ribbon_Changed ( object sender, EventArgs e ) : void

Method Details

ConstituentChart() public method

Make one. Usually called by reflection.
public ConstituentChart ( SIL.FieldWorks.FDO.FdoCache cache ) : System
cache SIL.FieldWorks.FDO.FdoCache
return System

DisableAllContextButtons() protected method

Shuts off all the little down-arrow buttons next to the MoveHere buttons. For use when the next input is a ChOrph.
protected DisableAllContextButtons ( ) : void
return void

Dispose() protected method

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool true if managed resources should be disposed; otherwise, false.
return void

EnableAllContextButtons() protected method

Turns back on all the little down-arrow buttons next to the MoveHere buttons. For use when the next input is no longer a ChOrph.
protected EnableAllContextButtons ( ) : void
return void

GetMessageTargets() public method

Get things that would like to receive commands. The main chart would like to receive Print and Edit commands.
public GetMessageTargets ( ) : IxCoreColleague[]
return IxCoreColleague[]

GetUnchartedWordForBookmark() public method

This public method enables call by reflection from InterlinMaster of internal Logic method that retrieves a 'bookmarkable' Wordform from the Ribbon.
public GetUnchartedWordForBookmark ( ) : AnalysisOccurrence
return AnalysisOccurrence

GetWidth() protected method

protected GetWidth ( string text, Font fnt ) : int
text string
fnt System.Drawing.Font
return int

Init() public method

Basic initialization.
public Init ( XCore.Mediator mediator, System configurationParameters ) : void
mediator XCore.Mediator
configurationParameters System
return void

OnDisplayExportDiscourse() public method

If this control is a colleague, export Discourse should be available.
public OnDisplayExportDiscourse ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool
commandObject object
display XCore.UIItemDisplayProperties
return bool

OnDisplayRepeatLastMoveLeft() public method

Enable the command and make visible when relevant
public OnDisplayRepeatLastMoveLeft ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool
commandObject object
display XCore.UIItemDisplayProperties
return bool

OnDisplayRepeatLastMoveRight() public method

Enable the command and make visible when relevant
public OnDisplayRepeatLastMoveRight ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool
commandObject object
display XCore.UIItemDisplayProperties
return bool

OnExportDiscourse() public method

Implement export of discourse material.
public OnExportDiscourse ( object argument ) : bool
argument object
return bool

OnGotFocus() protected method

protected OnGotFocus ( EventArgs e ) : void
e System.EventArgs
return void

OnLoad() protected method

protected OnLoad ( EventArgs e ) : void
e System.EventArgs
return void

OnRepeatLastMoveLeft() public method

Implements repeat move left.
public OnRepeatLastMoveLeft ( object args ) : bool
args object
return bool

OnRepeatLastMoveRight() public method

Implements repeat move right.
public OnRepeatLastMoveRight ( object args ) : bool
args object
return bool

OnSizeChanged() protected method

protected OnSizeChanged ( EventArgs e ) : void
e System.EventArgs
return void

SelectBookmark() public method

This public version enables call by reflection from InterlinMaster of the internal CCBody method that selects (and scrolls to) the bookmarked location in the constituent chart.
public SelectBookmark ( IStTextBookmark bookmark ) : void
bookmark IStTextBookmark
return void

SelectOccurrence() public method

public SelectOccurrence ( AnalysisOccurrence point ) : void
point AnalysisOccurrence
return void

SetHeaderColAndButtonWidths() protected method

protected SetHeaderColAndButtonWidths ( ) : void
return void

SetRoot() public method

Set the root object.
public SetRoot ( int hvo ) : void
hvo int
return void