10.07.2015 Views

Programming Guide - Actian

Programming Guide - Actian

Programming Guide - Actian

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Treeview FieldsThe tree_ex2_class has the following attributes:fldSpecifies a formfield, the field that corresponds to the nodeoriginal_bgcolorSpecifies an integer, the original background color of the fieldcolor_changedSpecifies an integer, a flag to indicate that the background color waschangedThe fld attribute allows access to the field on the frame sample_frame. HowYou Can Use Bitmap Labels (see page 274) shows how the other two attributesare used.How You Can Use Bitmap LabelsA treeview field has an attribute, ImageList, which is an array of bitmaps. Intree_example_2, the set_up_bitmaps procedure sets up the ImageList. In thiscase, there are three bitmaps: a gray circle, a blue circle, and a red circle.Each of the variables gray, blue, and red contains the index in the ImageListarray of the corresponding bitmap.A tree node has attributes BmpLblIndx and SelBmpLblIndx. You may specifybitmap labels to be displayed with the node by setting BmpLblIndx andSelBmpLblIndx. If BmpLblIndx is a valid index in the array ImageList, thecorresponding bitmap label is displayed when the node is not selected; ifSelBmpLblIndx is a valid index, the corresponding bitmap label is displayedwhen the node is selected.The first treeview example uses no bitmap labels. The second exampleillustrates the use of bitmap labels. When a node is selected, its bitmap label isblue. Initially, the bitmap label is gray when a node is not selected. When youselect a node with a gray bitmap label, the background color of thecorresponding field is changed to red, and BmpLblIndx is changed to red.When you select a node with a red bitmap label, the background color of thecorresponding field is changed back to its original color, and BmpLblIndx is setto gray. The code that changes the bitmap labels is in the event block onsetvalue tvf.How You Can Delete NodesYou can use the DeleteNode method to delete a node from a tree.274 <strong>Programming</strong> <strong>Guide</strong>

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

Saved successfully!

Ooh no, something went wrong!