Home  /  Autodocs  /  ListBrowser.gadget

NAME

SetLBColumnInfoAttrsA
Sets column info attributes. (V45)

SYNOPSIS

VOID SetLBColumnInfoAttrsA(struct ColumnInfo *ci, struct TagItem *tags);

VOID SetLBColumnInfoAttrs(struct ColumnInfo *ci, Tag tag1, ...);

FUNCTION

Changes attributes for a ColumnInfo structure in a future friendly manner.

The ColumnInfo array must have been created using the AllocLBColumnInfoA() function.

You may not change column attributes while the corresponding list is attached to a ListBrowser gadget. You must first detach the list with LISTBROWSER_Labels, NULL before you can change attributes and then re-attach the list along with the LISTBROWSER_ColumnInfo tag.

TAGS

LBCIA_Column (WORD)
A column (starting from 0) that the attribute tags below it affect. All attribute tags have the prefix LBCIA_#? to distinguish them from other attributes. You typically specify the column to work with and then the column attributes. For example,

... LBCIA_Column, 0,

LBCIA_Title, "Amiga"

LBCIA_Column, 1,

LBCIA_AutoSort, TRUE,

...

Defaults to 0.

LBCIA_Title (CONST_STRPTR)
The title to assign to the column. This title must be present if LISTBROWSER_ColumnTitles is TRUE.

Defaults to NULL.

LBCIA_Weight (WORD)
The relative weight to apply to this column expressed as a percentage value. For example, a value of 40 means the column should take up 40% of the width. Note that columns are weighted by default.

Defaults to 0.

LBCIA_Width (WORD)
The specific pixel width of the column. This tag also implies that the CIF_FIXED flag is set.

Defaults to 0.

LBCIA_Flags (ULONG)
Specifies the flags to be used for this column.

These flags are deprecated and the equivalent tags should be used instead.

CIF_WEIGHTED
weighted width column (default)

CIF_FIXED
fixed pixel width

CIF_DRAGGABLE
separator is user draggable

CIF_NOSEPARATORS
no separator on this column (ignored until V47)

CIF_SORTABLE
column is sortable (see LBM_SORT)

LBCIA_Sortable (BOOL)
(V47) Column is sortable. This tag is equivalent to the CIF_SORTABLE flag.

Defaults to FALSE.

LBCIA_SortArrow (BOOL)
(V47) Column has a sort arrow displayed. The arrow will be displayed either when LBM_SORT is used on this column or when LBMCIA_AutoSort sort the column automatically.

The direction of the arrow depends on how the column was sorted. If the LBM_SORT method is use the lbs_Direction field is used to determine which arrow to display. If the column is auto-sorted then the LBMCIA_SortDirection field is used.

Defaults to FALSE.

LBCIA_AutoSort (BOOL)
(V47) Set this flag to allow the gadget to automatically handle sorting of the column. When the column is selected the LBM_SORT method will be invoked using the LBCIA_SortDirection and LBCIA_CompareHook tags.

When the gadget is initially created the column to sort by is defined using LISTBROWSER_SortColumn.

When the column is selected again the sort direction will be toggled.

If TRUE then LBCIA_Sortable is also TRUE implicitly.

Defaults to FALSE.

LBCIA_SortDirection (ULONG)
(V47) The current sort direction for the column.

The direction is one of the following values:

LBMSORT_FORWARD
Forward sort (down sort arrow)

LBMSORT_REVERSE
Reverse sort (up sort arrow)

The sort direction will automatically toggle when combined with the LBMCIA_AutoSort tag.

It is possible to use the LBCIA_SortDirection tag and the LISTBROWSER_SortColumn tag together to save and restore sorting user preferences.

Defaults to 0 (forward).

LBCIA_CompareHook (struct Hook *)
(V47) The sort comparison hook to use on the column. This is the exact same hook used by the LBM_SORT method. See the LBM_SORT method documentation for more information.

This hook will only be used if the column is marked sortable (see LBCIA_Sortable tag).

Defaults to NULL (default LBM_SORT comparison).

LBCIA_UserData (APTR)
(V47) Arbitrary user data for this column.

Defaults to NULL.

INPUTS

ci
Pointer to ColumnInfo array to set attributes on. Safe to call with a NULL pointer.

tags
A tag list of attributes to set. Safe to call with a NULL pointer.

RESULT

Returns non-zero on success or 0 on error.

SEE ALSO

AllocLBColumnInfoA(), GetLBColumnInfoAttrsA()