Comments and requests about TWBrowse

Re: Comments and requests about TWBrowse

Postby MarcoBoschi » Wed Jul 21, 2010 5:01 pm

James,
You hit the problem.

>>Also, you can't stop repainting when the control is disabled since the screen still needs to be >>repainted. If you couldn't read the records, then there would be no data to display.

The solution could be to load an array only visible cells visible and do repaint reading only content of these cells from array and not from database.
Obviously it must be a parameter.
If this flag is "ON" I re-read from table otherwise if "OFF" instead I read from array in memory.
I think that with this implementation twbrowse class will be more appreciate.
No more problems of inertia for simply moving of window on your desktop

I am not be able to modify twbrowse class in this direction.
I hope to create a sample to better explain what I mean
Thanks again james
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: Comments and requests about TWBrowse

Postby James Bott » Wed Jul 21, 2010 5:06 pm

Marco,

I do understand what you mean. However, modifying a browse to do this is no trivial matter, and thus I would rather see it implemented with TXBrowse than TWBrowse. TXBrowse is a much more advanced browser.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Comments and requests about TWBrowse

Postby Enrico Maria Giordano » Wed Jul 21, 2010 5:24 pm

MarcoBoschi wrote:James,
I've tested a program with

ACTIVATE DIALOG oDlg ON INIT oBrw:disable()
to disable twbrowse.
Then I move on the desktop another little window of another application.
It seems that repaint of dialog with obrow inside is active.
It is very very slow
thanks


Try using

LOCKWINDOWUPDATE( oBrw:hWnd )

instead (and

LOCKWINDOWUPDATE()

to reactivate the window update).

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Comments and requests about TWBrowse

Postby Enrico Maria Giordano » Wed Jul 21, 2010 5:28 pm

MarcoBoschi wrote:James,
You hit the problem.


Sorry, but you didn't report any concrete problem so far. Can we see a reduced and self-contained sample still showing it?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Comments and requests about TWBrowse

Postby James Bott » Wed Jul 21, 2010 5:38 pm

Enrico,

Sorry, your lockwindowupdate() idea doesn't prevent the repainting. See sample code below. Press the lock button then move the custor over the browse and you will hear lots of beeps.

Sorry, but you didn't report any concrete problem so far. Can we see a reduced and self-contained sample still showing it?


The problem is the slow repainting. The reduced and self-contained example is below.

Regards,
James




Code: Select all  Expand view
// Test disabled TWBrowse for painting while disabled.
// Use with FWH\samples\customer.dbf file

#include "fivewin.ch"

function main()

   local oWnd, oLbx, oBar

   ferase("test02.log")

   use customer

   define window oWnd title "Test Browse"

   define buttonbar oBar of oWnd
   define button of oBar action oLbx:disable()
   define button of oBar action oLbx:enable()
   define button of oBar action writeFile("test02.log","-----------")

   define button of oBar action LOCKWINDOWUPDATE( oLbx:hWnd )
   define button of oBar action LOCKWINDOWUPDATE()

   @0,0 listbox oLbx fields first, last;
      alias "customer";
      of oWnd

   oLbx:bSkip:= {|nRecs| (msgBeep(),sleep(.1),sysrefresh(),customer->(dbskipper( nRecs)) ) }
  // oLbx:bSkip:= {|nRecs| (logfile("test02.log",{trim(str(recno()))}),customer->(dbskipper( nRecs)) ) }

   oWnd:oClient:= oLbx

   activate window oWnd //on init oLbx:disable()

return nil
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Comments and requests about TWBrowse

Postby MarcoBoschi » Thu Jul 22, 2010 8:01 am

Enrico, James,

I put this line of code in a my application

oBrw:bSkip:= {|nRecs| ( logfile( "eventi.txt" , { oBrw:nRowCount() , recno() } ), tabella->(dbskipper( nRecs)) ) }

tabella.dbf has 11400 records it's about 9 MB
tabella.cdx has 20 TAG inside it's about 1,5 MB

In eventi.txt file I found this
158 skipped records Vs only 38 rows of my twbrowse

22/07/2010 09:54:05: 38 11425
22/07/2010 09:54:05: 38 11354
22/07/2010 09:54:05: 38 11355
22/07/2010 09:54:05: 38 11359
22/07/2010 09:54:05: 38 11360
22/07/2010 09:54:05: 38 11361
22/07/2010 09:54:05: 38 11362
22/07/2010 09:54:05: 38 11363
22/07/2010 09:54:05: 38 11364
22/07/2010 09:54:05: 38 11366
22/07/2010 09:54:05: 38 11369
22/07/2010 09:54:05: 38 11371
22/07/2010 09:54:05: 38 11372
22/07/2010 09:54:05: 38 11376
22/07/2010 09:54:05: 38 11377
22/07/2010 09:54:05: 38 11380
22/07/2010 09:54:05: 38 11381
22/07/2010 09:54:05: 38 11382
22/07/2010 09:54:05: 38 11383
22/07/2010 09:54:05: 38 11385
22/07/2010 09:54:05: 38 11386
22/07/2010 09:54:05: 38 11387
22/07/2010 09:54:05: 38 11390
22/07/2010 09:54:05: 38 11391
22/07/2010 09:54:05: 38 11392
22/07/2010 09:54:05: 38 11395
22/07/2010 09:54:05: 38 11398
22/07/2010 09:54:05: 38 11401
22/07/2010 09:54:05: 38 11404
22/07/2010 09:54:05: 38 11405
22/07/2010 09:54:05: 38 11407
22/07/2010 09:54:05: 38 11415
22/07/2010 09:54:05: 38 11416
22/07/2010 09:54:05: 38 11418
22/07/2010 09:54:05: 38 11419
22/07/2010 09:54:05: 38 11420
22/07/2010 09:54:05: 38 11422
22/07/2010 09:54:05: 38 11423
22/07/2010 09:54:05: 38 11425
22/07/2010 09:54:05: 38 11354
22/07/2010 09:54:05: 38 11355
22/07/2010 09:54:05: 38 11359
22/07/2010 09:54:05: 38 11360
22/07/2010 09:54:05: 38 11361
22/07/2010 09:54:05: 38 11362
22/07/2010 09:54:05: 38 11363
22/07/2010 09:54:05: 38 11364
22/07/2010 09:54:05: 38 11366
22/07/2010 09:54:05: 38 11369
22/07/2010 09:54:05: 38 11371
22/07/2010 09:54:05: 38 11372
22/07/2010 09:54:05: 38 11376
22/07/2010 09:54:05: 38 11377
22/07/2010 09:54:05: 38 11380
22/07/2010 09:54:05: 38 11381
22/07/2010 09:54:05: 38 11382
22/07/2010 09:54:05: 38 11383
22/07/2010 09:54:05: 38 11385
22/07/2010 09:54:05: 38 11386
22/07/2010 09:54:05: 38 11387
22/07/2010 09:54:06: 38 11390
22/07/2010 09:54:06: 38 11391
22/07/2010 09:54:06: 38 11392
22/07/2010 09:54:06: 38 11395
22/07/2010 09:54:06: 38 11398
22/07/2010 09:54:06: 38 11401
22/07/2010 09:54:06: 38 11404
22/07/2010 09:54:06: 38 11405
22/07/2010 09:54:06: 38 11407
22/07/2010 09:54:06: 38 11415
22/07/2010 09:54:06: 38 11416
22/07/2010 09:54:06: 38 11418
22/07/2010 09:54:06: 38 11419
22/07/2010 09:54:06: 38 11420
22/07/2010 09:54:06: 38 11422
22/07/2010 09:54:06: 38 11423
22/07/2010 09:54:06: 38 11425
22/07/2010 09:54:06: 38 11425
22/07/2010 09:54:06: 38 11425
22/07/2010 09:54:06: 38 11354
22/07/2010 09:54:06: 38 11355
22/07/2010 09:54:06: 38 11359
22/07/2010 09:54:06: 38 11360
22/07/2010 09:54:06: 38 11361
22/07/2010 09:54:06: 38 11362
22/07/2010 09:54:06: 38 11363
22/07/2010 09:54:06: 38 11364
22/07/2010 09:54:06: 38 11366
22/07/2010 09:54:06: 38 11369
22/07/2010 09:54:06: 38 11371
22/07/2010 09:54:06: 38 11372
22/07/2010 09:54:06: 38 11376
22/07/2010 09:54:06: 38 11377
22/07/2010 09:54:06: 38 11380
22/07/2010 09:54:06: 38 11381
22/07/2010 09:54:06: 38 11382
22/07/2010 09:54:06: 38 11383
22/07/2010 09:54:06: 38 11385
22/07/2010 09:54:06: 38 11386
22/07/2010 09:54:06: 38 11387
22/07/2010 09:54:06: 38 11390
22/07/2010 09:54:06: 38 11391
22/07/2010 09:54:06: 38 11392
22/07/2010 09:54:06: 38 11395
22/07/2010 09:54:06: 38 11398
22/07/2010 09:54:06: 38 11401
22/07/2010 09:54:06: 38 11404
22/07/2010 09:54:06: 38 11405
22/07/2010 09:54:06: 38 11407
22/07/2010 09:54:06: 38 11415
22/07/2010 09:54:06: 38 11416
22/07/2010 09:54:06: 38 11418
22/07/2010 09:54:06: 38 11419
22/07/2010 09:54:06: 38 11420
22/07/2010 09:54:06: 38 11422
22/07/2010 09:54:06: 38 11423
22/07/2010 09:54:06: 38 11425
22/07/2010 09:54:06: 38 11425
22/07/2010 09:54:10: 38 11425
22/07/2010 09:54:10: 38 11354
22/07/2010 09:54:10: 38 11355
22/07/2010 09:54:10: 38 11359
22/07/2010 09:54:10: 38 11360
22/07/2010 09:54:10: 38 11361
22/07/2010 09:54:10: 38 11362
22/07/2010 09:54:10: 38 11363
22/07/2010 09:54:10: 38 11364
22/07/2010 09:54:10: 38 11366
22/07/2010 09:54:10: 38 11369
22/07/2010 09:54:10: 38 11371
22/07/2010 09:54:10: 38 11372
22/07/2010 09:54:10: 38 11376
22/07/2010 09:54:10: 38 11377
22/07/2010 09:54:10: 38 11380
22/07/2010 09:54:10: 38 11381
22/07/2010 09:54:10: 38 11382
22/07/2010 09:54:10: 38 11383
22/07/2010 09:54:10: 38 11385
22/07/2010 09:54:10: 38 11386
22/07/2010 09:54:10: 38 11387
22/07/2010 09:54:10: 38 11390
22/07/2010 09:54:10: 38 11391
22/07/2010 09:54:10: 38 11392
22/07/2010 09:54:10: 38 11395
22/07/2010 09:54:10: 38 11398
22/07/2010 09:54:10: 38 11401
22/07/2010 09:54:10: 38 11404
22/07/2010 09:54:10: 38 11405
22/07/2010 09:54:10: 38 11407
22/07/2010 09:54:10: 38 11415
22/07/2010 09:54:10: 38 11416
22/07/2010 09:54:10: 38 11418
22/07/2010 09:54:10: 38 11419
22/07/2010 09:54:10: 38 11420
22/07/2010 09:54:10: 38 11422
22/07/2010 09:54:10: 38 11423
22/07/2010 09:54:10: 38 11425
22/07/2010 09:54:10: 38 11425


then I reduced my dialog and ...

22/07/2010 09:58:08: 8 11435
22/07/2010 09:58:08: 8 11422
22/07/2010 09:58:08: 8 11423
22/07/2010 09:58:08: 8 11425
22/07/2010 09:58:08: 8 11429
22/07/2010 09:58:08: 8 11430
22/07/2010 09:58:08: 8 11432
22/07/2010 09:58:08: 8 11434
22/07/2010 09:58:08: 8 11435
22/07/2010 09:58:08: 8 11435
22/07/2010 09:58:08: 8 11435
22/07/2010 09:58:08: 8 11422
22/07/2010 09:58:08: 8 11423
22/07/2010 09:58:08: 8 11425
22/07/2010 09:58:08: 8 11429
22/07/2010 09:58:08: 8 11430
22/07/2010 09:58:08: 8 11432
22/07/2010 09:58:08: 8 11434
22/07/2010 09:58:08: 8 11435
22/07/2010 09:58:08: 8 11435
22/07/2010 09:58:17: 8 11435
22/07/2010 09:58:17: 8 11422
22/07/2010 09:58:17: 8 11423
22/07/2010 09:58:17: 8 11425
22/07/2010 09:58:17: 8 11429
22/07/2010 09:58:17: 8 11430
22/07/2010 09:58:17: 8 11432
22/07/2010 09:58:17: 8 11434
22/07/2010 09:58:17: 8 11435
22/07/2010 09:58:17: 8 11435

29 skipped records Vs only 8 rowse on the screen

is it normal?
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: Comments and requests about TWBrowse

Postby Enrico Maria Giordano » Thu Jul 22, 2010 11:34 am

James Bott wrote:The problem is the slow repainting. The reduced and self-contained example is below.


Sorry James, but your sample doesn't show anything useful. I can hear a single beep when leaving the window, and that's all. I need a sample of the real problem.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Comments and requests about TWBrowse

Postby Enrico Maria Giordano » Thu Jul 22, 2010 11:37 am

MarcoBoschi wrote:29 skipped records Vs only 8 rowse on the screen

is it normal?


Can I see a real sample of the problem?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Comments and requests about TWBrowse

Postby MarcoBoschi » Thu Jul 22, 2010 12:31 pm

Enrico,
here below there is the sample of James modified.
I write with logfile function, I remove beep.

It 'obvious that all is well with the table customer ther are no problems.
With another table I see differences between
oLbx:nRowCount() and lines written into events.txt log file


// Test disabled TWBrowse for painting while disabled.
#include "fivewin.ch"

ANNOUNCE RDDSYS

function main()

local oWnd, oLbx, oBar
local lSound := .F.


use customer
SET INDEX TO customer

define window oWnd title "Test Browse"

define buttonbar oBar of oWnd

@ 0 , 0 listbox oLbx fields of oWnd
oLbx:bSkip:= {|nRecs| ( logfile( "events.txt" , { oLbx:nRowCount() , recno() } ), customer->(dbskipper( nRecs)) ) }

oWnd:oClient:= oLbx

activate window oWnd

return nil

INIT PROCEDURE RddInit
REQUEST DBFFPT
REQUEST DBFCDX
rddSetDefault( "DBFCDX" )
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: Comments and requests about TWBrowse

Postby Enrico Maria Giordano » Thu Jul 22, 2010 12:41 pm

I found this inside events.txt:

07/22/10 14:38:37: 14 1
07/22/10 14:38:37: 14 1
07/22/10 14:38:37: 14 2
07/22/10 14:38:37: 14 3
07/22/10 14:38:37: 14 4
07/22/10 14:38:37: 14 5
07/22/10 14:38:37: 14 6
07/22/10 14:38:37: 14 7
07/22/10 14:38:37: 14 8
07/22/10 14:38:37: 14 9
07/22/10 14:38:37: 14 10
07/22/10 14:38:37: 14 11
07/22/10 14:38:37: 14 12
07/22/10 14:38:37: 14 13
07/22/10 14:38:37: 14 14
07/22/10 14:38:37: 14 15

that is looking fine to me. Anyway, I don't know why you are using bSkip codeblock that has nothing to do with browse refresh.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Comments and requests about TWBrowse

Postby MarcoBoschi » Thu Jul 22, 2010 1:15 pm

Enrico,
let's start from beginning
Compile and run this little sample program.
drag another little window over the window of this program
You have to note that refresh or repaint ( you understand me ) is slow
Is much slower if you work online and with a larger table or with more table with relationship between them.

#include "fivewin.ch"

function main()

local oWnd, oLbx

use customer

define window oWnd title "Test Browse"

@ 0 , 0 listbox oLbx fields alias "customer" of oWnd

oWnd:oClient:= oLbx

activate window oWnd

return nil

last but not least, please compile this program too.

#include "fivewin.ch"
#include "xbrowse.ch"

ANNOUNCE RDDSYS

FUNCTION MAIN()
LOCAL oWnd

LOCAL oBrw
LOCAL aRec := {}


LOCAL nIni
LOCAL nRig
LOCAL nFin
LOCAL nCur := 1

SET DELETED ON
SET EXCLUSIVE OFF
USE customer
SET INDEX TO customer

nRig := 20
nIni := 1
nFin := 1

aRec := myload( nIni )


DEFINE WINDOW oWnd


@ 0, 0 XBROWSE oBrw OF oWnd ARRAY aRec AUTOCOLS SIZE 500 , 500

oBrw:CreateFromCode()

oWnd:oClient:= oBrw


ACTIVATE WINDOW oWnd MAXIMIZED


RETURN NIL

FUNCTION MYLOAD( nIni )
LOCAL nR, nF
LOCAL aArray := {}
LOCAL aRecord := {}

FOR nR := nIni TO nIni + 30
aRecord := {}
FOR nF := 1 TO fcount()
AADD( aRecord , fieldget( nF ) )
NEXT i

AADD( aArray , aRecord )

SKIP

NEXT nR

RETURN aArray


INIT PROCEDURE RddInit
REQUEST DBFFPT
REQUEST DBFCDX
rddSetDefault( "DBFCDX" )

It should load some records into an array and here too there is a slow repaint.
If a compare with Excel I see much difference
Now I search other applications with similar cells view and then I will know you if only excel is fast or if only ours programs are slow

have a nice day

marco
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: Comments and requests about TWBrowse

Postby Enrico Maria Giordano » Thu Jul 22, 2010 1:35 pm

MarcoBoschi wrote:Enrico,
let's start from beginning
Compile and run this little sample program.
drag another little window over the window of this program
You have to note that refresh or repaint ( you understand me ) is slow
Is much slower if you work online and with a larger table or with more table with relationship between them.



I just tested your sample on my wireless lan using a 84 MB DBF (50000 records) without noticed any refreshing slowness, sorry.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Comments and requests about TWBrowse

Postby MarcoBoschi » Thu Jul 22, 2010 2:06 pm

Enrico,
Seeing is believing...
take a look at
http://www.marcoboschi.it/public/fivewin.avi
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: Comments and requests about TWBrowse

Postby Enrico Maria Giordano » Thu Jul 22, 2010 2:11 pm

I'm not saying that you don't have a problem. I'm only saying that your sample doesn't show it here. I see that you are using a different sample. Can I try with the exact sample are you using? I cannot help you if I cannot see the problem here.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Comments and requests about TWBrowse

Postby MarcoBoschi » Thu Jul 22, 2010 2:14 pm

User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 89 guests