C# Class SIL.ObjectBrowser.InspectorGrid

Inheritance: System.Windows.Forms.DataGridView
Show file Open project: sillsdev/FieldWorks

Public Methods

Method Description
CalculateColor ( Color front, Color back, int alpha ) : Color

Calculates a color by applying the specified alpha value to the specified front color, assuming the color behind the front color is the specified back color. The returned color has the alpha channel set to completely opaque, but whose alpha channel value appears to be the one specified.

CreateDefaultColumns ( ) : void

Creates the default columns.

InspectorGrid ( IInspectorList list ) : System

Initializes a new instance of the InspectorGrid class.

Protected Methods

Method Description
OnCellClick ( System.Windows.Forms.DataGridViewCellEventArgs e ) : void

Raises the E:System.Windows.Forms.DataGridView.CellClick event.

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

In order to achieve double buffering without the problem that arises from having double buffering on while sizing rows and columns or dragging columns around, monitor when the mouse goes down and turn off double buffering when it goes down on a column heading or over the dividers between rows or the dividers between columns.

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

When double buffering is off, it means it was turned off in the cell mouse down event. Therefore, turn it back on.

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

Handles the CellPainting event of the dataGridView1 control.

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

Handles the CellValueNeeded event of the gridInspector control.

OnKeyDown ( KeyEventArgs e ) : void

Expand and collapse items when the right or left arrow keys are pressed.

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

Raises the E:System.Windows.Forms.DataGridView.RowEnter event.

Private Methods

Method Description
DrawBorders ( System.Windows.Forms.DataGridViewCellPaintingEventArgs e, bool isIndentedCell, Color clrFadedBottomBorder, int dxBottomBorder ) : void

Draws the borders.

DrawTreeLines ( System.Windows.Forms.DataGridViewCellPaintingEventArgs e, Rectangle rcHotSpot, int level ) : void

Draws the lines.

GetBlockRectangle ( ) : Rectangle

Gets the rectangle inside of which is the shaded block of rows.

GetExpandCollapseRect ( Rectangle rcCell, int level ) : Rectangle

Gets the expand collapse rect.

GetRowsInBlock ( int currRow, int &firstRowInBlock, int &lastRowInBlock ) : void

Gets the rows in block.

InspectorGrid ( ) : System
ProcessRowChange ( int currRow ) : void

Processes the row change.

ToggleExpand ( int irow ) : void

Toggles the expansion state of the specified row.

Method Details

CalculateColor() public static method

Calculates a color by applying the specified alpha value to the specified front color, assuming the color behind the front color is the specified back color. The returned color has the alpha channel set to completely opaque, but whose alpha channel value appears to be the one specified.
public static CalculateColor ( Color front, Color back, int alpha ) : Color
front Color
back Color
alpha int
return Color

CreateDefaultColumns() public method

Creates the default columns.
public CreateDefaultColumns ( ) : void
return void

InspectorGrid() public method

Initializes a new instance of the InspectorGrid class.
public InspectorGrid ( IInspectorList list ) : System
list IInspectorList
return System

OnCellClick() protected method

Raises the E:System.Windows.Forms.DataGridView.CellClick event.
protected OnCellClick ( System.Windows.Forms.DataGridViewCellEventArgs e ) : void
e System.Windows.Forms.DataGridViewCellEventArgs
return void

OnCellMouseDown() protected method

In order to achieve double buffering without the problem that arises from having double buffering on while sizing rows and columns or dragging columns around, monitor when the mouse goes down and turn off double buffering when it goes down on a column heading or over the dividers between rows or the dividers between columns.
protected OnCellMouseDown ( System.Windows.Forms.DataGridViewCellMouseEventArgs e ) : void
e System.Windows.Forms.DataGridViewCellMouseEventArgs
return void

OnCellMouseUp() protected method

When double buffering is off, it means it was turned off in the cell mouse down event. Therefore, turn it back on.
protected OnCellMouseUp ( System.Windows.Forms.DataGridViewCellMouseEventArgs e ) : void
e System.Windows.Forms.DataGridViewCellMouseEventArgs
return void

OnCellPainting() protected method

Handles the CellPainting event of the dataGridView1 control.
protected OnCellPainting ( System.Windows.Forms.DataGridViewCellPaintingEventArgs e ) : void
e System.Windows.Forms.DataGridViewCellPaintingEventArgs
return void

OnCellValueNeeded() protected method

Handles the CellValueNeeded event of the gridInspector control.
protected OnCellValueNeeded ( System.Windows.Forms.DataGridViewCellValueEventArgs e ) : void
e System.Windows.Forms.DataGridViewCellValueEventArgs
return void

OnKeyDown() protected method

Expand and collapse items when the right or left arrow keys are pressed.
protected OnKeyDown ( KeyEventArgs e ) : void
e System.Windows.Forms.KeyEventArgs
return void

OnRowEnter() protected method

Raises the E:System.Windows.Forms.DataGridView.RowEnter event.
protected OnRowEnter ( System.Windows.Forms.DataGridViewCellEventArgs e ) : void
e System.Windows.Forms.DataGridViewCellEventArgs
return void