C# Class Habanero.UI.Base.FlowLayoutManager

Manages the layout of controls in a user interface by adding components in the manner of a horizontal text line that wraps to the next line.
Inheritance: LayoutManager
ファイルを表示 Open project: Chillisoft/habanero.faces

Public Methods

Method Description
AddControl ( IChilliControl ctl ) : IChilliControl

Adds a control to the layout

AddGlue ( ) : void

Adds glue that connects two controls together. For example, if you've just added a label and want to ensure the textbox you're adding next is always next to the label, add glue between adding the label and adding the textbox. In this way, if you resize the control such that the textbox doesn't fit on the line, both the label and the textbox will move to the next line together. This must be called immediatly after adding the label. The next control to be added will be the control the label is glued to.

FlowLayoutManager ( IChilliControl managedControl ) : System

Constructor to initialise a new manager

NewLine ( ) : void

Inserts a new line. This is like a line break or carraige return for controls. The next control will start at the control's margin (depending on alignment).

Protected Methods

Method Description
RefreshControlPositions ( ) : void

Updates the layout and appearance of the managed controls

Private Methods

Method Description
BothControlsFitOnALine ( int i ) : bool
CalculateControlPosition ( IChilliControl ctl ) : void

Calculates the control's position in the user interface

ControlDoesNotFitOnCurrentRow ( IChilliControl ctl ) : bool

Informs if the specified control fails to fit on the current row of controls

ControlResizedHandler ( Object sender, EventArgs e ) : void

A handler called when a control has been resized

ControlVisibleChangedHandler ( Object sender, EventArgs e ) : void

A handler called when a control has had its visibility altered

GetControl ( int position ) : IChilliControl
GetPreviousControl ( int currentPos ) : IChilliControl
InitialiseNewRow ( int i, int &rowStart, IList controlsInRow ) : int
IsGluedToAnotherControl ( int pos ) : bool

Checks for glue at a position (a position being a point between two controls. See AddGlue

MoveCurrentPosToStartOfNextRow ( int currentRowHeight ) : void

Moves the current placement position to the beginning of the next row of items

PreviousControlVisible ( int i ) : bool
ResetCurrentPosToTopLeft ( ) : void
SetUpTabIndexForAlignmentRight ( int rowStart, IList controlsInRow ) : void
ShiftControlsRightForCentering ( int startControlNum, int endControlNum ) : void

Shift controls right when centred is alignment is used

TopLeftPosition ( ) : Point

Method Details

AddControl() public method

Adds a control to the layout
public AddControl ( IChilliControl ctl ) : IChilliControl
ctl IChilliControl The control to add
return IChilliControl

AddGlue() public method

Adds glue that connects two controls together. For example, if you've just added a label and want to ensure the textbox you're adding next is always next to the label, add glue between adding the label and adding the textbox. In this way, if you resize the control such that the textbox doesn't fit on the line, both the label and the textbox will move to the next line together. This must be called immediatly after adding the label. The next control to be added will be the control the label is glued to.
public AddGlue ( ) : void
return void

FlowLayoutManager() public method

Constructor to initialise a new manager
public FlowLayoutManager ( IChilliControl managedControl ) : System
managedControl IChilliControl The control to manage e.g. a Panel
return System

NewLine() public method

Inserts a new line. This is like a line break or carraige return for controls. The next control will start at the control's margin (depending on alignment).
public NewLine ( ) : void
return void

RefreshControlPositions() protected method

Updates the layout and appearance of the managed controls
protected RefreshControlPositions ( ) : void
return void