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.

How You Can Work with ImagesPalette FieldsPaletteField objects display a list of values, represented as images, from whichthe user selects a single value. Like radio fields, all choices are alwaysdisplayed in a palette field. Therefore, the list should contain few choices.Each value in a palette field has text, an associated numeric value, and animage. PaletteField objects are mapped to variables of either varchar orinteger data type. However, regardless of the variable mapping, the palettefield always displays the list of choices as images.How You Can Insert an Image into a Palette FieldTo insert a bitmap object programmatically into a palette field, use theAddBitmapItem method defined for the ChoiceList system class. You wouldfollow these basic steps:1. Declare a variable of type BitmapObject.2. Load a DBHandle or FileHandle into the bitmap reference variable.3. Insert the image into the palette field using the AddBitmapItem method.4. Refresh the display using the UpdChoiceList method defined for theChoiceField system class.For example, the following statement from an initialize block adds a bitmapimage from the v_video_graphics table to the first item in a palette fieldnamed vidchoices:...declarebo = BitmapObject;enddeclarebeginbo.DBHandle = 'v_video_graphics:3';field(vidchoices).ValueList.AddBitmapItem(enumvalue=1, textvalue = 'comedy',bitmapvalue = bo);...To insert an image into each value of a palette field, declare an array ofBitmapObject and load the appropriate handle into each row of the array.How You Can Arrange the Display of Palette FieldsBecause palette fields (like radio fields) display all choices on the windowsimultaneously, they can be arranged to display in several columns. Toarrange the display in the Frame Editor, specify the number of columns on thefield's Property Inspector. To arrange the display programmatically, use theColumns and Orientation attributes defined for the PaletteField system class.280 <strong>Programming</strong> <strong>Guide</strong>

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

Saved successfully!

Ooh no, something went wrong!