DDgui Programmers Reference Guide by Nicholas J. Kingsley - HTML preview

PLEASE NOTE: This is an HTML preview only and some elements such as links or page numbers may be incorrect.
Download the book in PDF, ePub, Kindle for a complete version.

Inserting and Deleting Text

 

List Boxes

 

With list boxes, there are two functions used to add and remove lines of text.  These are :

 

DDgui_insertitem%: id$, text$, before_index%

 

id$ is the ID of the list box, text$ is the text to be added, and before_index% is the position that you want to insert the text. 

 

If before_index%>=0 then the text will be inserted at that line position – don’t forget that line numbering starts at 0!

 

If before_index%<0 then the text will be appended to the end of the list

 

Removing lines from list boxes is done with :

 

DDgui_deleteitem%: id$, index%

 

id$ is the ID of the list box, and index% is the line that you want to delete.  If this value is < 0 then everything will be deleted.

 

Edit Boxes

 

With edit boxes, you would need to use DDgui_get to get the text from the edit box, split into lines, delete or append as appropriate and then put the new text back in using DDgui_set