Enhanced List View

From PxPlus

Jump to: navigation, search

The List View control has been enhanced to allow for the inclusion of multiple bitmaps within the data along with a number of new properties.

Multiple Bitmap Support

When a column starts with a 'PICTURE' mnemonic the system will insert the image associated with the mnemonic into the list view row.

For Example -- the following program displays a check mark for those sales reps making over 100K and a Star for those over $500K

0010 BEGIN 
0020 LET FORMAT$="[SalesRep]10 [Name]18 [Dept]C8 [Quota]R14 [Merit]10"
0030 LIST_BOX 10,@(5,5,60,15),OPT="rV",FMT=FORMAT$,FNT="*guifont"
0040 WHILE 1
0050 READ ("/users/mike king/demo/data/salesrep",END=*BREAK)
0060 IF YTDSALES>=100000 THEN LET QUOTA$="!checkedbox" ELSE LET QUOTA$="!xinbox"
0070 LET QUOTA$='PICTURE'(0,0,0,0,QUOTA$)
0080 IF YTDSALES>500000 THEN LET QUOTA$+='PICTURE'(0,0,0,0,"!Star")
0090 LIST_BOX LOAD 10,0,SALESREPCODE$+SEP+NAME$+SEP+DEPARTMENT$+SEP+STR(YTDSALES:"$#,###,##0")+SEP+QUOTA$+SEP
0100 WEND 
0110 INPUT *

When run the output will look something like this:

Sample list view output with images

NOTE: The position/size values within the 'PICTURE' mnemonic are ignored. All pictures used within a list view should be the same size.

Text may also be included within the field contents following the 'PICTURE' mnemonic and will appear to the right of the image.

New Properties

The following properties have been added to the listview control with Version 9:

  • 'ColumnSizeLock
If non-zero then the user will not be allowed to resize the columns (cursor will change but user will not be allowed to drag/alter column size)
  • 'HeaderLock
If non-zero then the header is locked; that is no resize and no option to click for sorting will be provided. Moving the mouse over the list view header will not highlight the column header.
Personal tools