XBROWSE and any Key

XBROWSE and any Key

Postby Jimmy » Sun Jul 31, 2022 8:54 am

hi,

i do have
Code: Select all  Expand view
     @ 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
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: XBROWSE and any Key

Postby nageswaragunupudi » Sun Jul 31, 2022 1:45 pm

Please add
Code: Select all  Expand view
oBrw:bSeek := nil
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10619
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: XBROWSE and any Key

Postby Jimmy » Sun Jul 31, 2022 3:13 pm

hi,
nageswaragunupudi wrote:
Code: Select all  Expand view
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 view
       bSeek,;      // block expresion for autoincremental search. It should return .T. when found
        ;            // Receives the string to search
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: XBROWSE and any Key

Postby nageswaragunupudi » Sun Jul 31, 2022 4: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
User avatar
nageswaragunupudi
 
Posts: 10619
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: XBROWSE and any Key

Postby Jimmy » Mon Aug 01, 2022 5:27 am

hi,

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

seems easy to use ...
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: XBROWSE and any Key

Postby nageswaragunupudi » Mon Aug 01, 2022 8:19 am

Jimmy wrote:hi,

have found c:\fwh\samples\testxbrw.prg
Code: Select all  Expand view
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
nageswaragunupudi
 
Posts: 10619
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: XBROWSE and any Key

Postby Jimmy » Mon Aug 01, 2022 5: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
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: XBROWSE and any Key

Postby nageswaragunupudi » Mon Aug 01, 2022 6:58 pm

Code: Select all  Expand view

#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: 10619
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: XBROWSE and any Key

Postby nageswaragunupudi » Mon Aug 01, 2022 7:06 pm

Some notes that may help you.

Please treat the syntax:
Code: Select all  Expand view
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
nageswaragunupudi
 
Posts: 10619
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: XBROWSE and any Key

Postby Jimmy » Mon Aug 01, 2022 7: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: Select all  Expand view
SETKEY( ASC( "F" ), { || SwitchFull() } )

it seems me when type "f" it will always use SETKEY() ( not limited to WINDOW )
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 67 guests