XBROWSE and any Key

Post Reply
User avatar
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

XBROWSE and any Key

Post by Jimmy »

hi,

i do have

Code: Select all | Expand

     @ 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
User avatar
nageswaragunupudi
Posts: 10729
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 10 times
Contact:

Re: XBROWSE and any Key

Post by nageswaragunupudi »

Please add

Code: Select all | Expand

oBrw:bSeek := nil
Regards

G. N. Rao.
Hyderabad, India
User avatar
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

Re: XBROWSE and any Key

Post by Jimmy »

hi,
nageswaragunupudi wrote:

Code: Select all | Expand

oBrw:bSeek := nil

thx for Answer,

that Trick lead me to the Question : is there a \Sample to use Codeblock bSeek :?:

Code: Select all | Expand

       bSeek,;      // block expresion for autoincremental search. It should return .T. when found
        ;            // Receives the string to search
greeting,
Jimmy
User avatar
nageswaragunupudi
Posts: 10729
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 10 times
Contact:

Re: XBROWSE and any Key

Post by nageswaragunupudi »

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
User avatar
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

Re: XBROWSE and any Key

Post by Jimmy »

hi,

have found c:\fwh\samples\testxbrw.prg

Code: Select all | Expand

oBrw:bSeek            := {|c| DbSeek( Upper( c ) ) }

seems easy to use ...
greeting,
Jimmy
User avatar
nageswaragunupudi
Posts: 10729
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 10 times
Contact:

Re: XBROWSE and any Key

Post by nageswaragunupudi »

Jimmy wrote:hi,

have found c:\fwh\samples\testxbrw.prg

Code: Select all | Expand

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
User avatar
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

Re: XBROWSE and any Key

Post by Jimmy »

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
User avatar
nageswaragunupudi
Posts: 10729
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 10 times
Contact:

Re: XBROWSE and any Key

Post by nageswaragunupudi »

Code: Select all | Expand


#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
User avatar
nageswaragunupudi
Posts: 10729
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 10 times
Contact:

Re: XBROWSE and any Key

Post by nageswaragunupudi »

Some notes that may help you.

Please treat the syntax:

Code: Select all | Expand

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
User avatar
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

Re: XBROWSE and any Key

Post by Jimmy »

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: Select all | Expand

SETKEY( ASC( "F" ), { || SwitchFull() } )

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