FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour MySql/MariaDB incremental seek does not work
Posts: 130
Joined: Sat Oct 08, 2005 09:38 PM
MySql/MariaDB incremental seek does not work
Posted: Thu Jun 08, 2017 02:00 PM
If you hit once to the space bar it goes to the first record and then you can never do an incremental search.

Code (fw): Select all Collapse
#include "fivewin.ch"

function Main()

   local oCn, oRs, oDlg, oBrw

   FWNumFormat( "A", .t. )

   oCn   := FW_DemoDB()

   oRs   := oCn:RowSet( "SELECT ID,FIRST,CITY FROM customer ORDER BY FIRST" )

   DEFINE DIALOG oDlg SIZE 500,600 PIXEL TRUEPIXEL TITLE "Incremental Seek"

   @ 70,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
           DATASOURCE oRs AUTOCOLS ;
           COLSIZES -4, -20, -20 ;
           CELL LINES NOBORDER FOOTERS ;
           AUTOSORT

   oBrw:CreateFromCode()

   ACTIVATE DIALOG oDlg CENTERED

return nil
Birol Betoncu
birol.betoncu@gmail.com
Using Harbour, FWH 19.05, BCC7
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: MySql/MariaDB incremental seek does not work
Posted: Fri Jun 09, 2017 09:48 AM
Thanks for reporting the issue.

First we need to fix XBrowse. If we first press <space> ( one or more ) and then press <backspace>, the <backspace> is not working and clearing the spaces.

This is the fix:
METHOD KeyChar( nKey, nFlags ) CLASS TXBrowse
Please locate this line of code:
Code (fw): Select all Collapse
            If nKey == VK_BACK .and. !Empty( ::cSeek )

Replace this line with the following line of code:
Code (fw): Select all Collapse
            If nKey == VK_BACK .and. ::cSeek != nil .and. Len( ::cSeek ) > 0


Now the user can enter backspace to clear the space key already entered and press any key wants to seek.
This should solve the problem for now.

Next:
The behavior of going to top when space key is pressed is also not correct. Pressing space key should result in seeking to a blank value or a value with starts with space. If such a value is not found, the space key should be rejected.
This is fixed in the current version now.
Regards



G. N. Rao.

Hyderabad, India

Continue the discussion