The first item in a list is 1, not 0. This makes it consistant with Euphoria's indexing method, but can be a bit confusing if you are used to working with zero-based arrays.
see also: insertItem()
Example:
-- add "Apples" to TheList addItem( TheList, "Apples" )-- add fruit list to TheList addItem( TheList, {"Oranges", "Pears", "Bananas", "Mangoes" })
addItem is also used to add items to ComboBoxEx controls by packing several params into text. Example:
-- add "Apples" to TheListEx with unselected image -- i1 and selected image i2 where, i1 and i2 -- were values returned from addIcon() addItem( TheListEx, {"Apples", i1, i2}) addItem( TheListEx, { {"Oranges", i3, i2}, {"Pears", i4, i2}, {"Bananas", i5, i2}, {"Mangoes", i6, i2} })
See also Image Lists for details on using images
See Also: deleteItem, eraseItems, findItem, getCount, getIndex, getItem, getMultIndices, getMultItems, insertItem, setIndex, setListHScroll, setSelection, setTabs, w32AllItems
The position starts at 1.
Example:
-- delete item 2 from the list deleteItem( TheList, 2 )
deleteItem() also works with list view and tree view controls. position should be the item id returned when the item was created. To delete all items in a list view or tree view, position should be -1.
See Also: addItem, eraseItems, findItem, getCount, getIndex, getItem, getMultIndices, getMultItems, insertItem, setIndex, setListHScroll, setSelection, setTabs, w32AllItems
Example:
-- erase items from TheList eraseItems( TheList )Also works with ComboBox ListView and TreeView controls.
See Also: addItem, deleteItem, findItem, getCount, getIndex, getItem, getMultIndices, getMultItems, insertItem, setIndex, setListHScroll, setSelection, setTabs, w32AllItems
Note, findItem will only check the first column of a ListView.
If istartpos is negative, the list is scanned from the last item such that -1 means
start at the last item, -2 from the second last item etc... A value of 0 means
that all occurances are returned in a sequence.
Example:
integer ipos sequence allpos
-- See if new value already exists. ipos = findItem( TheList, NewValue, 1 ) -- Get all occurances of "cat" allpos = findItem( TheList, "cat", 0) -- Get last occurance of "dog" ipos = findItem( TheList, "dog", -1)
See Also: addItem, deleteItem, eraseItems, getCount, getIndex, getItem, getMultIndices, getMultItems, insertItem, setIndex, setListHScroll, setSelection, setTabs, w32AllItems
This returns zero if list is not an appropriate control type.
Example:
-- count size of TheList integer countgetCount also works with ListView controls.count = getCount( TheList )
See Also: addItem, deleteItem, eraseItems, findItem, getIndex, getItem, getMultIndices, getMultItems, insertItem, setIndex, setListHScroll, setSelection, setTabs, w32AllItems
For ListView and TreeView, this returns a sequence of all selected items.
For MleEdit, EditText and RichEdit, this returns the cursor position.
For Combos this returns
For List, this returns the index of the currently selected item.
For Window, VScroll, HScroll, VTrackBar, HTrackBar, ProgressBar, UpDown this returns the current scroll position.
Example:
-- get index of selected item in TheList integer index index = getIndex( TheList )integer CPos CPos = getIndex( myRichEdit )
See Also: addItem, deleteItem, eraseItems, findItem, getCount, getItem, getMultIndices, getMultItems, insertItem, setIndex, setListHScroll, setSelection, setTabs, w32AllItems
Note, getItem() will return the text from all columns of a ListView.
If index is zero, the currently selected item is used.
Example:
-- get the text of the third item in TheList sequence text-- get the text of the third item. text = getItem( TheList, 3 ) -- get the text of the current item. text = getItem( TheList, 0 )
See Also: addItem, deleteItem, eraseItems, findItem, getCount, getIndex, getMultIndices, getMultItems, insertItem, setIndex, setListHScroll, setSelection, setTabs, w32AllItems
See Also: addItem, deleteItem, eraseItems, findItem, getCount, getIndex, getItem, getMultItems, insertItem, setIndex, setListHScroll, setSelection, setTabs, w32AllItems
See Also: addItem, deleteItem, eraseItems, findItem, getCount, getIndex, getItem, getMultIndices, insertItem, setIndex, setListHScroll, setSelection, setTabs, w32AllItems
The position starts at 1, but if you use zero, it adds it to the end of the list.
see also: addItem()
Example:
-- insert "Bananas" at position 2 in TheList insertItem( TheList, "Bananas", 2 ) -- insert "Mangoes" to the end of TheList insertItem( TheList, "Mangoes", 0 )
See Also: addItem, deleteItem, eraseItems, findItem, getCount, getIndex, getItem, getMultIndices, getMultItems, setIndex, setListHScroll, setSelection, setTabs, w32AllItems
This is used for Lists, Combo, and Treeview controls.
Use 0 to set the index to 'unselected.'
Use -1 to set the index to the last item.
Note that if index is greater than the number of items in the list
then the last item will be selected.
Example:
-- select the first item on the list setIndex( TheList, 1 ) -- select the last item on the list setIndex( TheList, -1 )-- deselect all items in the treeview setIndex( MyTreeView, 0)
See Also: addItem, deleteItem, eraseItems, findItem, getCount, getIndex, getItem, getMultIndices, getMultItems, insertItem, setListHScroll, setSelection, setTabs, w32AllItems
Note that it returns -1 if the id used is not a list box. Example:
-- Redraw the horizontal scroll bar res = setListHScroll(mylist)
See Also: addItem, deleteItem, eraseItems, findItem, getCount, getIndex, getItem, getMultIndices, getMultItems, insertItem, setIndex, setSelection, setTabs, w32AllItems
See Also: addItem, deleteItem, eraseItems, findItem, getCount, getIndex, getItem, getMultIndices, getMultItems, insertItem, setIndex, setListHScroll, setTabs, w32AllItems
tabs should be a sequence of integers. Each one is a tabstop position measured in 1/4 character widths.
See Also: addItem, deleteItem, eraseItems, findItem, getCount, getIndex, getItem, getMultIndices, getMultItems, insertItem, setIndex, setListHScroll, setSelection, w32AllItems
atom rc rc = deleteItem(myCombo, w32AllItems)
See Also: addItem, deleteItem, eraseItems, findItem, getCount, getIndex, getItem, getMultIndices, getMultItems, insertItem, setIndex, setListHScroll, setSelection, setTabs