Incremental Search on Combobox dropdown (not dropdownlist)

Incremental Search on Combobox dropdown (not dropdownlist)

Postby Rick Lipkin » Mon Dec 17, 2012 2:52 pm

To All

I have searched the forum and I see several subjects on this topic, however, I do not seem to find an answer ?

I have no problem using DropDownList .. however, I need to be able have it search like CBS_DROPDOWN. The reason is because if the value is not found in the array, I want to be able to manually type it in... FWH 1203.

Thanks
Rick Lipkin

ps .. I noticed that in the DropDownList .. only the first character is evaluated :(
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Incremental Search on Combobox dropdown (not dropdownlist)

Postby MarcoBoschi » Mon Dec 17, 2012 5:00 pm

Try this

Code: Select all  Expand view
#include "fivewin.ch"
FUNCTION MAIN
LOCAL oDlg
LOCAL oGet, cGet := "   "
LOCAL oCombo, cCombo := "                                 "
LOCAL aItems := { "ANDREA                           " , ;
                  "ANTONIO                          " , ;
                  "BARBARA                          " , ;
                  "BEPPE                            " , ;
                  "BIRILLO                          " , ;
                  "BIROLLO                          " , ;
                  "BIRULLO                          " , ;
                  "CAVALIERE                        " , ;
                  "CAVALLO                          " , ;
                  "DEMETRIO                         " }


DEFINE DIALOG oDlg FROM 10 , 10 TO 20 , 60

@ 1 , 1 COMBOBOX oCombo VAR cCombo OF oDLG ITEMS aItems STYLE CBS_DROPDOWN SIZE 100 , 200
@ 1 , 20 GET oGet VAR cGet OF oDlg

oCombo:lIncSearch := .T.
oCombo:oGet:bKeyChar = { | nKey | oCombo:KeyChar( nKey ) }

ACTIVATE DIALOG oDlg CENTER

RETURN NIL
 
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: Incremental Search on Combobox dropdown (not dropdownlist)

Postby Rick Lipkin » Mon Dec 17, 2012 5:56 pm

Marco

Thank you for your suggestion .. I did see this example and to some extent it works but you have to open the drop down and type your value and if it is not found it returns some unwanted symbols.

Rick Lipkin

Image
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Incremental Search on Combobox dropdown (not dropdownlist)

Postby MarcoBoschi » Tue Dec 18, 2012 7:42 am

Rick,
here it works fine.
I believe you.
Version problems?
let's wait for another suggestion from some developer
marco
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: Incremental Search on Combobox dropdown (not dropdownlist)

Postby Gale FORd » Tue Dec 18, 2012 2:13 pm

This is untested but you may be able to drop down the list when first key is pressed.
oCombo:oGet:bKeyChar = { | nKey | if( oCombo:IsClosed(), oCombo:Open(), nil), oCombo:KeyChar( nKey ) }
Gale FORd
 
Posts: 663
Joined: Mon Dec 05, 2005 11:22 pm
Location: Houston

Re: Incremental Search on Combobox dropdown (not dropdownlist)

Postby James Bott » Sun Dec 23, 2012 1:06 am

User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 66 guests