Older Newer
Sun, 15 Dec 2019 12:13:07 . . . . SyneRyder [Add additional See Also links]


Changes by last author:

Added:
= deleteCtlItems =

Warning: This function causes memory access violations, do not use.

== Syntax ==

int deleteCtlItems(int n)

== Arguments ==

:n

::The number of the listbox/combobox control to delete all items from

== Return ==

Returns false if the control number is out of range, not in use, or not a LISTBOX, COMBOBOX or TAB control.

== Description ==

Deletes all items in a LISTBOX, COMBOBOX or a TAB control.

== Comment ==

Please do not use this function. Note that there is currently a bug in this function that causes memory access violations, resulting in a crash in the host application when used with listboxes & comboboxes. As a workaround, use setCtlText(n,"") instead to reset the text contents to zero, which is the same as what FilterMeister does internally (or at least, is meant to).

== Example ==

<code>

%fml

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

ctl[4]: PUSHBUTTON, Text="Delete Everyone", Size=(100,*)

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

OnCtl(n): {

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

// Due to a bug, this next line

// causes a memory access violation

//deleteCtlItems(0);

// As a workaround, do this instead

setCtlText(0, "");

}

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

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

}

return false;

}

</code>

== See Also ==

deleteCtlItem, setCtlText, COMBOBOX, LISTBOX, TAB