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.
- TBoxView (long columns, long rows, TView * v1 =NIL, TView * v2 =NIL, TView * v3 =NIL, TView * v4 =NIL)
- TBoxView (long columns, long rows, EAlign ha, EAlign va, TView * v1 =NIL, TView * v2 =NIL, TView * v3 =NIL, TView * v4 =NIL)
- TBoxView (long columns, long rows, const TGPoint & gap, TView * v1 =NIL, TView * v2 =NIL, TView * v3 =NIL, TView * v4 =NIL)
- TBoxView (long columns, long rows, EAlign ha, EAlign va, EExpand he, EExpand ve, const TGPoint & gap)
- TBoxView ()
- TBoxView (const TBoxView & other)
Interface Category:
API.
Purpose:
- Creates a row/column layout for a number of views.
- Creates a row/column layout for a number of views.
- Creates a row/column layout for a number of views.
- Creates a row/column layout for a number of views.
- Default constructor.
- Copy constructor.
Calling Context:
- Called to apply a box layout to a number of views.
- Called to apply a box layout to a number of views.
- Called to apply a box layout to a number of views.
- Called to apply a box layout to a number of views.
- Called by the stream-in operators.
- Called to copy an object.
Parameters:
- long columns -Number of columns TBoxView will have. If columns ==0 and rows
then the effective number of columns will depend on the number of subviews.
- long rows -Number of rows TBoxView will have. If rows ==0 and columns >0 then the effective number of rows will depend on the number of subviews.
- TView * v1 =NIL -First view to adopt.
- TView * v2 =NIL -Second view to adopt.
- TView * v3 =NIL -Third view to adopt.
- TView * v4 =NIL -Fourth view to adopt.
- long columns -Number of columns TBoxView will have. If columns ==0 and rows
then the effective number of columns will depend on the number of subviews.
- long rows -Number of rows TBoxView will have. If rows ==0 and columns >0 then the effective number of rows will depend on the number of subviews.
- EAlign ha -Horizontal alignment of each subview.
- EAlign va -Vertical alignment of each subview.
- TView * v1 =NIL -First view to adopt.
- TView * v2 =NIL -Second view to adopt.
- TView * v3 =NIL -Third view to adopt.
- TView * v4 =NIL -Fourth view to adopt.
- long columns -Number of columns TBoxView will have. If columns ==0 and rows
then the effective number of columns will depend on the number of subviews.
- long rows -Number of rows TBoxView will have. If rows ==0 and columns >0 then the effective number of rows will depend on the number of subviews.
- const TGPoint & gap -gap.fX specifies the horizontal gap between columns and gap.fY specifies the vertical gap between rows.
- TView * v1 =NIL -First view to adopt.
- TView * v2 =NIL -Second view to adopt.
- TView * v3 =NIL -Third view to adopt.
- TView * v4 =NIL -Fourth view to adopt.
- long columns -Number of columns TBoxView will have. If columns ==0 and rows
then the effective number of columns will depend on the number of subviews.
- long rows -Number of rows TBoxView will have. If rows ==0 and columns >0 then the effective number of rows will depend on the number of subviews.
- EAlign ha -Horizontal alignment of each subview.
- EAlign va -Vertical alignment of each subview.
- EExpand he -Horizontal expandability of each subview.
- EExpand ve -Vertical expandability of each subview.
- const TGPoint & gap -gap.fX specifies the horizontal gap between columns and gap.fY specifies the vertical gap between rows.
- Takes no parameters.
- const TBoxView & other -The object to copy.
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:
- long & columns -The effective number of columns.
- long & rows -The effective number of rows.
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:
- long column -The column index.
- long row -The row index.
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:
- long column -The column index.
- long row -The row index.
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:
- long column -The column index.
- long row -The row index.
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:
- long column -The column index.
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:
- long column -The column index.
- long row -The row index.
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:
- long column -The column index.
- long row -The row index.
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:
- long column -The column index.
- long row -The row index.
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:
- long column -The column index.
- long row -The row index.
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:
- long column -The column index.
- long row -The row index.
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:
- long column -The column index.
- long row -The row index.
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:
- TView & v -The view to align in the cell.
- EAlign halign -The horizontal alignment member function.
- EAlign valign -The vertical alignment member function.
- const TGPoint & cellposition -The position of the cell in which to align the view.
- const TGPoint & cellsize -The size of the cell in which to align the view.
- const TGPoint & item -The size of the aligned view.
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:
- long column -The column for which the width should be calculated.
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:
- long row -The row for which the height should be calculated.
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:
- long column -The column index.
- long row -The row index.
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:
- TView * v1 -First view to adopt.
- TView * v2 -Second view to adopt.
- TView * v3 -Third view to adopt.
- TView * v4 -Fourth view to adopt.
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:
- TGArea & area -The bounds of this view as returned by this function. Input value ignored.
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:
- const TGRect & area -The new allocated area.
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:
- TStream & -The stream to which the object streams itself out.
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:
- TStream & -The stream from which the object streams itself in.
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:
- const TBoxView & other -The object to be copied.
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.
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:
- const GCoordinate & height -The new gap height.
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:
- const GCoordinate & width -The new gap width.
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:
- EExpand va -The new vertical expand member function for this box view.
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:
- EExpand he -The new horizontal expand member function for this box view.
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:
- EAlign va -The new vertical align member function.
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:
- EAlign ha -The new horizontal align member function.
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:
- const long & rows -The new number of rows.
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:
- const long & columns -The new number of columns.
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.