X11workbench 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.)
 
WB_GEOM geomDisplay
 the (cached) geometry that defines the "display area" (not scrollbars, border)
 
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, WBGC gcPaint, WB_GEOM *pGeom, WB_FONTC pFont)
 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.)
WB_GEOM geomDisplay; // the (cached) geometry that defines the "display area" (not scrollbars, border)
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, WBGC gcPaint, WB_GEOM *pGeom, WB_FONTC pFont);
// generic function to display contents of item within 'pGeom' using WBGC
// 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 110 of file dialog_support.h.

Field Documentation

◆ pfnAllocator

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 126 of file dialog_support.h.

◆ pfnDestructor

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 131 of file dialog_support.h.

◆ pfnDisplay

void(* pfnDisplay) (WBDialogControl *pControl, void *pData, int iSelected, WBGC gcPaint, WB_GEOM *pGeom, WB_FONTC pFont)

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 WBGC. 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 139 of file dialog_support.h.


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