FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Create a xBrowse-Grad.Backgrd. from a defined Grad.-Array ?
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Create a xBrowse-Grad.Backgrd. from a defined Grad.-Array ?
Posted: Thu Nov 12, 2009 11:24 PM
Hello,

is there a Sample, to define a xBrowse Gradient-Background straight from a Gradient-Array ?

aGrad := { { Position, COLOR1, COLOR2 }, ;
{ Position, COLOR2, COLOR1 } }
???
???
oLbx:SetBackGround( aGrad )

It is needed for the new xBrwTools-Update 5.0a
Folder-Page Gradient
Maybe I have to use the 3 Color-Values like in Sample TestxBr3.prg ?
I think, Instead of a BMP for the Gradient-Preview, it must be a Browser, to show 3 Colors.

local aGrad := oBrw:Cargo[ 1 ] ???
local lVert := oBrw:Cargo[ 2 ] ???



TestxBr3.prg show this Function:

// -----------------------------------------------
static function SelBrwGradClr( oBrw, nPart )
local aGrad := oBrw:Cargo[ 1 ]
local aSave := AClone( aGrad )
local lVert := oBrw:Cargo[ 2 ]
local nClr

nClr := If( nPart == 1, aGrad[ 1 ][ 2 ], If( nPart == 2, aGrad[ 1 ][ 3 ], aGrad[ 2 ][ 3 ] ) )
nClr := ChooseColor( nClr )
if nPart == 1
aGrad[ 1 ][ 2 ] := nClr
elseif nPart == 2
aGrad[ 1 ][ 3 ] := aGrad[ 2 ][ 2 ] := nClr
elseif nPart == 3
aGrad[ 2 ][ 3 ] := nClr
endif
oBrw:SetBackGround( aGrad, lVert )

return aSave
// ----------------------------------------------

Best Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Create a xBrowse-Grad.Backgrd. from a defined Grad.-Array ?
Posted: Fri Nov 13, 2009 12:54 AM

Mr Uwe

I think you already know this works.
>>
oLbx:SetBackGround( aGrad, lVert )
>>
What is it you want to know more ?

Regards



G. N. Rao.

Hyderabad, India
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Create a xBrowse-Grad.Backgrd. from a defined Grad.-Array ?
Posted: Fri Nov 13, 2009 01:01 AM
Thank You very much for the reply,

I added this line and got a Error, that is the Reason for my Question.
I will try again.

Optional these Lines are added for Gradient-Background inside the xBrowse-Preview :

aGrad1 := { { MOVE1, BR_COLOR1, BR_COLOR2 }, ;
{ MOVE1, BR_COLOR2, BR_COLOR1 } }
oLbx:SetBackGround( aGrad1, .T. )


I tested with another Browser and there it worked.
The Preview-Browser includes all possible Background-Combinations, that makes it very complicated.
I have to check again, if there is something undefined.

Application
===========
Path and name: E:\T_XBROW\brwtools.exe (32 bits)
Size: 2,287,616 bytes
Time from start: 0 hours 0 mins 2 secs
Error occurred at: 11/13/09, 02:45:52
Error description: Error BASE/1004 Class: 'NIL' has no exported method: EVAL
Args:
[ 1] = U

Stack Calls
===========
Called from: => EVAL(0)
Called from: .\source\classes\XBROWSE.PRG => (b)TXBROWSE:TXBROWSE(343)
Called from: => TXBROWSE:KEYCOUNT(0)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:REFRESH(914)
Called from: .\source\classes\WINDOW.PRG => (b)TWINDOW:TWINDOW(559)
Called from: => TXBROWSE:SETBRUSH(0)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:SETBACKGROUND(4382)

Best Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Create a xBrowse-Grad.Backgrd. from a defined Grad.-Array ?
Posted: Fri Nov 13, 2009 05:32 AM

You have to use :SetBackGround( .. ) after the datasource is already set by way of SetArray or SetRDD, etc.

From the errorlog i see that the bKeyCount is not yet assigned. That means data source is not yet set. Hope I am clear.

I advise you to setarray or setrdd ( as the case may be ) at an early stage before you deal with other methods of xbrowse.

Regards



G. N. Rao.

Hyderabad, India

Continue the discussion