xbrowse autosort

xbrowse autosort

Postby lucasdebeltran » Wed May 29, 2013 4:52 pm

Hello,

I need to set autosort feature later.

I do oBrowse:lAutoSort := .T., but in xbrowse.prg it says as a comment:
// used internally. do not use in applications


Is it safe to use?.

Thank you.
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: xbrowse autosort

Postby nageswaragunupudi » Thu May 30, 2013 12:59 am

Is it safe to use?.

This data is used internally and temporarily till creation of the browse.

Once the browse is created, changing this value has no effect.

For now I have this suggestion:

In the method SetOrder() of TXBrwColumn
Substitute this line at the beginning of the method
Code: Select all  Expand view
  if ::cSortOrder != nil
 

with
Code: Select all  Expand view
  if ::oBrw:lAutoSort .and. ::cSortOrder != nil
 


First create the browse with AUTOSORT clause.
And later toggle oBrw:lAutoSort := .t. or .f. whenever you want.

This feature is being provided in FWH13.05 whether or not the browse is created with AUTOSORT initially.
Regards

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

Re: xbrowse autosort

Postby albeiroval » Thu May 30, 2013 3:34 am

Mr Nages,

As I can use incremental seek with tdolphin ?

Thank you.
Saludos,
Regards,

Albeiro Valencia
www.avcsistemas.com
User avatar
albeiroval
 
Posts: 370
Joined: Tue Oct 16, 2007 5:51 pm
Location: Barquisimeto - Venezuela

Re: xbrowse autosort

Postby nageswaragunupudi » Thu May 30, 2013 7:02 am

Both Incremental Seek and Incremental Filter work with TDolphin.

1. Incremental Seek ( Works by default )
2. Incremental WildSeek ( DOES NOT WORK )
3. Incremental Filter ( Works )
4. Incremental Wild Filter ( Works )

Incremental seek works by default, if there is a sorted column known to XBrowse. The test is that you should be seeing arrow bitmap on one of the headers.

For incremental filters to work either there should be a sorted column known to xbrowse or you may assign oBrw:cFilterFld, in addition to setting oBrw:lIncrFilter to .t.
Regards

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

Re: xbrowse autosort

Postby albeiroval » Thu May 30, 2013 3:26 pm

Mr Rao,

You will have a small example of how to use the codeblock: bSeek?

well with in DBFCDX used,
: bSeek = {| c | (oBrw: cAlias​​) -> (DBSEEK (Upper (c). t.))}

Thank you,

Regards,
Saludos,
Regards,

Albeiro Valencia
www.avcsistemas.com
User avatar
albeiroval
 
Posts: 370
Joined: Tue Oct 16, 2007 5:51 pm
Location: Barquisimeto - Venezuela

Re: xbrowse autosort

Postby nageswaragunupudi » Thu May 30, 2013 3:53 pm

albeiroval wrote:Mr Rao,

You will have a small example of how to use the codeblock: bSeek?

well with in DBFCDX used,
: bSeek = {| c | (oBrw: cAlias​​) -> (DBSEEK (Upper (c). t.))}

Thank you,

Regards,


The best and the right way of using XBrowse is NOT to define that code block in your application program. Please remove any definitions of bSeek in your application program if you really want to avail all the powerful features of XBrowse.

XBrowse automatically creates the bSeek codeblock when AUTOSORT clause is used while creating XBrowse. XBrowse creates appropriate codeblocks depending on what we are browsing dbf,ado,array,tdolphin.

Just define XBrowse with AUTOSORT and you are ready with Incremental Seek without any additional Code in the application.

If you want to show what the user types for incremental seek, please add this line of code:

Code: Select all  Expand view
@ <row>,<col> SAY oBrw:oSeek PROMPT oBrw:cSeek SIZE <width>, <height> PIXEL OF <oDlg/oWnd> COLOR <your colors>


XBrowse automatically displays what the user types in.

By default, Incremental Seek works if a column is sorted.

if you set oBrw:lSeekWild := .t., the seek is automatically a wild seek. Seeks fpr a row where the column contains anywhere the expression typed.

If you set oBrw:lIncrFilter := .t., browse automatically filters the database and displays only records containing the expression typed.

For a good example, please study \fwh\samples\xbincflt.prg.

Please also remember, to get best results from xbrowse, create with command syntax.
Regards

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

Re: xbrowse autosort

Postby albeiroval » Thu May 30, 2013 9:08 pm

Mr Rao,

This is the code I'm using with tdolphin,
if I comment the line: bSeek does not work

the field 'cedula' is int (10) and primary key

Code: Select all  Expand view
METHOD DataBrowse() CLASS TMyApp
  local oDlg
  local oFont
  local oBar
  local lExit := FALSE
  local oServer:= ::oSrv:oServer
  local oSelf:= Self
   
  ::oQry = oServer:Query( "SELECT * FROM " + ::oSrv:cNomina + " ORDER BY cedula ASC" )
 
  DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-12 BOLD
   
  DEFINE DIALOG oDlg RESOURCE "xBrowse" OF oDlg FONT oFont
   
  REDEFINE XBROWSE ::oBrw ID 100 OF oDlg;
    FIELDS ::oQry:cedula, ::oQry:nombre, ::oQry:activo;
    HEADER "Cedula", "Nombre", "Activo" ;
    SIZES  100, 350, 100;
    LINES CELL AUTOSORT
   
  WITH OBJECT ::oBrw:Activo
    :bStrData = {|| if(::oQry:RecCount()>0, if(::oQry:Activo, "Activo", "Inactivo"), ::oQry:activo)}
  END  
       
  WITH OBJECT ::oBrw
   
    :lIncrFilter   := .t.
    // :lSeekWild     := .t.
   
    :nMarqueeStyle:= MARQSTYLE_HIGHLROW
    :bClrStd := {|| If(::oBrw:KeyNo() % 2 == 0,{CLR_BLACK, RGB( 224, 236, 255 )}, {CLR_BLACK, RGB( 189, 211, 253 )} ) }    
   
    // :bSeek := {|c| DoSeek(c, ::oQry, ::oBrw)}   <==== with this works
   
  END  
 
  REDEFINE SAY ID 101 OF oDlg
  REDEFINE SAY ::oBrw:oSeek PROMPT ::oBrw:cSeek COLOR CLR_BLACK, nRGB( 117, 236, 45 ) ID 102 OF oDlg
 
  ::oBrw:SetDolphin( ::oQry )
   
  oDlg:oClient = ::oBrw
   
  ACTIVATE DIALOG oDlg;
     CENTERED;
     ON INIT ( oSelf:CreaButonBar( oBar, oDlg, @lExit ) )
   
  ::oQry:End()
 
  ::oBrw = Nil

Return Nil

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

static function DoSeek( c, oQry, oBrw )
  oQry:Seek( c, "cedula",,, .T. )
  oBrw:cSeek:= ""
Return .T.

 


I'll be doing wrong?,

pdta : sorry my english..

thanks,

regards,
Saludos,
Regards,

Albeiro Valencia
www.avcsistemas.com
User avatar
albeiroval
 
Posts: 370
Joined: Tue Oct 16, 2007 5:51 pm
Location: Barquisimeto - Venezuela

Re: xbrowse autosort

Postby nageswaragunupudi » Thu May 30, 2013 11:44 pm

What is the FWH version you are using?
Regards

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

Re: xbrowse autosort

Postby albeiroval » Fri May 31, 2013 1:02 am

Mr Rao,

The version is fwh 13.01
Saludos,
Regards,

Albeiro Valencia
www.avcsistemas.com
User avatar
albeiroval
 
Posts: 370
Joined: Tue Oct 16, 2007 5:51 pm
Location: Barquisimeto - Venezuela

Re: xbrowse autosort

Postby albeiroval » Sat Jun 01, 2013 3:46 pm

Mr Nages,

Still nothing on the subject?
Saludos,
Regards,

Albeiro Valencia
www.avcsistemas.com
User avatar
albeiroval
 
Posts: 370
Joined: Tue Oct 16, 2007 5:51 pm
Location: Barquisimeto - Venezuela


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], karinha and 109 guests