f I use xbrowser adata the dialog of xbrowser is fast how it is possible ?
nageswaragunupudi wrote:f I use xbrowser adata the dialog of xbrowser is fast how it is possible ?
In the case of XBrowser, the browse is created by FWH's code.
In the case of direct XBrowse, the browse is created by the programmer.
:SetGroupHeader( "Estrazione", 1, 1 )
:SetGroupHeader( "Decina 1-10", 2, 11 )
:SetGroupHeader( "Decina 11-20", 12, 21 )
:SetGroupHeader( "Decina 21-30", 22, 31 )
:SetGroupHeader( "Decina 31-40", 32, 41 )
:SetGroupHeader( "Decina 41-50", 42, 51 )
:SetGroupHeader( "Decina 51-60", 52, 61 )
:SetGroupHeader( "Decina 61-70", 62 , 71 )
:SetGroupHeader( "Decina 71-80", 72, 81 )
:SetGroupHeader( "Decina 81-90", 82, 91 )
oDlg:bPainted := { |hDC| PaintDlg( hDC, oDlg, oBrw ) }
static function PaintDlg( hDC, oDlg, oBrw )
( hDC )
Marcar_Lines(oBrw)
oBrw:Refresh()
return nil
static Function Marcar_Lines(oBrw)
WITH OBJECT oBrw
FOR i := 1 TO 91 STEP 10
oCol := :aCols[ i ]
ColPenColor( oCol, CLR_BLACK,:nSizePen )
NEXT
END
oBrw:refresh()
return nil
oBrw:lFastDraw := .t.
nageswaragunupudi wrote:
- Code: Select all Expand view RUN
oBrw:lFastDraw := .t.
Improves the speed if the browse is simple and screen ornamentation is less.
FWH provides 3 alternative browses, TWBROWSE, TCBROWSE, TXBROWSE.
Nobody compels us to use XBrowse only for every browse.
We better use the most suitable browse for our requirements.
In this case WBrowse is simpler and provides faster horizontal spanning speeds. You may consider WBrowse, wherever you do not require the extra screen-rich features of xbrowse.
nageswaragunupudi wrote:
- Code: Select all Expand view RUN
oBrw:lFastDraw := .t.
Improves the speed if the browse is simple and screen ornamentation is less.
Called from: Source\lotto\tlotto.prg => (b)TLOTTO_NAGESPROCEDURE( 995 )
Called from: C:\work\Lib32\xbrowse.prg => TXBROWSE:PAINT( 2504 )
Called from: C:\work\Lib32\xbrowse.prg => TXBROWSE:DISPLAY( 2218 )
nageswaragunupudi wrote:Never giveup
TLOTTO_NAGESPROCEDURE: I dont know what is this.
Whatever is it, not a good idea to import some function
Try WBrowse.
WITH OBJECT oBrw
:nMarqueeStyle := 2
AEval( :aCols, { |o| o:nWidth := 36 }, 2 )
for n := 2 to Len( :aCols )
:aCols[ n ]:bLDClickData := < |r,c,f,oCol|
local nRow,nCol,nVal,nAt
if lNumber == .f.
nRow := oCol:oBrw:nArrayAt
nCol := oCol:nCreationOrder
nAt := AScan( aCell, nRow * 100 + nCol )
if nAt == 0
AAdd( aCell, nRow * 100 + nCol )
else
HB_ADel( aCell, nAt, .t. )
endif
oCol:oBrw:Refresh()
elseif lNumber == .t.
nVal := oCol:Value
nAt := AScan( aVals, nVal )
if nAt == 0
AAdd( aVals, nVal )
else
HB_ADel( aVals, nAt, .t. )
endif
oCol:oBrw:Refresh()
endif
return nil
>
next
:bClrStd := < |b,oCol|
local nRow, nVal, n
local nCol := oCol:nCreationOrder
if nCol > 1
if lNumber == .f.
nRow := b:nArrayAt
if AScan( aCell, nRow * 100 + nCol ) > 0
return ValToColor( oCol:Value )
endif
elseif lNumber == .t.
nVal := oCol:Value
if AScan( aVals, nVal ) > 0
return ValToColor( nVal )
endif
endif
endif
return { 0, CLR_WHITE }
>
:CreateFromCode()
END
Otto wrote:Silvio, imagine how many windows (handles) you are using here.
With xBrowse, you have the performance where practically every cell is a window and has all functionality.
This costs resources.
I had the same problem with my room plan and the cash register. Initially, I also tried a browser approach, but it is too slow.
You need to create your own paint method here.
You have to work with coordinates and use oWnd:say(), oWnd:line(), etc.
But it is quite a bit of work.
Have you tried with LISTBOX?
Best regards,
Otto
function silvio_scroll( oBrw )
local nMaxCol := len(oBrw:GetDisplayCols())
local nVisibleCol := len(oBrw:GetVisibleCols())
local nRange := nMaxCol - 1
local nThumbSize := Max( 1, ( nVisibleCol * nRange ) / nMaxCol )
if oBrw:oHScroll != nil
oBrw:oHScroll:SetRange( 0, nMaxCol )
oBrw:oHScroll:SetPage( nVisibleCol, .t. )
SetScrollInfo( oBrw:oHScroll:hWnd, SB_HORZ, nThumbSize, .t. )
endif
return nil
#include "fivewin.ch"
Function test()
Local oCol, oGrid
Local cCol
Local n, n2
local aTabla := array( 101, 100 )
USE BIGBASE ALIAS BIGBASE
for n2 := 1 to 100
aTabla[ 1, n2 ] := n2
next
for n := 1 to 100
for n2 := 2 to 101
aTabla[ n2, n ] := bigbase -> ( fieldget( n2 - 1 ) )
next n2
bigbase->( dbskip(1) )
next n
dbclosearea("bigbase")
DEFINE WINDOW oWnd TITLE "Test velocity hscroll from bigbase.dbf"
@ 0,0 XBROWSE ogrid OF oWnd ;
array aTabla LINES CELL fastedit
oWnd:oClient := ogrid
ogrid:createfromcode()
ACTIVATE WINDOW oWnd MAXIMIZED
Return nil
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 37 guests