The IContainerColumn class provides the container with the ability to display a details view.
When using the details view, you must create an IContainerColumn object for each column in the details view. Use IContainerControl::addColumn to add the column objects to the container.
This class provides functions to add, delete, and hide columns in a container control. It also defines the characteristics of the column header (text or icon) and the position of the data in the column record.
The data in the object and the data displayed in the column are connected. For a user to have a details view, derive a class from IContainerObject and extend it with the additional fields to display in the columns of the container. You must ensure the column object has the following information:
The default implementation of a container column has the following:
Note:
The container widget does not support a split bar in details view.
The container widget automatically creates the leftmost column for details view. This column contains the icon and text of the corresponding IContainerObject. This column is initially sized to a zero width and is made nonzero if a column that is constructed with DataSource=isIcon or DataSource=isIconViewText is added If you attempt to add more columns to a container that represents the icon or text for an IContainerObject, the columns are ignored. However, if you add a column representing the text for an IContainerObject, the automatically created leftmost column uses the headingText set for that column.
IContainerControl::ColumnCursor ignores the automatically created leftmost column.
The native Windows containers (that is, containers constructed without the pmCompatible style) have the following restrictions for columns:
You can construct and destruct objects of this class.
![]() |
public:
virtual ~IContainerColumn()
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
IContainerColumn( DataSource objectDataType, const HeadingStyle& title = defaultHeadingStyle ( ), const DataStyle& data = defaultDataStyle ( ) )
Construct an IContainerColumn object by providing a type of data that is part of IContainerObject (as opposed to the user portion of the object) and, optionally, the styles to use for the heading and data.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
The native Windows containers (that is, containers constructed without the pmCompatible style) require that the first column be the icon text pair that is present in the other views. Because of this, regardless of where you attempt to insert a column constructed with this constructor, it will be placed at the beginning. If you insert more than one of the same type, then the second one will be invalid and not visible.
public:
IContainerColumn(const IContainerColumn& column)
Construct an IContainerColumn object by copying from an existing container column.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
public:
IContainerColumn( unsigned long dataOffset, const HeadingStyle& title = defaultHeadingStyle ( ), const DataStyle& data = defaultDataStyle ( ) )
Construct an IContainerColumn object by providing the offset, from the beginning of the IContainerObject data structure, of the object data to be displayed in the column and, optionally, the styles to use for the heading and data.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Use these members to retrieve data that is stored in an object referenced by this class.
![]() |
public:
IDate dataAsDate(const IContainerObject* object) const
Returns the data referenced by this column in the specified object. The data is returned as an IDate. If the type of the data is not IContainerColumn::date, an IInvalidRequest exception is thrown. You can call IContainerColumn::isDate to determine if this function is valid for a column object.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
IPointerHandle dataAsIcon( const IContainerObject* object ) const
Returns the data referenced by this column in the specified object. The data is returned as an IPointerHandle. If the type of the data is not IContainerColumn::icon, an IInvalidRequest exception is thrown. You can call IContainerColumn::isIconHandle to determine if this function is valid for a column object.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
unsigned long dataAsNumber( const IContainerObject* object ) const
Returns the data referenced by this column in the specified object. The data is returned as an unsigned long integer. All data types can be returned as an unsigned long integer.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
IString dataAsString(const IContainerObject* object) const
Returns the data referenced by this column in the specified object. The data is returned as an IString. If the type of the data is not IContainerColumn::string, an IInvalidRequest exception is thrown. You can call IContainerColumn::isString to determine if this function is valid for a column object.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
ITime dataAsTime(const IContainerObject* object) const
Returns the data referenced by this column in the specified object. The data is returned as an ITime. If the type of the data is not IContainerColumn::time, an IInvalidRequest exception is thrown. You can call IContainerColumn::isTime to determine if this function is valid for a column object.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
In addition to the IContainerColumn::Style types, the data in a column can also contain these data styles.
![]() |
public:
static Style defaultDataStyle()
Returns the default data style. The default data style is classDefaultDataStyle unless you change it using setDefaultDataStyle.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
static void setDefaultDataStyle(const DataStyle& dataStyle)
Sets the default data style for all subsequent column data.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
static const DataStyle classDefaultDataStyle
Specifies the original default style for data in a column, which is string, alignVerticallyCentered, alignLeft, and readOnly.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
static const DataStyle date
Displays the data in date format with National Language Support enabled. The date format is a four-byte field divided in the following order:
Windows | OS/2 | AIX |
Yes | Yes | Yes |
In the OS/2 operating system, this format is the same as the CDATE structure. For additional information, see Presentation Manager Programming Reference, Volume 3.
![]() |
public:
static const DataStyle handleDrawItem
When a details item must be drawn, this style causes an ICnrDrawItemEvent to be dispatched to ICnrDrawHandler::drawDetailsItem.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
The native Windows containers (that is, containers constructed without the pmCompatible style) do not support owner drawing of container objects.
![]() |
public:
static const DataStyle horizontalSeparator
Draws a horizontal separator beneath column headings.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
The native Windows containers (that is, containers constructed without the pmCompatible style) provide horizontal separators regardless of the setting of this style.
![]() |
public:
static const DataStyle invisible
Hides the data in the column.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
The native Windows containers (that is, containers constructed without the pmCompatible style) do not support filtering of columns.
![]() |
public:
static const DataStyle number
Specifies the data is an unsigned long number.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
static const DataStyle readOnly
Disables editing of the data in the column.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
static const DataStyle time
Displays the data in a time format with National Language Support enabled. The time format is a four-byte field divided in the following order:
Windows | OS/2 | AIX |
Yes | Yes | Yes |
In the OS/2 operating system, this format is the same as the CTIME structure. For additional information, see Presentation Manager Programming Reference, Volume 3.
![]() |
public:
static const DataStyle verticalSeparator
Draws a vertical separator after the column.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
The native Windows containers (that is, containers constructed without the pmCompatible style) do not support vertical separators for columns. This style is ignored.
In addition to the IContainerColumn::Style types, the heading can also contain these styles.
![]() |
public:
static Style defaultHeadingStyle()
Returns the default heading style. The default heading style is classDefaultHeadingStyle unless you have changed it using setDefaultHeadingStyle.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
static void setDefaultHeadingStyle( const HeadingStyle& headingStyle )
Sets the default heading style for all subsequent column headings.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
The native Windows containers (that is, containers constructed without the pmCompatible style) column heading style is defined by the columns data style.
![]() |
public:
static const HeadingStyle classDefaultHeadingStyle
Specifies the original default style for a heading, which is string, alignVerticallyCentered, alignLeft, and readOnlyHeading.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
static const HeadingStyle readOnlyHeading
Disables editing the data in the heading.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
The native Windows containers (that is, containers constructed without the pmCompatible style) do not support editing of column headings. This style is ignored.
These members implement the class.
![]() |
protected:
_FIELDINFO* columnInfo() const
Returns the address of the container's column record.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
protected:
IContainerControl* container() const
Returns the container in which this column is located.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
protected:
virtual unsigned long dataAttributes() const
Returns the current data attributes in the container.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
protected:
IContainerColumn& invalidate()
If the column is in a container, the column is repainted.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
protected:
IContainerColumn& setColumnInfo(_FIELDINFO* fieldinfo)
Stores the address of the container's column record.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
protected:
IContainerColumn& setContainer( IContainerControl* container )
Stores the specified container, which is the container this column is located in.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
protected:
virtual IContainerColumn& setDataAttributes( unsigned long dataAttributes )
Sets the specified attributes into the data.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
protected:
virtual IContainerColumn& setTitleAttributes( unsigned long titleAttributes )
Sets the specified attributes into the title.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
protected:
virtual unsigned long titleAttributes() const
Returns the current title attributes in the container.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Use these members to query and set the accessible attributes of this class.
![]() |
public:
virtual IContainerColumn& disableDataUpdate()
Prevents editing of the column data.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual IContainerColumn& disableHeadingUpdate()
Prevents editing of the heading.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
The native Windows containers (that is, containers constructed without the pmCompatible style) do not support editing of column headings.
![]() |
public:
virtual unsigned long displayWidth()
Returns the displayable width of the column data, in pixels.
If you want the column object's width, use IContainerControl::detailObjectRectangle instead of IContainerColumn::displayWidth. This is because a container details view cell is like a rectangle inside of another rectangle as follows:
This rectangle's width is either of the following:
This is the value returned by IContainerControl::detailsObjectRectangle.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
This function no longer permits you to use private container memory. This only affects users of the OS/2 2.0 operating system who have not installed the latest Corrective Service Diskette (CSD). If you have installed the OS/2 2.1 or OS/2 2.0 operating system with the latest CSD, you should not be affected.
![]() |
public:
virtual IContainerColumn& enableDataUpdate( bool enable = true )
Permits an edit field to be opened in the column data. This is valid only if the style is string.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual IContainerColumn& enableHeadingUpdate( bool enable = true )
Permits an edit field to be opened on the heading. This is valid only if the style is string.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
The native Windows containers (that is, containers constructed without the pmCompatible style) do not support editing of column headings.
![]() |
public:
bool hasHorizontalSeparator() const
If the column heading has a separator drawn under it, true is returned.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
The native Windows containers (that is, containers constructed without the pmCompatible style) require a horizontal separator for columns.
![]() |
public:
bool hasVerticalSeparator() const
If the column heading has a vertical separator drawn after the column, true is returned.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
The native Windows containers (that is, containers constructed without the pmCompatible style) do not support vertical separators for columns.
![]() |
public:
virtual IPointerHandle headingIcon() const
If the style is icon, the icon in the heading is returned. Otherwise an IPointerHandle with a value of 0 is returned.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
The native Windows containers (that is, containers constructed without the pmCompatible style) do not support icons for column headings. This function always returns false.
![]() |
public:
virtual IString headingText() const
If the style is string, the text in the heading is returned. Otherwise, an empty IString is returned.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
unsigned long helpId() const
Retrieves the help panel ID. You set the help panel ID by calling the function IContainerColumn::setHelpId. If you have attached an ICnrHandler to the container, the handler displays this help panel when the user requests help while direct-editing the column data of the details view.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual IContainerColumn& hide()
Hides the column.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
The native Windows containers (that is, containers constructed without the pmCompatible style) do not support filtering of columns.
![]() |
public:
virtual IContainerColumn& hideSeparators( const DataStyle& separatorStyles = horizontalSeparator | verticalSeparator )
Removes one of the following:
Windows | OS/2 | AIX |
Yes | Yes | Ignored |
The native Windows containers (that is, containers constructed without the pmCompatible style) do not support vertical separators for columns and require horizontal separators. This function is ignored.
![]() |
public:
HorizontalAlignment horizontalDataAlignment() const
Returns the current horizontal alignment of the column data in a container details view. The returned value is an enumerator provided by HorizontalAlignment.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
HorizontalAlignment horizontalHeadingAlignment() const
Returns the current horizontal alignment of the column heading data in a container details view. The returned value is an enumerator provided by HorizontalAlignment.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
The native Windows containers (that is, containers constructed without the pmCompatible style) column heading alignment is defined by the columns data alignment.
![]() |
public:
bool isDate() const
If the data in the column is a date, true is returned.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
bool isHeadingIconHandle() const
If the data in the column heading is an icon, true is returned.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
The native Windows containers (that is, containers constructed without the pmCompatible style) do not support icons for column headings.
![]() |
public:
bool isHeadingString() const
If the data in the column heading is a character string, true is returned.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
The Motif container widget only supports strings for column headings. This function always returns true.
The native Windows containers (that is, containers constructed without the pmCompatible style) only support strings for column headings. This function always returns true.
![]() |
public:
bool isHeadingWriteable() const
If the data in the column heading can be edited, true is returned.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
The native Windows containers (that is, containers constructed without the pmCompatible style) do not support editing of column headings. This function always returns false.
![]() |
public:
bool isIconHandle() const
If the data in the column is an icon, true is returned.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
bool isNumber() const
If the data in the column is a number, true is returned.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
bool isString() const
If the data in the column is a pointer to a character string or an IString, true is returned.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
bool isTime() const
If the data in the column is a time, true is returned.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
bool isVisible() const
If the column is visible in the container, true is returned.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
The native Windows containers (that is, containers constructed without the pmCompatible style) do not support filtering of columns. All invalid columns inserted will be made not visible by default. This function will return false for these invalid columns.
![]() |
public:
bool isWriteable() const
If the user can edit the data in the column, true is returned.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual IContainerColumn& justifyData( VerticalAlignment = centeredVertically, HorizontalAlignment = centered )
Sets the justification of the data to a horizontal and vertical alignment. Use the enumeration HorizontalAlignment to set the horizontal alignment to left, right, or centered. VerticalAlignment sets the vertical alignment to top, bottom, or centeredVertically.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual IContainerColumn& justifyHeading( VerticalAlignment = centeredVertically, HorizontalAlignment = centered )
Sets the justification of the heading to a horizontal and vertical alignment. Use the enumeration HorizontalAlignment to set the horizontal alignment to left, right, or centered. VerticalAlignment sets the vertical alignment to top, bottom, or centeredVertically.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
The native Windows containers (that is, containers constructed without the pmCompatible style) column heading alignment is defined by the column's data alignment.
![]() |
public:
virtual IContainerColumn& setDataOffset( unsigned long dataOffset )
Identifies where the data is located in a container object for this column.
The data in the object and the data displayed in the column are connected. For a user to have a details view, you must derive a class from IContainerObject and extend it with the additional "fields" to display in the columns of the container. You must ensure the column object has the following information:
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual IContainerColumn& setDisplayWidth( unsigned long widthInPixels )
Sets the displayable width of the column data, in pixels, after showing the details view.
See IContainerColumn::displayWidth for more information.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
Sets the icon to use for the heading and changes the style to icon.
public:
virtual IContainerColumn& setHeadingIcon( const IResourceId& iconId )
Windows | OS/2 | AIX |
Ignored | Yes | Ignored |
The native Windows containers (that is, containers constructed without the pmCompatible style) do not support icons for column headings.
public:
virtual IContainerColumn& setHeadingIcon( unsigned long iconId )
Windows | OS/2 | AIX |
Ignored | Yes | Ignored |
The native Windows containers (that is, containers constructed without the pmCompatible style) do not support icons for column headings.
public:
virtual IContainerColumn& setHeadingIcon( const IPointerHandle& iconHandle )
Windows | OS/2 | AIX |
Ignored | Yes | Ignored |
The Motif container widget does not support icons for column headings.
The native Windows containers (that is, containers constructed without the pmCompatible style) do not support icons for column headings.
![]() |
Sets the text to use for the heading and changes the style to string.
public:
virtual IContainerColumn& setHeadingText( const IResourceId& textId )
Windows | OS/2 | AIX |
Yes | Yes | Yes |
public:
virtual IContainerColumn& setHeadingText(const char* text)
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual IContainerColumn& setHelpId(unsigned long helpId)
Stores a help panel ID. You set the help panel ID by calling the function IContainerColumn::setHelpId. If you have attached an ICnrHandler to the container, the handler displays this help panel when the user requests help while direct-editing the column data of the details view.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual IContainerColumn& show(bool visible = true)
Makes the column visible.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
The native Windows containers (that is, containers constructed without the pmCompatible style) do not support filtering of columns.
![]() |
public:
virtual IContainerColumn& showSeparators( const DataStyle& separatorStyles = horizontalSeparator | verticalSeparator )
Adds any of the following:
Windows | OS/2 | AIX |
Yes | Yes | Ignored |
The native Windows containers (that is, containers constructed without the pmCompatible style) do not support vertical separators for columns and require horizontal separators.
![]() |
public:
VerticalAlignment verticalDataAlignment() const
Returns the current alignment of column data in a container details view. The returned value is an enumerator provided by VerticalAlignment.
Windows | OS/2 | AIX |
Yes | Yes | Ignored |
![]() |
public:
VerticalAlignment verticalHeadingAlignment() const
Returns the current alignment of column heading data in a container details view. The returned value is an enumerator provided by VerticalAlignment.
Windows | OS/2 | AIX |
Yes | Yes | Ignored |
The native Windows containers (that is, containers constructed without the pmCompatible style) column heading alignment is defined by the columns data alignment.
These style members are both heading styles and data styles. You can specify alignTop, alignBottom, and alignVerticallyCentered, and only one of alignLeft, alignRight, and alignCentered.
![]() |
public:
static const Style alignBottom
Aligns the data to the bottom of the cell.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
static const Style alignCentered
Centers the data horizontally in the cell.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
static const Style alignLeft
Aligns the data to the left of the cell.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
static const Style alignRight
Aligns the data to the right of the cell.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
static const Style alignTop
Aligns the data to the top of the cell.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
static const Style alignVerticallyCentered
Centers the data vertically in the cell.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
static const Style icon
Specifies that the data is an icon.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
static const Style string
Specifies that the data is a string.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
enum DataSource { isIcon, isIconViewText }
These enumerators specify whether the column data is the icon or the icon text stored in the object:
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
enum HorizontalAlignment { left, right, centered }
These enumerators specify the horizontal alignment of text in the column:
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
enum VerticalAlignment { top, bottom, centeredVertically }
These enumerators specify the vertical alignment of text in the column:
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
typedef unsigned long HeadingStyle
A flag used to represent construction values for the column heading.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
typedef unsigned long Style
A flag used to represent construction values for both the column heading and the column data.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
typedef unsigned long DataStyle
A flag used to represent construction values for the data in a column.
Windows | OS/2 | AIX |
Yes | Yes | Yes |