C# Class Habanero.Faces.Base.GridLayoutManager

Manages the layout of controls in a user interface by assigning them to positions in a grid with rows and columns
Inheritance: LayoutManager
Afficher le fichier Open project: Chillisoft/habanero.faces Class Usage Examples

Private Properties

Свойство Type Description
CalcColumnWidth int
CalcRowHeight int
GetFixedAmount int
GetFixedHeight int
GetFixedWidth int
GetNumVariableColumns int
GetNumVariableEntries int
GetNumVariableRows int
IsFixedColumn bool
IsFixedRow bool

Méthodes publiques

Méthode Description
AddControl ( ControlInfo controlInfo ) : IControlHabanero

Adds a control as specified by the ControlInfo provided (which can provide some context for the control) such as number of rows or columns to span.

AddControl ( IControlHabanero control ) : IControlHabanero

Adds a control with a row and column span of 1 to the next position in the grid.

AddControl ( IControlHabanero control, int rowSpan, int columnSpan ) : IControlHabanero

Adds a control to the next position in the grid. The number of rows or columns to span are specified as parameters.

FixAllRowsBasedOnContents ( ) : void

Causes the fixed height of all the rows to be determined by the current or future contents

FixColumn ( int columnNumber, int columnWidth ) : void

Fixes the width of a column to a specified size

FixColumnBasedOnContents ( int columnNumber ) : void

Fixes a specified column's width based on current or future contents

FixRow ( int rowNumber, int rowHeight ) : void

Fixes the height of a row to a specified size

FixRowBasedOnContents ( int rowNumber ) : void

Fixes a specified row's height based on current or future contents

GetFixedColumnWidth ( int columnNumber ) : int

Gets the fixed width set for a specified column. The return value will be -1 if the width has not been fixed.

GetFixedHeightIncludingGaps ( ) : int

Returns the total height of the fixed-height rows added together, including the gaps and borders

GetFixedWidthIncludingGaps ( ) : int

Returns the total width of the fixed-width columns added together, including the gaps and borders

GridLayoutManager ( IControlHabanero managedControl, IControlFactory controlFactory ) : System

Constructor to initialise a new grid layout

SetGridSize ( int rows, int cols ) : void

Sets the grid size as a number of rows and columns

Méthodes protégées

Méthode Description
RefreshControlPositions ( ) : void

Updates the positions and settings of the controls in the interface

Private Methods

Méthode Description
CalcColumnWidth ( ) : int

Calculates the average column width

CalcRowHeight ( ) : int

Calculates the average row height

GetFixedAmount ( int arr ) : int

Adds the values in the array provided, as long as the values are above -1. This method is used to add up fixed-height/width items.

GetFixedHeight ( ) : int

Returns the total height of the fixed-height rows added together

GetFixedWidth ( ) : int

Returns the total width of the fixed-width columns added together

GetNumVariableColumns ( ) : int

Counts the number of columns that have not been assigned a fixed width

GetNumVariableEntries ( int arr ) : int

Counts the number of items in the array provided that have a value of -1. This method is used to count the number of rows or columns that have not been assigned a fixed width/height

GetNumVariableRows ( ) : int

Counts the number of rows that have not been assigned a fixed height

IsFixedColumn ( int columnNumber ) : bool

Indicates whether the specified column has a fixed width

IsFixedRow ( int rowNumber ) : bool

Indicates whether the specified row has a fixed height

Method Details

AddControl() public méthode

Adds a control as specified by the ControlInfo provided (which can provide some context for the control) such as number of rows or columns to span.
public AddControl ( ControlInfo controlInfo ) : IControlHabanero
controlInfo ControlInfo The information about the control to add to the next position in the grid.
Résultat IControlHabanero

AddControl() public méthode

Adds a control with a row and column span of 1 to the next position in the grid.
public AddControl ( IControlHabanero control ) : IControlHabanero
control IControlHabanero The control to add
Résultat IControlHabanero

AddControl() public méthode

Adds a control to the next position in the grid. The number of rows or columns to span are specified as parameters.
public AddControl ( IControlHabanero control, int rowSpan, int columnSpan ) : IControlHabanero
control IControlHabanero The control to add
rowSpan int The row span for the control
columnSpan int The column span for the control
Résultat IControlHabanero

FixAllRowsBasedOnContents() public méthode

Causes the fixed height of all the rows to be determined by the current or future contents
public FixAllRowsBasedOnContents ( ) : void
Résultat void

FixColumn() public méthode

Fixes the width of a column to a specified size
public FixColumn ( int columnNumber, int columnWidth ) : void
columnNumber int The column in question
columnWidth int The width to fix the column at
Résultat void

FixColumnBasedOnContents() public méthode

Fixes a specified column's width based on current or future contents
public FixColumnBasedOnContents ( int columnNumber ) : void
columnNumber int The column in question
Résultat void

FixRow() public méthode

Fixes the height of a row to a specified size
public FixRow ( int rowNumber, int rowHeight ) : void
rowNumber int The row in question
rowHeight int The height to fix the row at
Résultat void

FixRowBasedOnContents() public méthode

Fixes a specified row's height based on current or future contents
public FixRowBasedOnContents ( int rowNumber ) : void
rowNumber int The row in question
Résultat void

GetFixedColumnWidth() public méthode

Gets the fixed width set for a specified column. The return value will be -1 if the width has not been fixed.
public GetFixedColumnWidth ( int columnNumber ) : int
columnNumber int The column in question
Résultat int

GetFixedHeightIncludingGaps() public méthode

Returns the total height of the fixed-height rows added together, including the gaps and borders
public GetFixedHeightIncludingGaps ( ) : int
Résultat int

GetFixedWidthIncludingGaps() public méthode

Returns the total width of the fixed-width columns added together, including the gaps and borders
public GetFixedWidthIncludingGaps ( ) : int
Résultat int

GridLayoutManager() public méthode

Constructor to initialise a new grid layout
public GridLayoutManager ( IControlHabanero managedControl, IControlFactory controlFactory ) : System
managedControl IControlHabanero The control to manage
controlFactory IControlFactory The control factory used to create any controls
Résultat System

RefreshControlPositions() protected méthode

Updates the positions and settings of the controls in the interface
protected RefreshControlPositions ( ) : void
Résultat void

SetGridSize() public méthode

Sets the grid size as a number of rows and columns
public SetGridSize ( int rows, int cols ) : void
rows int The number of rows
cols int The number of columns
Résultat void