FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Combobox Problem
Posts: 708
Joined: Fri Oct 28, 2005 09:53 AM
Combobox Problem
Posted: Wed Feb 21, 2007 06:39 PM

Hello,

When the user presses a character to move to the item within a COMBOBOX, it does not work. I updated to version 7.01.

*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Combobox Problem
Posted: Wed Feb 21, 2007 11:05 PM

I noticed that too.

To solve it for the moment, I linked in the COMBOBOX.PRG from FW 2.7.

Now it's working fine.

Regards,

Michel

Regards,

Michel D.
Genk (Belgium)


_____________________________________________________________________________________________

I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 708
Joined: Fri Oct 28, 2005 09:53 AM
Combobox Problem
Posted: Wed Feb 21, 2007 11:16 PM

Hi Michel,

Thank you. Can you send me the 2.7 PRG as I over wrote my version with the update.

*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Combobox Problem
Posted: Thu Feb 22, 2007 12:16 AM

No problem.

Here it is.

Just copy and paste and you've got is.

Michel

edited by admin

Regards,

Michel D.
Genk (Belgium)


_____________________________________________________________________________________________

I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 283
Joined: Sat Oct 15, 2005 06:40 AM
Re: Combobox Problem
Posted: Sun Mar 04, 2007 01:55 PM
cdmmaui wrote:When the user presses a character to move to the item within a COMBOBOX, it does not work. I updated to version 7.01.

Yes, confirm!

for solve, replace the method KeyChar with this:
//----------------------------------------------------------------------------//

METHOD KeyChar( nKey, nFlags ) CLASS TComboBox

   local nNewAT := 0, nOldAT := ::nAT, uItem

   do case
      case nKey = 32   // VK_DELETE (DO NOT WORK!)
           ::cSearchKey := ""
           nNewAt := 1
           uItem := ::aItems[nNewAt]
           
      case nKey = VK_BACK
           ::cSearchKey := Left( ::cSearchKey, Len( ::cSearchKey ) - 1 )
           
      case nKey = 190
           nKey := 0
           ::cSearchKey += "."
           
      otherwise
           ::cSearchKey += Upper( Chr( nKey ) )
           
   endcase
   
   if Empty( uItem )
      if nNewAt == 0
         nNewAt := AScan( ::aItems, {|x| Upper(x) = ::cSearchKey } )
         IF nNewAt > 0 .AND. Len( ::aItems ) <= nNewAt
            uItem := ::aItems[ nNewAt ]
         ENDIF
         uItem := ::aItems[ IIF( nNewAt > 0, nNewAt, Max( ::nAT, 1 ) ) ]
      else
         uItem := ::aItems[ Max( nNewAt, 1) ]
      endif
   endif
   ::Set( uItem )

   if ::bChange != nil .and. ( nNewAT != nOldAt .and. nNewAt != 0 )
      Eval( ::bChange, Self, ::varGet() )
   endif

   if nKey == VK_RETURN
      return ::oWnd:GoNextCtrl( ::hWnd )
   endif

return 0   // Must be 0 - We don't want API default behavior.
Ciao, best regards,

Ugo
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Combobox Problem
Posted: Sun Mar 04, 2007 07:51 PM

FWH 7.01 implements incremental search in comboboxes, thats why if you press two chars, one after another, if searches for the item that starts with both chars (implemented by Ugo).

Ugo, thanks for the fix :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion