SG_ListIconGadget

Syntax:

Result=SG_ListIconGadget(SG_GadgetID_L.l, X_Pos_L.l, Y_Pos_L.l, Width_L.l, Height_L.l, ColumnName_S.s, ColumnWidth_L.l, [Flags_L])

Parameters:

SG_GadgetID_L

=

The number of the gadget

X_Pos_L

=

the x-position of the gadget

Y_Pos_L

=

the y position of the gadget

Width_L

=

the width of the gadget

Height_L

=

the height of the gadget

ColumnName_S

=

the name of the column

ColumnWidth_L

=

The 'Width' represents the initial Width of the new column.

[Flags_L]

=

'Flags' are always optional and can be composed of one or several (using the bitwise OR operator '|') of the following constants:

#PB_ListIcon_MultiSelect : Enable multiple selection.

=

#PB_ListIcon_GridLines : Display separator lines between rows and columns.

=

#PB_ListIcon_FullRowSelect : The selection covers the full row instead of the first column.

=

#PB_ListIcon_AlwaysShowSelection: The selection is still visible, even when the gadget is not activated.

=


Return Values:

Result

=

contains a pointer to the internal gadget structur. See the source of this lib for more information


Description:

Creates a ListIcon gadget in the current screen. #Gadget will be the numeric identifier returned by the SG_EventScreenGadgetID() command. 'Title$' is the first column title, and 'TitleWidth' its initial width (in pixels). Once a ListIconGadget is created, its list of items is empty. The following commands can be used to act on the list content:

- AddGadgetColumn() : Add a column to the gadget.

- AddGadgetItem(): Add an item (with an optional image in the standard 16x16 size).

- RemoveGadgetItem(): Remove an item.

- ClearGadgetItemList(): Remove all the items.

- CountGadgetItems(): Returns the number of items currently in the #Gadget.

- GetGadgetItemState(): Returns the current state of the specified item.

- SetGadgetItemState(): Changes the current state of the specified item.

- GetGadgetItemText(): Returns the current text of the specified item.

- SetGadgetItemText(): Changes the current text of the specified item.

If you want to add content to ListIcons with several columns using SG_AddGadgetItem() , you should use the format "first column"+Chr(10)+"second one" as Text$ parameter.


Example:


Remarks:

The maximum number of colums for these gadget is 16. For the purpose of changing the header width with the mouse, there is a special way to change the mouse, if it is over the gap between two header columns. In this case, the function `SG_MoveLiconHeader()` returns 1, otherwise 0



Supported OS:   Windows