Create a xBrowse-Grad.Backgrd. from a defined Grad.-Array ?

Create a xBrowse-Grad.Backgrd. from a defined Grad.-Array ?

Postby ukoenig » 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:oBrush:Cargo[ 1 ] ???
local lVert := oBrw:oBrush:Cargo[ 2 ] ???

Image

TestxBr3.prg show this Function:

// -----------------------------------------------
static function SelBrwGradClr( oBrw, nPart )
local aGrad := oBrw:oBrush:Cargo[ 1 ]
local aSave := AClone( aGrad )
local lVert := oBrw:oBrush: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 :lol:
Last edited by ukoenig on Fri Nov 13, 2009 12:55 am, edited 1 time in total.
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Create a xBrowse-Grad.Backgrd. from a defined Grad.-Array ?

Postby nageswaragunupudi » 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
User avatar
nageswaragunupudi
 
Posts: 10625
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Create a xBrowse-Grad.Backgrd. from a defined Grad.-Array ?

Postby ukoenig » Fri Nov 13, 2009 1: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 :lol:
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Create a xBrowse-Grad.Backgrd. from a defined Grad.-Array ?

Postby nageswaragunupudi » Fri Nov 13, 2009 5: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
User avatar
nageswaragunupudi
 
Posts: 10625
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 97 guests