FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Upstable
Posts: 708
Joined: Fri Oct 28, 2005 09:53 AM
Upstable
Posted: Thu Jun 19, 2008 04:03 PM

Hello,

Is oLbx:Upstable() still required for FWH 8.01? It seems the REDEFINE LISTBOX is not refreshing properly with oLbx:Upstable, oLbx:Refresh().

Thank You,

*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Upstable
Posted: Thu Jun 19, 2008 06:43 PM

Darrell,

Yes, Upstable() should be used in the same way was before

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Upstable
Posted: Fri Jun 20, 2008 05:26 AM

In xbrowse it is not necessary ( fwh 805 )

Regards



G. N. Rao.

Hyderabad, India
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Upstable
Posted: Fri Jun 20, 2008 09:31 AM

Right. It is only needed for TWBrowse and TCBrowse, not for TXBrowse.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 408
Joined: Sun Aug 13, 2006 05:38 AM
Upstable
Posted: Fri Jun 20, 2008 06:26 PM

Antonio

Yes it's necesary, I use FWH 8.05 refresh() or refresh(.t.) don't work like upstable(). Or how I can substituting this method?

I sended you at may 22 an email with the modifications that include this method, and it include to can use hash like array in xbrowse between others details, but with this answer I suppose you don't include this changes in next version

Saludos

Quique
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Upstable
Posted: Fri Jun 20, 2008 08:54 PM

Quique,

We got your email, thanks. We are reviewing your proposed Upstable() implementation and other features, thanks

We will include them in next build :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Upstable
Posted: Fri Jun 20, 2008 09:01 PM

Quique,

ok, the problem that we find in your code is this line:

local lMatriz := ::nDataType in { DATATYPE_ARRAY, DATATYPE_HASH }

it is not supported by Harbour :-( so we need to find a way to make it compatible

Have you tested your proposed changes with Harbour too ? thanks,

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 408
Joined: Sun Aug 13, 2006 05:38 AM
Upstable
Posted: Fri Jun 20, 2008 09:18 PM

Thanks you Antonio, and I'm sorry, this var is only trash of my own class when copy to xbrowse, but I think you only delete it.

I found other bug in defaultl parameters, if you are considering that point too, the line

oBrw:lDesign := lDesign

change for

oBrw:lDesign := !empty( lDesign )

Saludos

Quique
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Upstable
Posted: Sat Jun 21, 2008 08:24 AM

Quique,

Could you please provide an example for xbrowse where Upstable() is required ? thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 408
Joined: Sun Aug 13, 2006 05:38 AM
Upstable
Posted: Sat Jun 21, 2008 09:20 PM
#INCLUDE "xbrowse.CH"
   local a:= { {"1"}, {"2"}, {"3"}}
   local oWnd, oBrw
   define window oWnd
   @0,0 xbrowse oBrw array a autocols of oWnd
   oBrw:createFromCode()


  // Muestra solamente 2 registros y se coloca en el registro correcto
   activate window oWnd on init ( eval( oBrw:bBookMark, 2 ), oBrw:refresh() )


   // Muestra todos los registros pero se coloca en el primero
   activate window oWnd on init ( eval( oBrw:bBookMark, 2 ), oBrw:refresh(.t.) )


   // Muestra todos los registros y se coloca en el correcto
   activate window oWnd on init ( eval( oBrw:bBookMark, 2 ), oBrw:upstable(), oBrw:refresh() )


Inclusive, el upstable que te envié, a difrencia del de tWBrowse también tiene efecto cuando se trata de los últimos registros de la tabla
Saludos

Quique
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Upstable
Posted: Mon Jun 23, 2008 08:48 AM
Quique,

The behaviour of xbrowse seems to be correct. When you already position the record pointer on some record ( in this case 2nd array row ) and invoke any browse, that record is shown at the top of the browse.

For example, if you are already on 100th record in a dbf table and invoke xbrowse or any browse, the selected record is shown as the first row in the browse.

If you want to display from 1st array row onwards and position the browse row on the second row, use SetPos( nRow, nCol ) method.

i.e. ACTIVATE WINDOW oWnd ON INIT oBrw:SetPos( 2, 1 )

Now the array will be shown from the first row onwards and the browse cursor will be positioned on the second visible row,

The purpose of Upstable method in the earlier browses was different. If the browse cursor is on n'th row and consequent on chaging index order or modifiying an indexed column the new physical position of the record in the index order is less than 'n', the browse cursor has to be moved upwards to the selected record. Earlier browses needed the upstable method for that. Now xbrowse's refesh method does it automatically.

As an example try this code:
#include "fivewin.ch"
#include "xbrowse.ch"

request DBFCDX

function main()

   field NCOL, CCOL

   local n, oWnd, oBrw

   DbCreate( 'xtest', { { 'NCOL', 'N', 3, 0 }, { 'CCOL', 'C', 3, 0 } } )
   USE XTEST VIA "DBFCDX"
   for n = 1 to 5
      DbAppend()
      FieldPut( 1, n )
      FieldPut( 2, Replicate( Chr( 70 - n ), 3 ) )
   next n

   INDEX ON NCOL TAG NCOL
   INDEX ON CCOL TAG CCOL

   USE
   USE XTEST VIA "DBFCDX"
   SET ORDER TO TAG NCOL
   GO TOP

   DEFINE WINDOW oWnd
   @ 0,0 XBROWSE oBrw OF oWnd ALIAS 'XTEST' AUTOCOLS AUTOSORT

   oBrw:CreateFromCode()
   oWnd:oClient := oBrw
   ACTIVATE WINDOW oWnd

return nil


Navigate to 4th or 5th row and change the order.
You will find the browse cursor going up to the correct row: Upstable's functionality is built into TXBrowse
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 408
Joined: Sun Aug 13, 2006 05:38 AM
Upstable
Posted: Mon Jun 23, 2008 06:40 PM

I ever use upstable in the form I comment you but with DBFs, this whas a little sample, and with dbf works equal, I use the sample for second row, but it was a sample, I use upstable when add records and I don't know if are meny or few records, or where is the pointer, so, I have seen some posts speak of the same theme, I think I aren't the only person who thinks that

Saludos

Quique

Continue the discussion