Topic : TOS - The Operating System Author : Version : tos.hyp (December 19, 2008) Subject : Programmieren/Atari Nodes : 3010 Index Size : 93790 HCP-Version : 5 Compiled on : Atari @charset : atarist @lang : @default : Title @help : @options : +g -i -s +x +zz -t4 @width : 70 View Ref-File8.14.4 lbox_create TOS Name: »List Box Create« - Create a list box Opcode: 170 Syntax: LIST_BOX *lbox_create ( OBJECT *tree, SLCT_ITEM slct, SET_ITEM set, LBOX_ITEM *items, int16_t visible_a, int16_t first_a, int16_t *ctrl_objs, int16_t *objs, int16_t flags, int16_t pause_a, void *user_data, DIALOG *dialog, int16_t visible_b, int16_t first_b, int16_t entries_b, int16_t pause_b ); Description: The function lbox_create allocates memory for a list box and initializes the objects. Parameter Meaning tree Pointer to the object tree of the dialog slct Pointer to selection routine set Pointer to set routine items Pointer to linked list with LBOX_ITEMs or NULL visible_a Number of visible entries (Slider A) first_a Index of the first visible entry (Slider A) ctrl_objs Pointer to a field with the object indices of the buttons and slider (5 entries) ctrl_objs[0] = Object index of the BOX or IBOX, that contains the actual list box object ctrl_objs[1] = Object index of the buttons for scrolling upwards or left ctrl_objs[2] = Object index of the buttons for scrolling downwards or right ctrl_objs[3] = Object index of the slider background box ctrl_objs[4] = Object index of the slider box If the list box has 2 sliders, ctrl_objs[5-8] contain the numbers of the objects for Slider B: ctrl_objs[5] = Object index of the button for scrolling upwards or left ctrl_objs[6] = Object index of the button for scrolling downwards or right ctrl_objs[7] = Object index of the slider background box ctrl_objs[8] = Object index of the slider box objs Pointer to a field with the object indices of the list box items (entries). objs[0] = Number of the first object objs[entries-1] = Number of the last object The objects should normally have TOUCHEXIT status. flags Various flags pause_a Delay during scrolling in ms (Slider A) user_data Pointer for application dialog Pointer to the window dialog structure or 0L visible_b Number of visible items (Slider B) first_b First visible item (Slider B) entries_b Number of items (Slider B) pause_b Delay during scrolling in ms (Slider B) Note: The initialization is performed by calling the routine set for each of the objects specified in objs. Calling this function does not draw the list box. 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. Independent of the main scroll direction, the list box can have a second slider as well if the entries them- selves should also be scrolled sideways; this can be sensible for a vertical list box with text entries that are wider than the box itself, for instance. Both slct and set are functions whose parameters are passed on the stack. The functions may alter registers d0-d2/a0-a2. slct is always called whenever an entry is selected or deselected. The variable selected in the LBOX_ITEM structure already contains the new status of the object when slct is called. Return value: The function returns a pointer to the structure of the list box (or the value NULL in case of error). Availability: The presence of this call should be checked for using appl_getinfo (Opcode 7). Group: List boxes See Also: Binding lbox_delete lbox_do