MySql/MariaDB incremental seek does not work

MySql/MariaDB incremental seek does not work

Postby betoncu » Thu Jun 08, 2017 2: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: Select all  Expand view  RUN
#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
User avatar
betoncu
 
Posts: 126
Joined: Sat Oct 08, 2005 9:38 pm
Location: Cyprus (North)

Re: MySql/MariaDB incremental seek does not work

Postby nageswaragunupudi » Fri Jun 09, 2017 9: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: Select all  Expand view  RUN
           If nKey == VK_BACK .and. !Empty( ::cSeek )
 

Replace this line with the following line of code:
Code: Select all  Expand view  RUN
           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
User avatar
nageswaragunupudi
 
Posts: 10663
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 40 guests