C# Class SIL.FieldWorks.SharpViews.GroupBox

Base class for all boxes that have children.
Inheritance: Box
Mostra file Open project: sillsdev/FieldWorks Class Usage Examples

Public Properties

Property Type Description
NumBoxes int

Public Methods

Method Description
AddBox ( Box box ) : void

Add another box (to the end of the chain).

ChildTransformFromRootTransform ( PaintTransform rootTransform ) : PaintTransform

Given the transform currently used to draw the root, give the transform used to draw your children.

Contains ( Box other ) : bool

Return true if this box contains the other one, that is, is one of its containers. Only group boxes can contain others.

FindBoxAt ( Point where, PaintTransform ptrans, PaintTransform &leafBoxTransform ) : LeafBox

If there is a leaf box at the specified position, return it. Also return the paint transform that should be passed to operations on that box. Enhance JohnT: should probably always return something, if box contains any leaf? Where is in drawing coords.

GetSelectionAt ( Point where, IVwGraphics vg, PaintTransform ptrans ) : Selection
GroupBox ( AssembledStyles styles ) : System
InsertBox ( Box newBox, Box insertAfter ) : void

Add a child box after the specified box (one of your children).

NextInSelectionSequence ( bool includeChildren ) : Box

Answer the next box in which to draw a selection after the current one. This is basically a sequence which considers a box to be come immediately before - its first child, if it has one; - otherwise, its Next box, if any; - otherwise, the Next box of its closest ancestor that has one. Todo JohnT: eventually will be able to be constrained to the same column.

PaintBackground ( IVwGraphics vg, PaintTransform ptrans ) : void
PaintForeground ( IVwGraphics vg, PaintTransform ptrans ) : void
SelectAtEnd ( ) : InsertionPoint

A group box by default selects at the end of its last box. Enhance: if selecting in the last box can fail (e.g., because it's a group with no children, or because we add an argument to require an editable selection and the last box doesn't have one, we may need to try more boxes, in reverse order.

SelectAtStart ( ) : InsertionPoint

Make a selection at the start of the box. Subclasses override.

Private Methods

Method Description
BoxBefore ( Box target ) : Box
FindNumBoxes ( ) : void
FirstVisibleBox ( IVwGraphics vg, PaintTransform ptrans ) : Box

Return the first box that actually needs to be painted, that is, that intersects the clip rectangle specified in the VwGraphics. It is acceptable to answer the FirstBox, as here, if clipping is not needed; this is an optional optimization.

IsAfterVisibleBoxes ( Box box, IVwGraphics vg, PaintTransform ptrans ) : bool

Return true if the argument (child) box and all subsequent boxes need not be painted, typically because they occur after the end of the clip rectangle specified in the VwGraphics. It is acceptable to answer false, if no clipping is wanted, or for the first box for which we answer true to be later than the optimal one; this is an optional optimization.

RemoveBoxes ( Box firstGoner, Box lastGoner ) : void

Method Details

AddBox() public method

Add another box (to the end of the chain).
public AddBox ( Box box ) : void
box Box
return void

ChildTransformFromRootTransform() public method

Given the transform currently used to draw the root, give the transform used to draw your children.
public ChildTransformFromRootTransform ( PaintTransform rootTransform ) : PaintTransform
rootTransform PaintTransform
return PaintTransform

Contains() public method

Return true if this box contains the other one, that is, is one of its containers. Only group boxes can contain others.
public Contains ( Box other ) : bool
other Box
return bool

FindBoxAt() public method

If there is a leaf box at the specified position, return it. Also return the paint transform that should be passed to operations on that box. Enhance JohnT: should probably always return something, if box contains any leaf? Where is in drawing coords.
public FindBoxAt ( Point where, PaintTransform ptrans, PaintTransform &leafBoxTransform ) : LeafBox
where Point
ptrans PaintTransform
leafBoxTransform PaintTransform
return LeafBox

GetSelectionAt() public method

public GetSelectionAt ( Point where, IVwGraphics vg, PaintTransform ptrans ) : Selection
where Point
vg IVwGraphics
ptrans PaintTransform
return SIL.FieldWorks.SharpViews.Selections.Selection

GroupBox() public method

public GroupBox ( AssembledStyles styles ) : System
styles AssembledStyles
return System

InsertBox() public method

Add a child box after the specified box (one of your children).
public InsertBox ( Box newBox, Box insertAfter ) : void
newBox Box
insertAfter Box
return void

NextInSelectionSequence() public method

Answer the next box in which to draw a selection after the current one. This is basically a sequence which considers a box to be come immediately before - its first child, if it has one; - otherwise, its Next box, if any; - otherwise, the Next box of its closest ancestor that has one. Todo JohnT: eventually will be able to be constrained to the same column.
public NextInSelectionSequence ( bool includeChildren ) : Box
includeChildren bool
return Box

PaintBackground() public method

public PaintBackground ( IVwGraphics vg, PaintTransform ptrans ) : void
vg IVwGraphics
ptrans PaintTransform
return void

PaintForeground() public method

public PaintForeground ( IVwGraphics vg, PaintTransform ptrans ) : void
vg IVwGraphics
ptrans PaintTransform
return void

SelectAtEnd() public method

A group box by default selects at the end of its last box. Enhance: if selecting in the last box can fail (e.g., because it's a group with no children, or because we add an argument to require an editable selection and the last box doesn't have one, we may need to try more boxes, in reverse order.
public SelectAtEnd ( ) : InsertionPoint
return SIL.FieldWorks.SharpViews.Selections.InsertionPoint

SelectAtStart() public method

Make a selection at the start of the box. Subclasses override.
public SelectAtStart ( ) : InsertionPoint
return SIL.FieldWorks.SharpViews.Selections.InsertionPoint

Property Details

NumBoxes public_oe property

public int NumBoxes
return int