X11 Work Bench Toolkit  1.0
__LISTINFO__ Struct Reference

Structure containing data for list-related dialog controls. More...

#include <dialog_support.h>

Data Fields

int nItems
 current number of valid entries in 'aItems'
 
int nMaxItems
 max size of aItems (must re-alloc to increase nMaxItems)
 
int nPos
 current scroll position
 
int nTop
 scroll position of the top item currently displayed
 
int nHeight
 height (in items) of display area, recalculated on resize/expose
 
int nItemHeight
 height of a single item (in pixels)
 
int nFlags
 flags (sorted, etc.)
 
Window wOwner
 owning window [to be notified on change]
 
void *(* pfnAllocator )(const void *, int)
 pointer to the copy constructor to call for each item that's added More...
 
void(* pfnDestructor )(void *)
 destructor to call for each item that's removed More...
 
void(* pfnDisplay )(WBDialogControl *pControl, void *pData, int iSelected, GC gcPaint, WB_GEOM *pGeom, XFontSet fontSet)
 display callback function to paint the entry on the display surface More...
 
int(* pfnSort )(const void *, const void *)
 Optional sort comparison function. NULL implies 'strcmp'.
 
void * aItems [1]
 The array of item data, integrated into the memory block containing this structure.
 

Detailed Description

Structure containing data for list-related dialog controls.

Internally maintained structure containing list-related control data including selection information and function callbacks for allocation, de-allocation, display, and sorting.

typedef struct __LISTINFO__
{
int nItems, nMaxItems; // size/max size of aItems (must re-alloc to increase nMaxItems)
int nPos, nTop; // scroll position and position of top item
int nHeight, nItemHeight; // height (in items) and height of item (in pixels)
int nFlags; // flags (sorted, etc.)
Window wOwner; // owning window [to be notified on change]
void *(*pfnAllocator)(const void *, int); // copy constructor to call for each item that's added
// typically this will call 'WBAlloc' followed by 'memcpy'
// if NULL, the caller-supplied pointer is assigned to 'aItems' as-is
void (*pfnDestructor)(void *); // destructor to call for each item that's removed
// typically this will point to 'WBFree'
// if NULL, the caller-supplied pointer is ignored
void (*pfnDisplay)(WBDialogControl *pControl, void *pData, int iSelected, GC gcPaint, WB_GEOM *pGeom, XFontSet fontSet);
// generic function to display contents of item within 'pGeom' using GC
// typically one of the listbox 'display item' functions
int (*pfnSort)(const void *, const void *); // sort proc (NULL implies strcmp)
void *aItems[1]; // array of item data (remainder of struct)
See Also
DLGInitControlListInfo()

Definition at line 109 of file dialog_support.h.

Field Documentation

void*(* pfnAllocator)(const void *, int)

pointer to the copy constructor to call for each item that's added

typically this will call 'WBAlloc' followed by 'memcpy' to construct a new pointer
if this is NULL, the caller-supplied pointer is assigned to 'aItems' as-is

Definition at line 124 of file dialog_support.h.

void(* pfnDestructor)(void *)

destructor to call for each item that's removed

typically this will point to 'WBFree()'. if it is NULL, the caller-supplied pointer is ignored on cleanup

Definition at line 129 of file dialog_support.h.

void(* pfnDisplay)(WBDialogControl *pControl, void *pData, int iSelected, GC gcPaint, WB_GEOM *pGeom, XFontSet fontSet)

display callback function to paint the entry on the display surface

generic callback function to display the contents of the item within 'pGeom' using the provided GC. The 'pControl' 'pData' and 'iSelected' parameters reference the WBDialogControl, the list entry's data pointer, and a boolean 'selection' flag, respectively.
Typically this will be on of the listbox 'DisplayItem' API functions.

Definition at line 137 of file dialog_support.h.


The documentation for this struct was generated from the following file: