FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour XBROWSE and any Key
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
XBROWSE and any Key
Posted: Sun Jul 31, 2022 08:54 AM
hi,

i do have
Code (fw): Select all Collapse
      @ 000, 400 XBROWSE oBrw SIZE 400, 540 PIXEL OF oDlg ON DBLCLICK DoShow( TVURL->TVURL ) FONT oFont ALIAS 'TVURL'

      ADD oCol TO oBrw DATA TVURL->TVCHNO HEADER "Channel"
      ADD oCol TO oBrw DATA TVURL->TVNAME HEADER "Name"

      oBrw:nMoveType := 5  // does stay in ROW ... but move to COL right
      oBrw:bKeyDown := { | nKey | IF( nKey == VK_RETURN, DoShow( TVURL->TVURL ), nil) }
      oBrw:bLDblClick = { || DoShow( TVURL->TVURL ) }  // dupe ?
      oBrw:bchange := { || Do_Store() }

      oBrw:CreateFromCode()

i can navigate with Cursor or Mouse and use ENTER or Dblckick.

but when type any a-z 1-0 Position in XBROWSE it "move" ... Position not "match" Index ...
so what is wrong with my Code :-)

need help please
greeting,

Jimmy
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: XBROWSE and any Key
Posted: Sun Jul 31, 2022 01:45 PM
Please add
Code (fw): Select all Collapse
oBrw:bSeek := nil
Regards



G. N. Rao.

Hyderabad, India
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: XBROWSE and any Key
Posted: Sun Jul 31, 2022 03:13 PM
hi,
nageswaragunupudi wrote:
Code (fw): Select all Collapse
oBrw:bSeek := nil

thx for Answer,

that Trick lead me to the Question : is there a \Sample to use Codeblock bSeek :-)
Code (fw): Select all Collapse
        bSeek,;      // block expresion for autoincremental search. It should return .T. when found
        ;            // Receives the string to search
greeting,

Jimmy
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: XBROWSE and any Key
Posted: Sun Jul 31, 2022 04:33 PM

bSeek is automatically generated by XBrowse internally, depending on the type of database (i.e., array,dbf,tdbf,ado, etc.)
Better not to attempt preparing our own bSeek.

Regards



G. N. Rao.

Hyderabad, India
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: XBROWSE and any Key
Posted: Mon Aug 01, 2022 05:27 AM
hi,

have found c:\fwh\samples\testxbrw.prg
Code (fw): Select all Collapse
oBrw:bSeek            := {|c| DbSeek( Upper( c ) ) }

seems easy to use ...
greeting,

Jimmy
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: XBROWSE and any Key
Posted: Mon Aug 01, 2022 08:19 AM
Jimmy wrote:hi,

have found c:\fwh\samples\testxbrw.prg
Code (fw): Select all Collapse
oBrw:bSeek            := {|c| DbSeek( Upper( c ) ) }

seems easy to use ...

Better you see the bSeek construction inside xbrowse.prg
Regards



G. N. Rao.

Hyderabad, India
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: XBROWSE and any Key
Posted: Mon Aug 01, 2022 05:36 PM
hi,
nageswaragunupudi wrote:Better you see the bSeek construction inside xbrowse.prg

Yes, you are right, it is all in Source Code

but i must "see" how it work to understand what Code "mean"
so, as FiveWin Newbie, i ask for working Sample
greeting,

Jimmy
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: XBROWSE and any Key
Posted: Mon Aug 01, 2022 06:58 PM
Code (fw): Select all Collapse
#include "fivewin.ch"

REQUEST DBFCDX

function Main()

   FWNumFormat( "E", .T. ) // European number format

   FERASE( "CUSTOMER.CDX"
   USE CUSTOMER NEW VIA "DBFCDX"
   FW_CdxCreate()

   XBROWSER "CUSTOMER" AUTOSORT


Please build and run this code in the samples folder.

This will demonstrate default Incremental Seek, SeekWild, Incremental Filter, Incremental Filter Wild
First play with it and then see the default XBrowse code.
Regards



G. N. Rao.

Hyderabad, India
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: XBROWSE and any Key
Posted: Mon Aug 01, 2022 07:06 PM
Some notes that may help you.

Please treat the syntax:
Code (fw): Select all Collapse
ADD TO oBrw
for creating columns as obsolete. This command was created many years back for compatibility with TCBrowse for easier migration from TCBrowse to TXBrowse.

Same way, please do not use the FIELDS clause for similar reasons.

Instead use COLUMNS syntax.

Better avoid them to take full advantage of all features of XBrowse,
Regards



G. N. Rao.

Hyderabad, India
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: XBROWSE and any Key
Posted: Mon Aug 01, 2022 07:25 PM
hi,
nageswaragunupudi wrote:
This will demonstrate default Incremental Seek, SeekWild, Incremental Filter, Incremental Filter Wild
First play with it and then see the default XBrowse code.

thx for Sample.
i will try it and "see" how it work

Question : will it work when have
Code (fw): Select all Collapse
SETKEY( ASC( "F" ), { || SwitchFull() } )

it seems me when type "f" it will always use SETKEY() ( not limited to WINDOW )
greeting,

Jimmy

Continue the discussion