Page 1 of 1

Listbox selections

Posted: Wed May 02, 2012 8:33 am
by Ross_ValuSoft
Hi everyone.

I have an application that stores the results of electrical safety tests on items in a hotel room, eg lamp, TV, hair dryer etc.

Sometimes the user puts the wrong tags on two items and wants to swap the results for the tag numbers. I show him all the results in the rows of a listbox. How can I highlight 2 rows in a listbox? If I can highlight 2 rows I can then simply use a button action to swap the tag numbers.

Thanks for your help.

Cheers,

Ross

Re: Listbox selections

Posted: Wed May 02, 2012 2:10 pm
by Enrico Maria Giordano
Do you mean Windows standard listboxes or FWH browses?

EMG

Re: Listbox selections

Posted: Wed May 02, 2012 3:01 pm
by Ross_ValuSoft
Thanks for your reply Enrico .... and happy birthday!

I display the candidates like this in my FWPPC application under Windows Mobile 6.5 ...

Code: Select all

        @ 20, 8 ListBox oLst ;
       Fields IIF( (ITEM_IN->RESULT == "5"), hFailed, ;
                 IIF( (ITEM_IN->RESULT == "6"), hvisual , ;
                 IIF( ( (ITEM_IN->RESULT == "2") .OR. ;
                        (ITEM_IN->RESULT == "3") .OR. ;
                          (ITEM_IN->RESULT == "4") ), hMoney, "" ) ) ) ,;
       ITEM_IN->SITE, ITEM_IN->LOCATION, ITEM_IN->Number, ITEM_IN->TAG_NUMB, ;
        IIF( empty( ITEM_IN->ITEM ), ITEM_IN->OTHER, ITEM_IN->ITEM ), ;
        IIF( ( val( ITEM_IN->Category ) < 8 ), aClasses[ val( ITEM_IN->Classes ) ], " " ), ;
        IIF( ( val( ITEM_IN->Category ) < 8 ), aFrequency[ val( ITEM_IN->Frequency ) ] , "Yearly" ) ;
       Alias "ITEM_IN" ;
       FieldSizes 18, 30, 40, 30, 50, 100, 100, 100 ;
       Headers '', 'Site','Where', '#', 'Tag', 'What', 'Class', 'Frequency' ;
       Size 240-20, 200-10 ;
       Pixel 
 
Hmmm, that didn't paste very neatly, but hopefully it makes sense.

Should I just use an "ON DBLCLICK" clause to do it perhaps?

Cheers,

Ross (heading to bed now at 1 am)

Re: Listbox selections

Posted: Wed May 02, 2012 4:44 pm
by Enrico Maria Giordano
It's a TWBrowse. Sorry, I think it's not possible to select more than one row.

EMG

Re: Listbox selections

Posted: Wed May 02, 2012 4:45 pm
by Enrico Maria Giordano
Ross_ValuSoft wrote:and happy birthday!
Thank you! :-)

EMG

Re: Listbox selections

Posted: Fri May 04, 2012 2:16 pm
by Ross_ValuSoft
Many thanks Enrico.

I read your answer and did not understand it. But I knew that you must be saying something very important ... so I then went and examined the source code for listbox and then the contents of fwce.ch and yes there it was in front of my nose ... a listbox using a dbf gets translated into a twbrowse and cannot use multiple selections. If it is a listbox of array elements then multiple selections can be made.

So now I must load my dbf file into an array, or ... is there some other way using FWPPC 10.2 of February 2010?

If I am correct this was the last release of FWPPC ... and probably will not be updated.

Best wishes,

Ross