#include "FiveWin.ch"
#include "xbrowse.ch"
function Main()
local oDlg, oBrw, aData, n := 0
aData := {{ "one","two","three" },;
{ "one","two","three" },;
{ "one","two","three" },;
{ "one","two","three" },;
{ "one","two","three" }}
DEFINE DIALOG oDlg SIZE 300, 200
@ 0, 0 XBROWSE oBrw OF oDlg ;
HEADER "1","2","3","4";
COLUMNS 1,2,3,{|| extracol( @n ) };
ARRAY aData AUTOCOLS
oBrw:CreateFromCode()
oBrw:bKeyDown = { || oDlg:SetText( Str( oBrw:nColSel ) ) }
ACTIVATE DIALOG oDlg CENTER ON INIT ( oDlg:oClient := oBrw, oDlg:Resize() )
return nil
function extracol( n )
n++
RETURN n
but I think there are others issues with xbrowse performance, the sample below show
the times that the data column is reads, you can see the column "4", the optimum should be 5
#include "fivewin.ch"
REQUEST DBFCDX
#ifndef __XHARBOUR__
#xtranslate DbSkipper => __DbSkipper
#endif
static nSkipperCalls := 0
static oSay
function Main()
local clog := cFileSetExt( ExeName(), "log" )
FERASE( clog )
RDDSETDEFAULT( "DBFCDX" )
SET DATE ITALIAN
SET CENTURY ON
SET DELETED ON
XbTest()
if file( clog )
winexec( "notepad.exe " + clog )
endif
return nil
function XbTest()
local oDlg, oBrw, oFont
USE CUSTOMER NEW SHARED ALIAS CUST VIA "DBFCDX"
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
DEFINE DIALOG oDlg SIZE 700,400 PIXEL TRUEPIXEL FONT oFont
@ 60,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
DATASOURCE "CUSTOMER" AUTOCOLS ;
CELL LINES NOBORDER
WITH OBJECT oBrw
:bSkip := { |n| ( oBrw:cAlias )->( MySkip( n ) ) }
//
:AutoFit()
:CreateFromCode()
END
@ 20,20 SAY oSay PROMPT nSkipperCalls PICTURE "99999" SIZE 100,20 PIXEL OF oDlg UPDATE
ACTIVATE DIALOG oDlg CENTERED
RELEASE FONT oFont
return nil
static function MySkip( n )
nSkipperCalls++
oSay:Refresh()
return DbSkipper( n )
Marcelo Via Giglio wrote:Mr. Rao
I see the great enhanced of xbrowse, congratulations, but I don't know if I am wrong about the refresh or repaint issue. I tested a simple xbrowse in a wan enviroment (slow connection with ADS server), and it was really slow. The sample that I posted in this thread show the times what the datas are called and painted
Some comments?
regards
Marcelo Via
Maurizio wrote:Hello ,
When I open a large recodset on WLAN ( mysql on Dreamhost ) I wait 4/5 " to have the data and after I open xBrowse .
example: SELECT * from mydatabase
I know that the delay is in the select and not xBrowse .
If I use :
SELECT * from mydatabase LIMIT 100
and I open xbrowse , I have no delay .
When I browse the data and arrive at the record 100 the command skip() should make another select
SELECT * FROM mydatabase LIMIT 100,100
and refreh the browse.
Regards Maurizio
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 20 guests