This List Box library availability can be found calling mt_appl_getinfo(7). Bit 1 of ap_gout1
, if equal to 1, says that mt_lbox_xx() functions are available.
|
Listbox has a horiz. and a vertical slider |
|
Auto-scrolling |
|
Automatic display during auto-scrolling |
|
Real-time slider |
|
Multi-selection with Shift |
|
Only a selectable entry |
|
Toggle status of an entry at selection |
|
Listbox with vertical slider |
|
another name for mt_lbox_get_avis |
|
another name for mt_lbox_get_first |
|
another name for mt_lbox_scroll_to |
|
another name for mt_lbox_set_slider |
|
TODO |
|
opaque structure |
|
TODO |
|
TODO |
|
This function positions Slider A and updates the contents of the list box
|
|
This function positions Slider B and updates the contents of the list box
box_rect is the redraw rectangle for the list box and slider_rect is the redraw rectangle for the slider.mt_lbox_bscroll_to() works in principle like a call of mt_lbox_set_bslider() followed by a mt_lbox_update(); scrolling takes place if possible, however, to reduce the amount of drawing required. One may therefore not use mt_lbox_scroll_to() if the item list of the list box has changed. |
|
counts the items of the chained list
|
|
list box - create
set for each object passed in objs . However the list box will not be drawn!
Bit 0 of the variable
Both
typedef void (cdecl *SLCT_ITEM)( LIST_BOX *box, OBJECT *tree, struct _lbox_item *item, void *user_data, WORD obj_index, WORD last_state );
typedef WORD (cdecl *SET_ITEM)( LIST_BOX *box, OBJECT *tree, struct _lbox_item *item, WORD obj_index, void *user_data, GRECT *rect, WORD first );
For a list box that only contains text strings,
In most cases the list box routines call the function mt_objc_draw()/ mt_wdlg_redraw() after
typedef struct _lbox_item { struct _lbox_item *next; WORD selected; WORD data1; void *data2; void *data3; } LBOX_ITEM; However the structure can well look like the following example with appropriate casting during the call:
typedef struct { void *next; WORD selected; ... From here on to suit the application ... } LB_EXAMPLE;
If the list box has 2 sliders, ctrl_objs[5-8] contain the numbers of the objects for Slider B:
The buttons, the slider and the slider background should have a TOUCHEXIT status. If the list box contains only buttons and no slider, ctrl_objs[3/4 or 7/8] must contain -1.
The objects should normally have TOUCHEXIT status.
The word +-----+---------+-------------------------------------------------------+ | Bit | State | Description | +-----+---------+-------------------------------------------------------+ | 0 | 0 | The box scrolls horizontally | | | 1 | The box scrolls vertically | +-----+---------+-------------------------------------------------------+ | 1 | 0 | No automatic scrolling | | | 1 | Scrolling takes place automatically as soon as the | | | | mouse cursor is moved past the first or last item | | | | with the mouse button held down | +-----+---------+-------------------------------------------------------+ | 2 | 0 | The selection routine will be called only after the | | | | automatic scrolling has finished, i.e. it will be | | | | called for the last selected entry. | | | 1 | With automatic scrolling the selection routine will | | | | be called for each selected entry during scrolling | +-----+---------+-------------------------------------------------------+ | 3 | 0 | When moving the slider a frame will be moved | | | | (graf_slidebox), the list box will only be updated | | | | after releasing the mouse button | | | 1 | The slider is a real-time slider | +-----+---------+-------------------------------------------------------+ | 4 | 0 | Multiple selections within the list box are possible | | | 1 | Only one item can be selected | +-----+---------+-------------------------------------------------------+ | 5 | 0 | Multiple selections possible without the Shift key | | | 1 | Multiple selections only possible with the Shift key | +-----+---------+-------------------------------------------------------+ | 6 | 0 | On selection the status is always SELECTED | | | 1 | On selection the status is always changed | +-----+---------+-------------------------------------------------------+ | 7 | 0 | The list box has only one slider | | | 1 | The list box has two sliders | +-----+---------+-------------------------------------------------------+ |
|
releases the memory allocated for the list box.
|
|
reacts to the activation of a button
mt_lbox_do() recognises double-clicks by the set topmost bit of the object number |
|
frees the memory for the chained list from LBOX_ITEMs
If custom memory management was used for LBOX_ITEMs (e.g. the C standard functions), then a custom function must also be called to free the memory. |
|
This functions works exactly the same as mt_lbox_free_items().
|
|
returns the index of the first visible item
|
|
returns the number of items for Slider B.
|
|
returns the index of the first visible item (Slider B!).
|
|
returns the number of visible entries, slider B.
|
|
list box - get item index
n of the item item . If item is not an element of the list, the return value is -1. |
|
returns a pointer to item
|
|
returns a pointer to the list of the LBOX_ITEMs
|
|
Establish the index of the first selected item
|
|
returns a pointer to the first selected item of the list.
|
|
returns the pointer to the object tree of the dialog box
|
|
returns the pointer
|
|
returns the number of visible items
|
|
list box - set slider a
rect . The contents of the list box will not be updated, so one may have to call mt_lbox_update(). If rect is 0L, then only the position of the slider objects will be altered, but the objects will not be drawn. |
|
This Function sets the number of items (the subdivisions) for Slider B.
|
|
This function positions Slider B and draws it within the redraw rectangle.
rect . The contents of the list box will not be updated, so one may have to call mt_lbox_update(). If rect is 0L, then only the position of the slider objects will be altered, but the objects will not be drawn. |
|
This function sets a new list with list box entries
The pointer |
|
updates the contents of the list box objects
set is called for each of the objects. If rect is not 0L it will be regarded as a pointer to a GRECT that will be used for the redraw of the list box. Otherwise the objects will only be updated but not drawn. |