The SFTBOX_ITEM structure is used by the callback function LPFNSFTBOX_VGETITEM to return the requested item information to SftBox/DLL when a virtual data source is used.
typedef struct tagSftBoxITEM {
unsigned short level; // item level (0 is highest, no parent)
short fShown; // item shown
short fEnabled; // item enabled
short fFakeExp; // item "fake" expandable
short fOpened; // status of item at time of parent close
int height; // item height
int res1;
HBITMAP obsoletehLabel; // not used
HBITMAP obsoletehItem; // not used
SFTBOX_DWORD_PTR dwdData; // user data for this item
LPSFTBOX_ROW lpRow; // row header info (optional)
LPTSTR lpszRowHeader; // row header text
LPSFTBOX_CELL aCells; // cell information
LPTSTR * alpszString; // array of pointers to strings for each cell (required)
SFTBOX_ID key; // item key
DWORD res3, res4, res5;
short flag2; // item attributes
#define SFTBOXITEM_IGNORE 1 // ignored item (for optimal width calculation)
#define SFTBOXITEM_EDITIGNORE 2 // not used
#define SFTBOXITEM_EXPCOLLAPSEBUTTONHIDE 4 // hide expand/collapse button
short minHeight; // minimum item height or 0 (variable height only)
short maxHeight; // maximum item height or 0 (variable height only)
short res4s; // reserved
SFT_PICTURE ItemPicture; // item picture
SFT_PICTURE LabelPicture; // label picture
// internal only
DWORD heightCount; // internal use only
BOOL internalSelected; // internal use only
} SFTBOX_ITEM, * LPSFTBOX_ITEM;
typedef const SFTBOX_ITEM * LPCSFTBOX_ITEM;The item's level. This member must be set to 0.
The item's visibility status. This member must be set to TRUE.
The item's status. This member can be set to TRUE (enabled) or FALSE (disabled). See GetItemStatus.
The item's expandable status (see GetItemExpandable). This member must be set to FALSE.
The item's expand status at the time when its parent item was last closed. This member must be set to FALSE.
This member must be set to 0.
Not used. Set to NULL.
An application-defined value. This value can be retrieved using GetItemData. SftBox/DLL does not inspect this value in any other way.
A pointer to a SFTBOX_ROW structure defining the item's row header. May be NULL if no row header information needs to be provided (even if row headers are visible).
A pointer to the text to be used for the item's row header. May be NULL if no row header text needs to be provided (even if row headers are visible).
A pointer to SFTBOX_CELL structures (one for each column defined in the combo box control). May be NULL if no additional cell information needs to be provided. If a pointer is present it must point to SFTBOX_CELL structures for all defined columns. The virtual callback function LPFNSFTBOX_VGETITEM provides the number of columns in the totCols argument.
A pointer to an array of pointers to null-terminated strings, defining the cell text. A pointer must be present for each defined column. The virtual callback function LPFNSFTBOX_VGETITEM provides the number of columns in the totCols argument.
An application-defined key for this item. May be 0. SftBox/DLL does not inspect this value. GetItemID and GetItemIndex cannot be used with a virtual data source and do not return this value.
Item attributes. The following values can be combined:
| flag2 | Item attributes |
|---|---|
| 0 | No additional attributes. |
| SFTBOXITEM_IGNORE | The item (all cells) is ignored for optimal column width calculation using MakeColumnOptimal and CalcOptimalColumnWidth. This attribute is typically used if certain item contents are known to be unusually long, which would make its columns too wide. |
| SFTBOXITEM_EDITIGNORE | Not used by the combo box control. |
| SFTBOXITEM_EXPCOLLAPSEBUTTONHIDE | The item's expand/collapse button is not shown. As a virtual data source only supports flat lists, items have no expand/collapse buttons and this attribute has no visible effect. |
The minimum height of the item in pixels in a variable height combo box control (see SFTBOXSTYLE_VARIABLE). The minimum height overrides the usual item height, which is automatically determined based on item attributes. If this value is 0, no minimum height is defined.
This value is ignored in a fixed height combo box control.
The maximum height of the item in pixels in a variable height combo box control (see SFTBOXSTYLE_VARIABLE). The maximum height overrides the usual item height, which is automatically determined based on item attributes. If the maximum height is smaller than the required height for the item, portions of the item may be vertically clipped. If this value is 0, no maximum height is defined.
This value is ignored in a fixed height combo box control.
Defines the item picture (see SetItemPicture).
Defines the label picture (see SetItemLabelPicture).
Reserved for internal use. Must be set to 0.
res1, res3, res4, res5, res4s
Reserved. Must be set to 0. h1 Comments
The SFTBOX_ITEM structure is used to return item information to SftBox/DLL from the callback function LPFNSFTBOX_VGETITEM when a virtual data source is used (see VirtualInitialize). All information returned in this structure, including structures and strings referred to by pointers in the SFTBOX_ITEM structure, must remain valid until the LPFNSFTBOX_VRELEASEITEM callback function is called by SftBox/DLL. This means that all data must be either in static memory or dynamically allocated. Temporary variables cannot be used to hold information.
All members that are not used must be initialized to 0 or NULL. Color members of the SFTBOX_CELL and SFTBOX_ROW structures referred to by the SFTBOX_ITEM structure for which the default color is to be used must be set to SFTBOX_NOCOLOR.
Pointer typedefs: LPSFTBOX_ITEM is a pointer to a SFTBOX_ITEM structure, LPCSFTBOX_ITEM is a pointer to a constant SFTBOX_ITEM structure.
See Also C/C++ API | Categories | Notifications