Class: TBoxView

Declaration: LayoutViews.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TLayoutView

Inherited By:

THBoxView TVBoxView

Purpose:

Provides a row/column layout for views.

Instantiation:

Always allocate on the heap.

Deriving Classes:

THBoxView and TVBoxView, where H is horizontal & V is vertical.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Other Considerations:

None.

Member Function: TBoxView::TBoxView

  1. TBoxView (long columns, long rows, TView * v1 =NIL, TView * v2 =NIL, TView * v3 =NIL, TView * v4 =NIL)
  2. TBoxView (long columns, long rows, EAlign ha, EAlign va, TView * v1 =NIL, TView * v2 =NIL, TView * v3 =NIL, TView * v4 =NIL)
  3. TBoxView (long columns, long rows, const TGPoint & gap, TView * v1 =NIL, TView * v2 =NIL, TView * v3 =NIL, TView * v4 =NIL)
  4. TBoxView (long columns, long rows, EAlign ha, EAlign va, EExpand he, EExpand ve, const TGPoint & gap)
  5. TBoxView ()
  6. TBoxView (const TBoxView & other)

Interface Category:

API.

Purpose:

  1. Creates a row/column layout for a number of views.
  2. Creates a row/column layout for a number of views.
  3. Creates a row/column layout for a number of views.
  4. Creates a row/column layout for a number of views.
  5. Default constructor.
  6. Copy constructor.

Calling Context:

  1. Called to apply a box layout to a number of views.
  2. Called to apply a box layout to a number of views.
  3. Called to apply a box layout to a number of views.
  4. Called to apply a box layout to a number of views.
  5. Called by the stream-in operators.
  6. Called to copy an object.

Parameters:

then the effective number of columns will depend on the number of subviews.

then the effective number of columns will depend on the number of subviews.

then the effective number of columns will depend on the number of subviews.

then the effective number of columns will depend on the number of subviews.

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TBoxView::GetColumnsRows

virtual void GetColumnsRows (long & columns, long & rows) const

Interface Category:

API.

Purpose:

Calculates the effective number of columns and rows. Override if you want to implement a different strategy for calculating the effective number of columns and rows.

Calling Context:

Called whenever the effective number of columns and rows must be known. You can call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TBoxView::GetItemWidth

virtual GCoordinate GetItemWidth (long column, long row) const

Interface Category:

API.

Purpose:

Calculates the width of the subview given by the column/row index. The default implementation calls GetItemSize(). Override if you want to implement a different strategy for calculating the width of an subview.

Calling Context:

Called for calculating the maximum width of a column. You can call this function directly.

Parameters:

Return Value:

Returns the width of the subview given by the column/row index.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TBoxView::GetItemHeight

virtual GCoordinate GetItemHeight (long column, long row) const

Interface Category:

API.

Purpose:

Calculates the height of the subview given by the column/row index. The default implementation calls GetItemSize(). Override if you want to implement a different strategy for calculating the height of an subview. You can call this function directly.

Calling Context:

Called for calculating the maximum height of a row.

Parameters:

Return Value:

Returns the height of the subview given by the column/row index.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TBoxView::GetItemSize

virtual TGPoint GetItemSize (long column, long row) const

Interface Category:

API.

Purpose:

Calculates the extent (width and height) of the subview given by the column/row index. The default implementation calls GetBounds() for the subview. Override if you want to implement a different strategy for calculating the extent of an subview. You can call this function directly.

Calling Context:

Called for calculating the extent of a subview.

Parameters:

Return Value:

Returns the extent of the subview given by the column/row index. The fX component contains the width, the fY component the height.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TBoxView::GetGapWidth

virtual GCoordinate GetGapWidth (long column) const

Interface Category:

API.

Purpose:

Calculates the horizontal gap between the column with index column and the column with index column+1. The default implementation returns the fX component of member fGap. Override if you want to implement a different strategy for calculating the horizontal gap. You can call this function directly.

Calling Context:

Called to calculate the gap between two columns.

Parameters:

Return Value:

Returns the horizontal gap for the given column.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TBoxView::GetGapHeight

virtual GCoordinate GetGapHeight (long row) const

Interface Category:

API.

Purpose:

Calculates the vertical gap between the row with index row and the row with index row+1. The default implementation returns the fY component of member fGap. Override if you want to implement a different strategy for calculating the vertical gap. You can call this function directly.

Calling Context:

Called to calculate the gap between two rows.

Parameters:

Return Value:

Returns the vertical gap for the given column.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TBoxView::GetCellPosition

virtual TGPoint GetCellPosition (long column, long row) const

Interface Category:

API.

Purpose:

Calculates the position of the cell given by the column/row index. The default implementation computes the x position by accumulating the width of columns and gaps preceding the specified column, and computes the y position by accumulating the height of rows and gaps preceding the specified row. Override if you want to implement a different strategy for calculating the position of a cell. You can call this function directly.

Calling Context:

Called by PlaceAndSizeChildren to determine how to align a subview in a cell.

Parameters:

Return Value:

Returns the position of the cell.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TBoxView::GetCellSize

virtual TGPoint GetCellSize (long column, long row) const

Interface Category:

API.

Purpose:

Calculates the size of the cell given by the column/row index. The default implementation calls GetColumnWidth(column) and GetRowHeight(row). Override if you want to implement a different strategy for calculating the size of a cell. You can call this function directly.

Calling Context:

Called by PlaceAndSizeChildren to determine how to align a subview in a cell.

Parameters:

Return Value:

Returns the size of a cell.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TBoxView::GetCellHAlign

virtual EAlign GetCellHAlign (long column, long row) const

Interface Category:

API.

Purpose:

Calculates the horizontal alignment of the cell given by the column/row index. The default implementation returns the member fHAlign. Override if you want to implement a different strategy for calculating the horizontal alignment of a cell. You can call this function directly.

Calling Context:

Called by PlaceAndSizeChildren to determine how to align a subview in a cell.

Parameters:

Return Value:

Returns the horizontal alignment of a cell.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TBoxView::GetCellVAlign

virtual EAlign GetCellVAlign (long column, long row) const

Interface Category:

API.

Purpose:

Calculates the vertical alignment of the cell given by the column/row index. The default implementation returns the member fVAlign. Override if you want to implement a different strategy for calculating the vertical alignment of a cell. You can call this function directly.

Calling Context:

Called by PlaceAndSizeChildren to determine how to align a subview in a cell.

Parameters:

Return Value:

Returns the vertical alignment of a cell.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TBoxView::GetCellHExpand

virtual EExpand GetCellHExpand (long column, long row) const

Interface Category:

API.

Purpose:

Calculates the horizontal expandability of the cell given by the column/row index. The default implementation returns the member fHExpand. Override if you want to implement a different strategy for calculating the horizontal expandability of a cell.

Calling Context:

Called by PlaceAndSizeChildren to determine whether and how to expand a subview in a cell.

Parameters:

Return Value:

Returns the horizontal expandability of a cell.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TBoxView::GetCellVExpand

virtual EExpand GetCellVExpand (long column, long row) const

Interface Category:

API.

Purpose:

Calculates the vertical expandability of the cell given by the column/row index. The default implementation returns the member fVExpand. Override if you want to implement a different strategy for calculating the vertical expandability of a cell. You can call this function directly.

Calling Context:

Called by PlaceAndSizeChildren to determine whether and how to expand a subview in a cell.

Parameters:

Return Value:

Returns the vertical expandability of a cell.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TBoxView::AlignViewInCell

virtual void AlignViewInCell (TView & v, EAlign halign, EAlign valign, const TGPoint & cellposition, const TGPoint & cellsize, const TGPoint & item) const

Interface Category:

API.

Purpose:

Aligns and expands a subview in a cell.

Calling Context:

Called by PlaceAndSizeChildren to align and expand a subview in a cell.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TBoxView::GetWidth

virtual GCoordinate GetWidth () const

Interface Category:

API.

Purpose:

Returns the width of the contents of the layout view. The default implementation accumulates the widths and gaps of all columns. Override this function to implement a different member function of computing the width of the contents of the view. You can call this function directly.

Calling Context:

Called to compute the width of the contents of the layout view.

Parameters:

Return Value:

Returns the width of the contents of the layout view.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TBoxView::GetHeight

virtual GCoordinate GetHeight () const

Interface Category:

API.

Purpose:

Returns the height of the contents of the layout view. The default implementation accumulates the heights and gaps of all rows. Override this function to implement a different member function of computing the height of the contents of the view. You can call this function directly.

Calling Context:

Called to compute the height of the contents of the layout view.

Parameters:

Return Value:

Returns the height of the contents of the layout view.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TBoxView::GetColumnWidth

virtual GCoordinate GetColumnWidth (long column) const

Interface Category:

API.

Purpose:

Returns the width of the specified column. The default implementation calculates the maximum width of all subviews in that column. You can override GetColumnWidth if you want to use a different strategy.

Calling Context:

Called to compute column width.

Parameters:

Return Value:

Returns the width of the specified column.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TBoxView::GetRowHeight

virtual GCoordinate GetRowHeight (long row) const

Interface Category:

API.

Purpose:

Returns the height of the specified row. The default implementation calculates the maximum height of all subviews in that row. You can override GetRowHeight if you want to use a different strategy. You can call this function directly.

Calling Context:

Called to compute row height.

Parameters:

Return Value:

Returns the height of the specified row.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TBoxView::GetChildAt

virtual TView * GetChildAt (long column, long row) const

Interface Category:

API.

Purpose:

Returns the subview in the specified column and row. You can call this function directly.

Calling Context:

Called to retrieve the subview at a specific location.

Parameters:

Return Value:

Returns a TView or NIL if the index is out of bounds.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TBoxView::AdoptChildren

void AdoptChildren (TView * v1, TView * v2, TView * v3, TView * v4)

Interface Category:

API.

Purpose:

Convenience function to adopt up to four views at once. You can call this function directly.

Calling Context:

Same Thread.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TBoxView::GetBounds

virtual void GetBounds (TGArea & area) const

Interface Category:

API.

Purpose:

Returns the bounds of this view through the parameter. The bounds for TBoxView are the computed height and width of the contents of the view. The height is computed with GetHeight(), and the width is computed with GetWidth().

Calling Context:

Call from the same thread as the view. The area parameter should be created, but its value will be ignored, and the returned area will be returned through the parameter.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This function is protected.

Member Function: TBoxView::PlaceAndSizeChildren

virtual void PlaceAndSizeChildren (const TGRect & area)

Interface Category:

API.

Purpose:

Positions and resizes children based on new allocated area. You can call this function directly.

Calling Context:

Called whenever the size of the view changes.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This function is protected.

Member Function: TBoxView::operator<<=

virtual TStream & operator <<= (TStream &)

Interface Category:

API.

Purpose:

Stream-out operator.

Calling Context:

Called to stream out data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself out to.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TBoxView::operator>>=

virtual TStream & operator >>=(TStream &) const

Interface Category:

API.

Purpose:

Stream-in operator.

Calling Context:

Called to stream in data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself in from.

Exceptions:

Throws a TInvalidVersionError if the version of the object on the stream is unknown to the version of the shared library installed.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TBoxView::operator=

TBoxView & operator =(const TBoxView & other)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Call this function by using the operator in an assignment statement.

Parameters:

Return Value:

Returns a const reference to the left-hand side object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TBoxView::~TBoxView

virtual ~ TBoxView ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Called to destroy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TBoxView::SetGapHeight

virtual void SetGapHeight (const GCoordinate & height)

Interface Category:

API.

Purpose:

Sets the gap height for the entire box view. You can call this function directly.

Calling Context:

Called to set the gap height.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TBoxView::SetGapWidth

virtual void SetGapWidth (const GCoordinate & width)

Interface Category:

API.

Purpose:

Sets the gap width for the entire box view. You can call this function directly.

Calling Context:

Called to set the gap width.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TBoxView::SetVExpand

virtual void SetVExpand (EExpand va)

Interface Category:

API.

Purpose:

Sets the vertical expand member function to the one specified for the entire box view. You can call this function directly.

Calling Context:

Called to set the vertical expand member function.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TBoxView::SetHExpand

virtual void SetHExpand (EExpand he)

Interface Category:

API.

Purpose:

Sets the horizontal expand member function to the one specified for the entire box view. You can call this function directly.

Calling Context:

Called to set the horizontal expand member function.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TBoxView::SetVAlign

virtual void SetVAlign (EAlign va)

Interface Category:

API.

Purpose:

Sets the vertical align member function to the one specified for the entire box view. You can call this function directly.

Calling Context:

Called to set the vertical align member function.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TBoxView::SetHAlign

virtual void SetHAlign (EAlign ha)

Interface Category:

API.

Purpose:

Sets the horizontal align member function to the one specified for the entire box view. You can call this function directly.

Calling Context:

Called to set the horizontal align member function.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TBoxView::SetRows

virtual void SetRows (const long & rows)

Interface Category:

API.

Purpose:

Sets the number of rows in this box view.

Calling Context:

Called to set the number of rows in the box view. You can call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TBoxView::SetColumns

virtual void SetColumns (const long & columns)

Interface Category:

API.

Purpose:

Sets the number of columns in this box view. You can call this function directly.

Calling Context:

Called to set the number of columns in the box view.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.