FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Which event to display latest value of cSeek IN XBROWSE ?
Posts: 336
Joined: Mon Dec 07, 2009 02:49 PM
Which event to display latest value of cSeek IN XBROWSE ?
Posted: Sat Nov 23, 2013 12:54 PM

Hi All ,

Which event we should use to display/get value of cSeek in XBROWSE. if I use bKeychar it does not display latest value because the bKeychar block evaluates before changing ::cSeek variable.

Thanks
Shridhar

Thanks

Shridhar

FWH 24.04, BCC 7 32 bit, MariaDB
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Which event to display latest value of cSeek IN XBROWSE ?
Posted: Mon Nov 25, 2013 08:30 AM

If the purpose is to display oBrw:cSeek then what we are required to do is :

@ nRow, nCol SAY oBrw:oSeek PROMPT oBrw:cSeek SIZE 100,20 OF oDlg

XBrowse automatically updates the SAY.

oBrw:cSeek is updated only after successful seek and refresh.

If you want to know the value prior to seek,

oBrw:bSeek := { |cSeek| MsgInfo( cSeek ), .... yourseekfunc( cSeek ) }

Regards



G. N. Rao.

Hyderabad, India
Posts: 336
Joined: Mon Dec 07, 2009 02:49 PM
Re: Which event to display latest value of cSeek IN XBROWSE ?
Posted: Mon Nov 25, 2013 09:38 AM

Dear Sir ,

In 12.08 I was using bChange block to populate cSeek value in a Get Objects like oBrw:bChange{ |oGet| oGet:TextOut( cSeek ) }. But the same code does not work in FWH 13.09. so thats why I posted this query.

if we have bPostSeek or bPostAlEvents blocks that would be great because we have almost inbuilt seek functions for the different database. I am using Dolphin Lib.

Thanks
Shridhar

Thanks

Shridhar

FWH 24.04, BCC 7 32 bit, MariaDB
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Which event to display latest value of cSeek IN XBROWSE ?
Posted: Mon Nov 25, 2013 10:58 AM
Code (fw): Select all Collapse
oBrw:bChange{ |oGet| oGet:TextOut( cSeek ) }

How is this code valid?
Did you mean
Code (fw): Select all Collapse
oBrw:bChange := { |oGet| oGet:TextOut( cSeek ) }

?
Even then this is not correct in any version because xbrowse evaluates :bchange with Self ( browse object ) as parameter but not any Get object.

Eval( ::bChange, Self, lRow )

How can a Get object be a parameter to this codeblock?

XBrowse does not have to do anything with any get object on its own.
This applies to all versions.
Regards



G. N. Rao.

Hyderabad, India
Posts: 336
Joined: Mon Dec 07, 2009 02:49 PM
Re: Which event to display latest value of cSeek IN XBROWSE ?
Posted: Mon Nov 25, 2013 07:38 PM
Dear Sir ,

Sorry...! I had not given correct the code as I was in office so I could not recall the correct code. Anyway I have given the code which works fine in FWH 12.08 BUT NOT IN 13.09.


Code (fw): Select all Collapse
   DEFINE DIALOG oLovWnd FROM nTop , nLeft TO  nBottom, nRight  STYLE nOr( DS_MODALFRAME, WS_POPUP ) PIXEL

   @ 0 , 0 XBROWSE oLovBrw SIZE nLovWidth, nLovHight PIXEL ;
      OF oLovWnd  FONT oApp:oFontBrw1 ;
      COLUMNS oGet:xaCols;
      OBJECT oQry AUTOSORT

     //HEADERS oGet:xaHeaders ;

   oLovBrw:nMarqueeStyle       := MARQSTYLE_HIGHLROW

    oLovBrw:bClrSelFocus :=   { || {  nRGB( 255, 255, 255 ) , nRGB( 0, 0, 160 ) } }
   oLovBrw:bChange  := { || ( oGet:cText( oLovBrw:cSeek ) )   }  // here the GET update with the latest value of cSeek but this does not work in 13.09
   oLovBrw:bKeyChar := { | n, f | IIf( n == VK_RETURN , ( oGet:cText( AllTrim( ( oQry:FieldGet( oGet:xuGetField ) ) ) ), oLovWnd:END() )  , NIL ) }


Thanks
Shridhar
Thanks

Shridhar

FWH 24.04, BCC 7 32 bit, MariaDB
Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
Re: Which event to display latest value of cSeek IN XBROWSE ?
Posted: Sat Nov 30, 2013 01:08 PM

Shri;

Check out the oSeek property of the xbrowse class.

oBrw:oSeek := … some previously declared TGet object. I think that's what you are looking for.

Reinaldo.

Posts: 336
Joined: Mon Dec 07, 2009 02:49 PM
Re: Which event to display latest value of cSeek IN XBROWSE ?
Posted: Sat Nov 30, 2013 04:40 PM

Hi Reinaldo,

I tried the oBrw:oSeek as well but cSeek value and oSeek  value does NOT synchronize properly. oBrw:oSeek updates later than cSeek for instance if cSeek shows "India" whereas in the GET box it shows "Indi" the last letter "a" does not shows in the oSeek ( GET box).  oBrw:cSeek works fine but that is not my need I want to display the latest value in GET.
Thanks

Shridhar

FWH 24.04, BCC 7 32 bit, MariaDB
Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
Re: Which event to display latest value of cSeek IN XBROWSE ?
Posted: Sat Nov 30, 2013 04:46 PM
Shri;

That has not been my experience with xbrowse's oseek property. I use oSeek on every xbrowse to show current auto-increment seek text. Here is some code that is currently in production:

Code (fw): Select all Collapse
   REDEFINE GET oGet3 VAR cSeek ID 100 OF oDlg WHEN .f.

   WITH Object oBrw

      :oSeek := oGet3
      :bSeek := {|c| ::oDbf:Seek( upper( c ) ) }


Perhaps you can write a short self-contained sample to demonstrate the problem. I'm sure someone will be able to help.


Reinaldo.
Posts: 336
Joined: Mon Dec 07, 2009 02:49 PM
Re: Which event to display latest value of cSeek IN XBROWSE ?
Posted: Sat Nov 30, 2013 05:20 PM
Hi Reinaldo ,

Here the codeI wrote. I am calling the Incremental function in the bChange codeblock which is belongs to same GET that I want to display cSeek value in that.
I am not sure whether this will work or not.

Code (fw): Select all Collapse
// CALLING INCREMENTAL SEARCH FUNCTION IN THE GET bChange Event. 
   oGet:bChange  :=  < | n, f |
                                      myListIncr( oGet ,"Select Item_Name from Item_mast order item_name ",{"item_name"},"item_name" )
                                      oWnd:Update()
                      >





//------------------------------------------------------------------------------

FUNCTION myListIncr( oGet , cSqlQry , aCols , cGetField )

   LOCAL oLovBrw
   LOCAL nWnd_H  := ( LST_CHARPIX_H * 15 )
   LOCAL cKeyID
   LOCAL nLovHight
   LOCAL nLovWidth
   LOCAL oLovWnd
   LOCAL oQry
   LOCAL j

   aGCoors := GetWndRect( oGet:hWnd )

   nTop    := aGCoors[ 1 ] + ( ( aGCoors[ 3 ] - aGCoors[ 1 ] )  + 1 )
   nLeft   := aGCoors[ 2 ]
   nBottom := aGCoors[ 3 ] + ( ( aGCoors[ 3 ] - aGCoors[ 1 ] ) * 20 )
   nRight  := aGCoors[ 4 ]
   nLovHight :=  ( nBottom - nTop ) / 2
   nLovWidth :=  ( nRight - nLeft ) / 2


   nLovHight := nLovHight - 10

   oQry := oApp:gDBServer:Query( cSqlQry )

   DEFINE DIALOG oLovWnd FROM nTop , nLeft TO  nBottom, nRight  STYLE nOr( DS_MODALFRAME, WS_POPUP ) PIXEL

   @ 0 , 0 XBROWSE oLovBrw SIZE nLovWidth, nLovHight PIXEL ;
      OF oLovWnd  FONT oApp:oFontBrw1 ;
      COLUMNS aCols;
      OBJECT oQry AUTOSORT

   oLovBrw:nMarqueeStyle       := MARQSTYLE_HIGHLROW
   oLovBrw:lIncrFilter        := .T.


   oLovBrw:bClrSelFocus :=   { || {  nRGB( 255, 255, 255 ) , nRGB( 0, 0, 160 ) } }
   oLovBrw:oSeek := oGet
   oLovBrw:bKeyChar := { | n, f | IIf( n == VK_RETURN , oLovWnd:END()  , NIL  ) }
   oLovBrw:lHeader  := .F.
   oLovBrw:lFooter  := .F.
   oLovBrw:lHScroll := .F.
   oLovBrw:lRecordSelector := .F.


   oQry:Seek( Upper( AllTrim( oGet:cText() ) ) ,  cGetField , , ,.T. )

   oLovBrw:CreateFromCode()
   oLovWnd:oClient := oLovBrw


   @ nLovHight+1, 00 SAY oLovBrw:oSeek PROMPT oLovBrw:cSeek SIZE 150, 10 PIXEL ;
      FONT oApp:fBold  OF oLovWnd


   ACTIVATE DIALOG oLovWnd   ON INIT ( oLovBrw:SetFocus() )


   oQry:END()


   oGet:oWnd:GoNextCtrl( oGet:hWnd )  // Move NEXT Control


   RETURN cKeyID
Thanks

Shridhar

FWH 24.04, BCC 7 32 bit, MariaDB
Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
Re: Which event to display latest value of cSeek IN XBROWSE ?
Posted: Sat Nov 30, 2013 05:54 PM
Why not try the sample code I provided. I use a get to show the incremental search and never call any function to refresh the info on the get. Xbrowse does this on it self. Try it like this:

Code (fw): Select all Collapse
REDEFINE GET oGet3 VAR cSeek ID 100 OF oDlg WHEN .f.
…

oBrw:oSeek := oGet3 
…


No need to call oGet:bChange. Please do notice, focus needs to be on the xbrowse while the user types. The user does not need to bring focus to the get objet. On my sample code the Tget object never gains focus.


Reinaldo.
Posts: 336
Joined: Mon Dec 07, 2009 02:49 PM
Re: Which event to display latest value of cSeek IN XBROWSE ?
Posted: Sat Nov 30, 2013 08:45 PM
Hi Reinaldo ,

My requirement is bit different. I tried to explain the requirement as below.

I have 3 TGETs and 1 and 3 GETS normal GETs they do not have special events. When user enter in the 2nd GET and press a key the XBROWSE list will be opened
for incremental search and user selects value from the list and moves to next GET ( 3rd GET) control. For this implementation I have called XBROWSE in TGET's bChange block.
Code (fw): Select all Collapse
  // 3 TGETs
    @50,  120 GET aoGET[ 1 ] VAR AD_ACCT_NAME SIZE 325 , C_GETH  PIXEL OF oWnd ;
      NOBORDER COLOR C_FCLR, C_BCLR FONT oApp:oFontGet UPDATE

   @80,  120 GET aoGET[ 2 ] VAR AD_AGRP_NAME SIZE 325 , C_GETH  PIXEL OF oWnd ;
      NOBORDER COLOR C_FCLR, C_BCLR FONT oApp:oFontGet UPDATE


   @210, 120 GET aoGET[3 ] VAR AD_OP_BAL PICTURE C_FORMAT_AMT SIZE 125, C_GETH PIXEL Right OF oWnd ;
      VALID ! ( AD_OP_BAL < 0 ) ;
      NOBORDER COLOR C_FCLR, C_BCLR FONT oApp:oFontGet UPDATE

 // 2nd GET has bChange to Call XBROWSE 
// As soon as user press a key the list open to search values 
   aoGET[ 2 ]:bChange  :=   < | n, f |
                                      myListIncr( oGet ,"Select Item_Name from Item_mast order item_name ",{"item_name"},"item_name" )
                                      oWnd:Update()
                      >


Detailed information of the requirement is given in the below post
viewtopic.php?f=3&t=27673
Thanks

Shridhar

FWH 24.04, BCC 7 32 bit, MariaDB
Posts: 336
Joined: Mon Dec 07, 2009 02:49 PM
Re: Which event to display latest value of cSeek IN XBROWSE ?
Posted: Tue Dec 03, 2013 09:23 AM

Hi Reinaldo ,

Could you please let me know your view in this requirement whether it is possible to implement in FWH ?.

Thanks

Shridhar

FWH 24.04, BCC 7 32 bit, MariaDB
Posts: 336
Joined: Mon Dec 07, 2009 02:49 PM
Re: Which event to display latest value of cSeek IN XBROWSE ?
Posted: Wed Dec 04, 2013 08:04 AM

Hi All,

Requesting to all FWH users...!

Thanks

Shridhar

FWH 24.04, BCC 7 32 bit, MariaDB
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Which event to display latest value of cSeek IN XBROWSE ?
Posted: Tue May 13, 2014 03:44 PM
I added seek to my project-browser and used
REDEFINE XBROWSE oData ID 120 OF oDlg3 AUTOSORT
and
REDEFINE SAY oData:oSeek PROMPT oData:cSeek ID 145 OF oDlg3 FONT oFont1
oData:Setcolor( 255, 16772313 )

for the xBrowse.

Seek is working, but only with one char.
Maybe still something missing or maybe a problem using resources ?

1. structure-browser
2. data-browser



Best regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Which event to display latest value of cSeek IN XBROWSE ?
Posted: Wed May 14, 2014 01:48 AM
REDEFINE XBROWSE oData ID 120 OF oDlg3 AUTOSORT

You should also add here "DATASOURCE <yourdatasource> COLUMNS <fieldnames>"
Regards



G. N. Rao.

Hyderabad, India