Older Newer
Sun, 15 Dec 2019 12:38:40 . . . . SyneRyder [Add itemnum parameter]


Changes by last author:

Added:
= deleteCtlItem =

== Syntax ==

int deleteCtlItem(int n, int itemnum)

== Arguments ==

:n

::The number of the listbox/combobox control to delete an item from

:itemnum

::The number of the item to delete from the listbox/combobox/tab control

== Return ==

Returns false if the control number is out of range, not in use, or not a LISTBOX, COMBOBOX or TAB control. Otherwise, returns true if the function succeeded, false otherwise.

== Description ==

Deletes an item in a LISTBOX, COMBOBOX or a TAB control.

== Example ==

<code>

%fml

ctl[0]: LISTBOX(VSCROLL), Text="Harry\nLarry\nSally\nCarrie"

ctl[3]: PUSHBUTTON, Text="Delete 1st Person", Size=(100,*)

ctl[5]: PUSHBUTTON, Text="Delete 2nd Person", Size=(100,*)

ctl[7]: PUSHBUTTON, Text="Reset Everyone", Size=(100,*)

ctl[11]: STATICTEXT, Text="People Left: ", Pos=(*, 100)

OnCtl(n): {

if (n==3 && e == FME_CLICKED) {

deleteCtlItem(0, 0);

}

if (n==5 && e == FME_CLICKED) {

deleteCtlItem(0, 1);

}

if (n==7 && e == FME_CLICKED) {

setCtlText(0, "Harry\nLarry\nSally\nCarrie");

}

return false;

}

OnFilterStart: {

setCtlTextv(11, "People Left: %d", getCtlItemCount(0));

return false;

}

</code>

== See Also ==

getCtlItemCount, deleteCtlItems, setCtlText, setCtlTextv, COMBOBOX, LISTBOX, TAB