+ (MUIList *) list

Default constructor

- (LONG) active

Reading this attribute will return the number of the active entry (the one with the cursor on it). The result is between 0 and MUIA_List_Entries-1 or MUIV_List_Active_Off, in which case there is currently no active entry.

Setting the attribute will cause the list to move the cursor to the new position and scroll this position into the visible area.

- (BOOL) againClick
- (BOOL) autoLineHeight

Set to TRUE to make List calculate line height automatically for multi-line entries. Entries will be same height.

Set to TRUE again to force re-calculating heights after content changes to allow shrinking the height.

- (BOOL) autoVisible

Set this to make your lists automatically jump to the active entry when they are displayed.

- (LONG) clickColumn
- (BYTE*) columnOrder
- (LONG) columns

Returns the number of (total) columns in this list

- (id) createEditObject:(LONG)row column:(LONG)column entry:(id<MUIListEntry>)entry

Overload this method to create custom edit objects.

- (APTR) createImage:(id)obj flags:(ULONG)flags

If you want to have custom images in a listview (e.g. like the little monitor icons in PSI), you should create them as Bitmap objects (or Bodychunk objects) in the setup method of your list class (use a subclass!).

After that, pass the newly created object pointer to MUIM_List_CreateImage and use the result in your display hook with

\33O[%08lx]

where %08lx must be replaced by the pointer you got from MUIM_List_CreateImage.

When your list is done (i.e. in the Cleanup method), kill your image with MUIM_List_DeleteImage and dispose your object.

RESULT The result you get is a black box pointer, it's not valid to assume anything about it. The only useful thing you can do is to include it in \33O[%08lx]. The result may be NULL in which case MUI was unable to create the image, but the \33O[] combination simply draws nothing when receiving a NULL so it shouldnt be considered an error.

- (LONG) defClickColumn
- (void) deleteImage:(APTR)listimg

Delete the image pointer returned from MUIM_List_CreateImage.

- (BOOL) dragSortable

If you set this attribute to TRUE, the user will be able to move around entries in the list by using drag&drop.

- (LONG) dragType
- (LONG) dropMark

After a successfull drop operation, this attribute holds the position where we should insert the new entry(ies).

- (BOOL) edit:(LONG)row column:(LONG)column

Enter the editing mode.

In the custom class you should call DoSuperMethod() for entires allowed to edit. The class takes care of installing in-place editor object.

Only one item can be in edit mode at the same time.

- (BOOL) editDone:(LONG)row column:(LONG)column entry:(id<MUIListEntry>)entry editobj:(id)editobj

This method is called when in-place editing is done.

- (BOOL) editable

Allow user to enter the edit mode.

- (void) endEdit:(ULONG)mode
- (LONG) entries

Get the current number of entries in the list.

- (LONG) first

Get the number of the entry displayed on top of the list. You have to be prepared to get a result of -1, which means that the list is not visible at all (e.g. when the window is iconifed).

- (OBString *) format

MUI has the ability to handle multi column lists. To define how many columns should be displayed and how they should be formatted, you specify a format string.

This format string must contain one entry for each column you want to see. Entries are separated by commas, each single entry is parsed via dos.library/ReadArgs().

The template for a single entry looks like this:

DELTA=D/N,PREPARSE=P/K,WEIGHT=W/N, MINWIDTH=MIW/N,MAXWIDTH=MAW/N,COL=C/N,BAR/S, SORTABLE/S,O=ORDER/K

DELTA Space in pixel between this column and the next. the last displayed column ignores this setting. Defaults to 4.

PREPARSE A preparse value for this column. Setting this e.g. to "\33c" would make the column centered. See MUIA_Text_Contents for other control codes.

WEIGHT The weight of the column. As with MUI's group class, columns are layouted with a minimum size, a maximum size and weight. A column with a weight of 200 would gain twice the space than a column with a weight of 100. Defaults to 100.

MINWIDTH Minimum percentage width for the current column. If your list is 200 pixel wide and you set this to 25, your column will at least be 50 pixel. The special value -1 for this parameter means that the minimum width is as wide as the widest entry in this column. This ensures that every entry will be completely visible (as long as the list is wide enough). Defaults to -1.

NEW: starting from MorphOS 3.10 it is possible set minimum width in pixels: MINWIDTH=50px sets minimum width to 50 pixels.

MAXWIDTH Maximum percentage width for the current column. If your list is 200 pixel wide and you set this to 25, your column will not be wider than 50 pixel. The special value -1 for this parameter means that the maximum width is as wide as the widest entry in this column. Defaults to -1.

NEW: starting from MorphOS 3.10 it is possible set maximum width in pixels. MAXWIDTH=50px sets maximum width to 50 pixels.

COL Set number of the current column. This allows you to adjust the order of your columns without having to change your display hook. See example for details. Defaults to current entry number (0,1,...)

BAR Since muimaster.library V11, you can enable a vertical bar between this and the next column by using this switch.

SORTABLE When set user can reorder the list by this column when he clicks the title. (V21)

ORDER Set sorting order to ascending or descending. Possible values are ASC or ASCENDING and DESC or DESCENDING. Defaults to ascending order. (V21)

If your list object gets so small that there is not enough place for the minwidth of a column, this column will be hidden completely and the remaining space is distributed between the remaining columns. This is not true if the column is the first column, in this case the entries will simply be clipped.

Note: You will have as many columns in your list as entries in the format string (i.e. number of commas + 1). Empty entries, e.g. with a format string of ",,,," are perfectly ok.

The default list format is an empty string (""), this means a one column list without special formatting.

- (LONG) insertPosition

After insertion of an element with MUIM_List_Insert, you can query the position of the new entry by getting this attribute.

- (void) jump:(LONG)pos

Scroll any entry into the visible part of a list.

Note: Jumping to an entry doesn't mean to make this entry the active one. This can be done by setting the MUIA_List_Active attribute.

- (ULONG) lineHeight
- (BOOL) listDoubleClick
- (BOOL) listQuiet

If you add/remove lots of entries to/from a currently visible list, this will cause lots of screen action and slow down the operation. Setting MUIA_List_Quiet to true will temporarily prevent the list from being refreshed, this refresh will take place only once when you set it back to false again.

- (LONG) listVisible

Get the current number of visible entries in the list. You have to be prepared to get a result of -1, which means that the list is not visible at all (e.g. when the window is iconifed).

- (void) noNotifySetActive:(LONG)active
- (void) noNotifySetAgainClick:(BOOL)againclick
- (void) noNotifySetAutoLineHeight:(BOOL)autolineheight
- (void) noNotifySetAutoVisible:(BOOL)autovisible
- (void) noNotifySetClickColumn:(LONG)clickcolumn
- (void) noNotifySetColumnOrder:(BYTE*)columnorder
- (void) noNotifySetDefClickColumn:(LONG)defclickcolumn
- (void) noNotifySetDragSortable:(BOOL)dragsortable
- (void) noNotifySetDragType:(LONG)dragtype
- (void) noNotifySetEditable:(BOOL)editable
- (void) noNotifySetFirst:(LONG)first
- (void) noNotifySetFormat:(OBString *)format
- (void) noNotifySetHideColumn:(LONG)hidecolumn
- (void) noNotifySetListDoubleClick:(BOOL)listdoubleclick
- (void) noNotifySetListQuiet:(BOOL)listquiet
- (void) noNotifySetMultiTestHook:(struct Hook *)multitesthook
- (void) noNotifySetShowColumn:(LONG)showcolumn
- (void) noNotifySetShowDropMarks:(BOOL)showdropmarks
- (void) noNotifySetSortColumn:(LONG)sortcolumn
- (void) noNotifySetStripes:(BOOL)stripes
- (void) noNotifySetTitle:(BOOL)title
- (void) noNotifySetTitleClick:(LONG)titleclick
- (void) noNotifySetTopPixel:(LONG)toppixel
- (void) redraw:(ULONG)position

Redraws given entry(ies) - useful if the underlying data changed indirectly

- (void) redrawActive
- (void) redrawAll
- (BOOL) select:(LONG)pos seltype:(LONG)seltype state:(LONG *)state

Select/deselect a list entry or ask an entry if its selected.

- (BOOL) selectChange
- (OBArray *) selectedObjects

Returns all selected items

- (void) setActive:(LONG)active
- (void) setAdjustHeight:(BOOL)adjustheight

CAUTION: this is an initializer attribute, meaning it cannot be changed after the underlying MUI object is instantiated

- (void) setAdjustWidth:(BOOL)adjustwidth

CAUTION: this is an initializer attribute, meaning it cannot be changed after the underlying MUI object is instantiated

- (void) setAgainClick:(BOOL)againclick
- (void) setAutoLineHeight:(BOOL)autolineheight
- (void) setAutoVisible:(BOOL)autovisible
- (void) setClickColumn:(LONG)clickcolumn
- (void) setColumnOrder:(BYTE*)columnorder
- (void) setDefClickColumn:(LONG)defclickcolumn
- (void) setDragSortable:(BOOL)dragsortable
- (void) setDragType:(LONG)dragtype
- (void) setEditable:(BOOL)editable
- (void) setFirst:(LONG)first
- (void) setFormat:(OBString *)format
- (void) setHScrollerVisibility:(LONG)hscrollervisibility

CAUTION: this is an initializer attribute, meaning it cannot be changed after the underlying MUI object is instantiated

- (void) setHideColumn:(LONG)hidecolumn
- (void) setInput:(BOOL)input

CAUTION: this is an initializer attribute, meaning it cannot be changed after the underlying MUI object is instantiated

- (void) setListDoubleClick:(BOOL)listdoubleclick
- (void) setListQuiet:(BOOL)listquiet
- (void) setMaxColumns:(LONG)maxcolumns

CAUTION: this is an initializer attribute, meaning it cannot be changed after the underlying MUI object is instantiated

- (void) setMinLineHeight:(LONG)minlineheight

CAUTION: this is an initializer attribute, meaning it cannot be changed after the underlying MUI object is instantiated

- (void) setMultiSelect:(LONG)multiselect

CAUTION: this is an initializer attribute, meaning it cannot be changed after the underlying MUI object is instantiated

- (void) setMultiTestHook:(struct Hook *)multitesthook

If you plan to have a multi selecting list but not all of your entries are actually multi selectable (e.g. in a file requester), you can supply a MUIA_List_MultiTestHook.

It will be called with a pointer to an entry in A1 and should return TRUE if the entry is multi selectable, FALSE otherwise.

- (void) setScrollerPos:(BOOL)scrollerpos

CAUTION: this is an initializer attribute, meaning it cannot be changed after the underlying MUI object is instantiated

- (void) setShowColumn:(LONG)showcolumn
- (void) setShowDropMarks:(BOOL)showdropmarks
- (void) setSortColumn:(LONG)sortcolumn
- (void) setStripes:(BOOL)stripes
- (void) setTitle:(BOOL)title
- (void) setTitleClick:(LONG)titleclick
- (void) setTitles:(OBArray *)titles
- (void) setTopPixel:(LONG)toppixel
- (BOOL) showDropMarks

If a list supports Drag & Drop, it usually indicates the place where a new line would be inserted with some horizontal lines.

Showing this place doesnt make much sense if you dont care about the drop position anyway, e.g. because your list is always alphabetically sorted. You should set this attribute to FALSE in these cases.

- (LONG) sortColumn

Set or get a column number used for sorting.

- (BOOL) stripes

Set this to have every second row in the list appear in different color.

- (ULONG) testPos:(LONG)x y:(LONG)y res:(struct MUI_List_TestPos_Result *)res

Find out which line/column of a listview is currently displayed at a certain position.

- (BOOL) title

Specify a title for the current list. The title is displayed at the very first line and doesn't scroll away when the list top position moves.

Usually, the title is just a string. However, if you have a multi column list with a custom display hook and you want to have seperate titles for each of your columns, you can set this attribute to TRUE. In this case, whenever MUI feels that the list title has to be drawn, it will call your display hook with a NULL entry pointer. Your hook has to check for this NULL entry and fill the given string array with your column titles. Layout of the column titles follows the same rules as layout of the lists entries.

- (LONG) titleClick
- (OBArray *) titles

Array of OBStrings for each column title

- (LONG) topPixel
- (LONG) totalPixel
- (LONG) visiblePixel