10.07.2015 Views

Programming Guide - Actian

Programming Guide - Actian

Programming Guide - Actian

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Listview FieldsThe set_listview_images procedure sets up the SmallImageList andLargeImageList arrays of the listview field. SmallImageList and LargeImageListare arrays of bitmapobjects. In this example, the bitmaps display letters, andthe nth item of each array is a bitmap representing the nth letter of thealphabet.The next step in setting up the listview field is to associate bitmaps with eachitem in the names array. This example uses the bitmap corresponding to thefirst letter of the last name. The set_image_indexes procedure calculates theappropriate bitmap index for each item in the names array and stores theindex in the image_index attribute.Initially, the name array is sorted by last name. The sort_names_arrayprocedure sorts the array using the values of sort_column and sort_order todetermine how the array is sorted.Finally, the load_listview procedure is called to load the listview field with data.How You Can Load the Listview Field with DataA listview field is a choice field, and like other choice fields has a ValueListattribute. The ValueList attribute is a ChoiceList. Unlike the other choice fields,the ChoiceItems attribute of the ValueList of a listview field is an array ofChoiceDetail objects. Each ChoiceDetail object contains information about arow in the listview field.The ChoiceDetail class has the following attributes:EnumDisplayContains the text, which is displayed in the first column of the listviewEnumTextContains a text stringEnumValueContains an integer value that you may use to identify an item in the listIsSelectedIndicates at runtime whether the item is currently selectedEnumBitmapIs not used by listview fieldsEnumSubTextSpecifies an array of StringObjects. The nth item in the array contains thetext that is displayed in column n + 1 of the listview.Working with List Views and Tree Views 263

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!