Home  /  Autodocs  /  ListBrowser.gadget

NAME

SetListBrowserNodeAttrsA
Set attributes of a ListBrowser node.

SYNOPSIS

VOID SetListBrowserNodeAttrs(struct Node *, Tag, ...)
SetListBrowserNodeAttrs(node, firsttag, ...)

VOID SetListBrowserNodeAttrsA(struct Node *, struct TagItem *)
SetListBrowserNodeAttrsA(node, taglist)

FUNCTION

Changes attributes for a ListBrowser node. Since the ListBrowser class uses a private node structure, this is the only way to change node attributes.

You may NOT change node attributes when the node is in a list attached to a ListBrowser gadget. You must first detach the list with LISTBROWSER_Labels, ~0 before you can change attributes, and then re-attach the list.

TAGS

LBNA_Selected (BOOL)
If this node is currently selected or not in a multi-select list browser. This field is not meaningful in a single-select list browser.

LBNA_Flags (ULONG)
Flags for this node. See ListBrowser.h for available flags. In particular, you need to set LBFLG_HASCHILDREN for non-leaf nodes in hierarchical listbrowsers.

LBNA_Generation (WORD)
Sets which "generation" this node belongs to, if the ListBrowser is to be in hierarchical mode. If you were to draw the nodes out in a sort of family tree, the generation would refer to the level in the tree.

Generations start at 1. A generation 1 node's children will be generation 2, you cannot skip generations. Nodes need not have children and generations can go as deep as you like, limited by the available stack of input.device.

LBNA_UserData (APTR)
Arbitrary user data for this node. This field will be made available in the LBSortMsg.lbsm_UserDataA or B fields when using the LBM_SORT method.

LBNA_Column (WORD)
A column (from 0 to number_of_columns-1) that the column attribute tags below (LBNCA_Text, LBNA_Integer, LBNA_FGPen, LBNA_BGPen, LBNA_Image, LBNA_SelImage, LBNA_Justification) affect. You typically specify the column to work on, and then the column attributes for that column, then the next column followed by its attributes, etc.

LBNCA_Text (STRPTR)
Text that is to appear in the corresponding column for this node. Only one of LBNCA_Text, LBNA_Integer and LBNCA_Image may be non-NULL, specifying the type of contents for this column. Each column of a node need not have the same type of contents. Similarly, the same column in different nodes also need not have the same type of contents.

LBNCA_CopyText (BOOL)
Specifies that you want the LBNCA_Text copied to an internal buffer by ListBrowser. Note: this tag must precede LBNCA_Text in the tag list!

LBNCA_Editable (BOOL)
Specifies that this item can be edited. If the user clicks twice on this entry, the text will become a string gadget where the user can edit the contents. This will only work if the contents are text (given with LBNCA_Text) AND if LBNCA_CopyText was used. You MUST also specify LBNCA_MaxChars to specify how long the edited text can be.

LBNCA_MaxChars(WORD) - Maximum number of characters an editable text entry can be.

LBNCA_Integer (LONG *)
A pointer to an integer to display in this column, or NULL.

LBNCA_CopyInteger (BOOL)
Specifies that you want the LBNCA_Integer copied to an internal buffer by ListBrowser. Note: this tag must precede LBNCA_Integer in the tag list!

LBNCA_FGPen, LBNA_BGPen (WORD) - The pens to be used for rendering the text or integer in this

column. Requires that the LBFLG_CUSTOMPENS flag be specified, otherwise the default system pens will be used.

LBNCA_FillPen (WORD)
(V47) The pen to be used for rendering the background for the text or integer in this column when it is selected. Requires that the LBFLG_CUSTOMPENS flag in LBNA_Flags be specified, otherwise the default system pen will be used.

Defaults to FILLPEN. Applicability is OM_NEW, OM_SET, OM_GET.

LBNCA_Image
see next

LBNA_SelImage (struct Image *)
Specifies that the column should contain an image. The selected image is optional, if not provided, LBNA_Image will be rendered in the IDS_SELECTED state when then node is selected.

LBNCA_Justification (WORD)
Specifies a justification for the column, either LCJ_LEFT, LCJ_CENTRE or LCJ_RIGHT.

Defaults to LCJ_LEFT

LBNCA_VertJustify (WORD)
(V47) Specifies a vertical justification for the column either LRJ_TOP, LRJ_CENTER or LRJ_BOTTOM.

Defaults to LRJ_CENTER.

LBNA_CheckBox (BOOL)
(V41) Means that this node will be a checkbox node, that can be toggled on or off.

Defaults to FALSE.

LBNA_Checked (BOOL)
(V41) Indicates whether a checkbox node is in the checked or unchecked state.

Defaults to FALSE.

LBNCA_EditTags (struct TagItem *)
(V41) Tags that you want to be passed to the string gadget used when editing gadget text. Though you could theoretically pass any tags to the gadget, you should generally not pass tags that affect the position of the gadget.

Defaults to NULL.

LBNCA_RenderHook (struct Hook *)
(V41) A custom render hook for this node column. Your hook will receive a pointer to struct Node of the node in question as its object, and the following structure in the message pointer:

struct LBDrawMsg
{
ULONG lbdm_MethodID; // LV_DRAW
struct RastPort *lbdm_RastPort; // Where to render to
struct DrawInfo *lbdm_DrawInfo; // Useful to have around
struct Rectangle lbdm_Bounds; // Limits of where to render
ULONG lbdm_State; // How to render
};

LBDrawMsg.lbdm_State will be either LBR_SELECTED or LBR_NORMAL. The hook should return LBCB_OK if rendering was successful, or LBCB_UNKNOWN if lbdm_Method doesn't equal LV_DRAW. No rendering should be performed in this case.

Note that this is HIGHLY compatible with a GadTools listview hook.

Defaults to NULL.

LBNCA_HookHeight (WORD)
(V41) The height of this column, when using LBNCA_RenderHook.

LBNA_MemPool (APTR)
(V42) Specifies a custom memory pool to allocate listbrowser nodes from. Please note that when creating the memory pool, you need to specify the MEMF_CLEAR flag otherwise listbrowser.gadget will crash. This is fixed for V45.1.

Defaults to NULL (internal pool).

LBNCA_WordWrap (BOOL)
(V42) Specifies this column's text can be word wrapped. Useful in weighted column displays or fixed pixels columns. Primarily this feature exists at the request of IRC client authors.

Initial implementation in V42.630 is slow. Improvement to be made.

Defaults to FALSE.

INPUTS

node
Node whose attributes you are changing. Safe to call with a NULL pointer.

taglist
Tag list of attributes to change. Safe to call with a NULL pointer.

NOTES

The use of the LBNA_MemPool tag is strongly discouraged because no arbitration mechanism for safely allocating/freeing memory from the supplied pool is available in AmigaOS versions prior to AmigaOS4. This feature was never ever safe to use on AmigaOS versions 2.x through 3.x!

SEE ALSO

GetListBrowserNodeAttrsA()