C# Class SIL.FieldWorks.TE.TeEditorialChecks.EditorialChecksGrid

EditorialChecksGrid encapsulates, primarily, behavior for the comments tooltip. For some reason, when the comments tooltip is displayed, the grid doesn't always receive mouse move (including CellMouseEnter and CellMouseLeave) events. However, the overridden WndProc method in this class, does receive the necessary mouse mouse events.
Inheritance: SIL.FieldWorks.TE.TeEditorialChecks.CheckGrid
ファイルを表示 Open project: sillsdev/FieldWorks

Protected Properties

Property Type Description
m_mouseOverCell System.Windows.Forms.DataGridViewCell
m_toolTipCell System.Windows.Forms.DataGridViewCell

Private Properties

Property Type Description
DrawMissingGlyphImage bool
HandleToolTip void
HideToolTip void
OnPaint void
m_commentToolTip_Closed void
m_commentToolTip_Opened void
m_commentToolTip_TimerTick void

Public Methods

Method Description
EditorialChecksGrid ( ) : System

Initializes a new instance of the T:EditorialChecksGrid class.

IsRowIgnoredWithAnnotation ( int iRow ) : bool

Gets a value indicating whether or not the specified row in the grid is ignored and has an annotation associated with it.

PropChanged ( int hvo, int tag, int ivMin, int cvIns, int cvDel ) : void

ResetFonts ( ) : void

Clears the cached fonts used for the details column when there detail cells whose writing system is not the default vernacular. This cache automatically gets rebuilt as needed.

ShouldDrawCornerGlyph ( int iCol, int iRow ) : bool

Returns a value indicating whether or not the specified row and column correspond to the status column in a row that has an ignored result a resolution annotation.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Releases unmanaged and - optionally - managed resources

OnCellFormatting ( System.Windows.Forms.DataGridViewCellFormattingEventArgs e ) : void

Show checking errors with a status of irrelevant in gray text. Also make sure the font of font for the details column matches the font for the writing system of the cited text that goes in the current cell of that column. Finally, if the cited text is for a characters check and the character is a non-printable character, then show the character's name in red.

OnCellMouseEnter ( System.Windows.Forms.DataGridViewCellEventArgs e ) : void

When the mouse moves over the details column and the row is for a characters check error, then show a tooltip displaying info. about the invalid character.

OnCellMouseLeave ( System.Windows.Forms.DataGridViewCellEventArgs e ) : void

When the tooltip is showing then make sure tooltips for the cell we're leaving are hidden.

OnCellPainting ( System.Windows.Forms.DataGridViewCellPaintingEventArgs e ) : void

For checking errors that have become irrelevant (e.g. the user decided that a character cited as invalid is really valid), paint them with a strike-through line. Also draw a special icon if the cell is in a characters check result row, is the cited text and the cited text is a character that does not have a corresponding glyph in its writing system font.

OnCellRightMouseUp ( System.Windows.Forms.DataGridViewCellMouseEventArgs e ) : void

If we have a toolbar menu adapter, we want to show it as a context menu.

OnCellValueNeeded ( System.Windows.Forms.DataGridViewCellValueEventArgs e ) : void

OnScroll ( ScrollEventArgs e ) : void

Update the water mark when the grid scrolls.

OnSizeChanged ( EventArgs e ) : void

Update the water mark when the grid changes size.

WndProc ( Message &m ) : void

For some reason, when the comments tooltip is displayed, the grid doesn't always receive mouse move (including CellMouseEnter and CellMouseLeave) events. Therefore, we take what we can get to determine where the mouse is when the tooltip is opened, and the only reliable message we appear to get is the WM_NCHITTEST message.

Private Methods

Method Description
DrawMissingGlyphImage ( SIL.FieldWorks.TE.TeEditorialChecks.CheckingError error, System.Windows.Forms.DataGridViewCellPaintingEventArgs e ) : bool

Determines wheter or not the contents of the details cell (specified by e.ColumnIndex) represents the cited text for a characters checking error. If so and the character does not have a glyph in the cited text's font, then just show image indicating that fact.

HandleToolTip ( ) : void

Handles the tooltip that shows the checking error comment.

HideToolTip ( ) : void

Hides the tool tip.

OnPaint ( PaintEventArgs e ) : void
m_commentToolTip_Closed ( object sender, System.Windows.Forms.ToolStripDropDownClosedEventArgs e ) : void

Handles the Closed event of the m_commentToolTip control.

m_commentToolTip_Opened ( object sender, EventArgs e ) : void

Handles the Opened event of the m_commentToolTip control.

m_commentToolTip_TimerTick ( object sender, EventArgs e ) : void

Handles the TimerTick event of the m_commentToolTip control.

Method Details

Dispose() protected method

Releases unmanaged and - optionally - managed resources
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed and unmanaged resources; /// false to release only unmanaged resources.
return void

EditorialChecksGrid() public method

Initializes a new instance of the T:EditorialChecksGrid class.
public EditorialChecksGrid ( ) : System
return System

IsRowIgnoredWithAnnotation() public method

Gets a value indicating whether or not the specified row in the grid is ignored and has an annotation associated with it.
public IsRowIgnoredWithAnnotation ( int iRow ) : bool
iRow int
return bool

OnCellFormatting() protected method

Show checking errors with a status of irrelevant in gray text. Also make sure the font of font for the details column matches the font for the writing system of the cited text that goes in the current cell of that column. Finally, if the cited text is for a characters check and the character is a non-printable character, then show the character's name in red.
protected OnCellFormatting ( System.Windows.Forms.DataGridViewCellFormattingEventArgs e ) : void
e System.Windows.Forms.DataGridViewCellFormattingEventArgs
return void

OnCellMouseEnter() protected method

When the mouse moves over the details column and the row is for a characters check error, then show a tooltip displaying info. about the invalid character.
protected OnCellMouseEnter ( System.Windows.Forms.DataGridViewCellEventArgs e ) : void
e System.Windows.Forms.DataGridViewCellEventArgs
return void

OnCellMouseLeave() protected method

When the tooltip is showing then make sure tooltips for the cell we're leaving are hidden.
protected OnCellMouseLeave ( System.Windows.Forms.DataGridViewCellEventArgs e ) : void
e System.Windows.Forms.DataGridViewCellEventArgs
return void

OnCellPainting() protected method

For checking errors that have become irrelevant (e.g. the user decided that a character cited as invalid is really valid), paint them with a strike-through line. Also draw a special icon if the cell is in a characters check result row, is the cited text and the cited text is a character that does not have a corresponding glyph in its writing system font.
protected OnCellPainting ( System.Windows.Forms.DataGridViewCellPaintingEventArgs e ) : void
e System.Windows.Forms.DataGridViewCellPaintingEventArgs
return void

OnCellRightMouseUp() protected method

If we have a toolbar menu adapter, we want to show it as a context menu.
protected OnCellRightMouseUp ( System.Windows.Forms.DataGridViewCellMouseEventArgs e ) : void
e System.Windows.Forms.DataGridViewCellMouseEventArgs
return void

OnCellValueNeeded() protected method

protected OnCellValueNeeded ( System.Windows.Forms.DataGridViewCellValueEventArgs e ) : void
e System.Windows.Forms.DataGridViewCellValueEventArgs
return void

OnScroll() protected method

Update the water mark when the grid scrolls.
protected OnScroll ( ScrollEventArgs e ) : void
e System.Windows.Forms.ScrollEventArgs
return void

OnSizeChanged() protected method

Update the water mark when the grid changes size.
protected OnSizeChanged ( EventArgs e ) : void
e System.EventArgs
return void

PropChanged() public method

public PropChanged ( int hvo, int tag, int ivMin, int cvIns, int cvDel ) : void
hvo int
tag int
ivMin int
cvIns int
cvDel int
return void

ResetFonts() public method

Clears the cached fonts used for the details column when there detail cells whose writing system is not the default vernacular. This cache automatically gets rebuilt as needed.
public ResetFonts ( ) : void
return void

ShouldDrawCornerGlyph() public method

Returns a value indicating whether or not the specified row and column correspond to the status column in a row that has an ignored result a resolution annotation.
public ShouldDrawCornerGlyph ( int iCol, int iRow ) : bool
iCol int
iRow int
return bool

WndProc() protected method

For some reason, when the comments tooltip is displayed, the grid doesn't always receive mouse move (including CellMouseEnter and CellMouseLeave) events. Therefore, we take what we can get to determine where the mouse is when the tooltip is opened, and the only reliable message we appear to get is the WM_NCHITTEST message.
protected WndProc ( Message &m ) : void
m System.Windows.Forms.Message
return void

Property Details

m_mouseOverCell protected_oe property

DataGridViewCell which currently has the mouse over it.
protected DataGridViewCell,System.Windows.Forms m_mouseOverCell
return System.Windows.Forms.DataGridViewCell

m_toolTipCell protected_oe property

DataGridViewCell which currently has the tooltip up.
protected DataGridViewCell,System.Windows.Forms m_toolTipCell
return System.Windows.Forms.DataGridViewCell