How to show Xbrowse-column-colors on a selected brush ?

How to show Xbrowse-column-colors on a selected brush ?

Postby ukoenig » Tue Mar 18, 2014 9:48 am

Hello,

during intensive xBrowse testing, I noticed some problems using oBrw:SetBackGround
I noticed in xBrowse-class : oBrw:lTransparent := .T.
To find out what happens, I used a brush function.
The reason is, the brush is painted BEHIND the rows and with using oBrw:lTransparent := .T.,
the defined columns are not visible.
The options COLOR and ROWCOLOR-change works, because it doesn't use oBrw:SetBackGround.

defined 2 column-colors for field SALARY
( light = value > 0, dark = value = 0 and text-color red for deleted )


oBrw:aCols[ 10 ]:bClrstd := {|| { If( ( oBrw:cAlias )->( Deleted() ), 255, nXbrColTxt ), ;
If( ( oBrw:cAlias )->SALARY = 0, nXbrCol2, nXbrCol1 ) } }


THE PROBLEM is shown at the end of :

METHOD SetBackGround( uBack, uBckMode ) CLASS TXBrowse
...
...
if oBrush != nil

::lTransparent := .t. // set to .F. shows in picture 3, how the brush is displayed
::SetBrush( oBrush )
::MakeBrush()
endif
endif
endif
return Self


it works fine with using oBrw:bClrStd on COLOR and ROWCOLOR-change

Image

the second defined rowcolor is used :

Image

shows the brush painted BEHIND the rows and is only visible with oBrw:lTransparent := .T. !

Image

Best regards
Uwe :?:
Last edited by ukoenig on Tue Mar 18, 2014 6:00 pm, 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: How to show Xbrowse-column-colors on a selected brush ?

Postby nageswaragunupudi » Tue Mar 18, 2014 4:43 pm

I don't think there are any problems with xbrowse. All the features work the way they were intended to work.
There are a plethora of options and we need to choose the appropriate ones to get the effect what we want.
We can set entire browse transparent or selected columns transparent have a brush for the entire browse or different brushes for cells in different columns, etc
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: How to show Xbrowse-column-colors on a selected brush ?

Postby ukoenig » Tue Mar 18, 2014 6:02 pm

I used for a test sample XBRGRAD.prg with the same result.
how to add column-colors with a defined xbrowse-brush ?

from original :

@ 10,10 XBROWSE oBrw ;
COLUMNS "First", "City", "State", "Married", "HireDate", "Age", "Salary" ;
COLSIZES nil,10 OF oDlg ;
SIZE 360,170 PIXEL ;
JUSTIFY .T. ;
ALIAS cAlias AUTOSORT FOOTERS LINES CELL NOBORDER ;
BACKGROUND aGrad VERTICAL

added colum-colors

WITH OBJECT oBrw:Salary
:nTotal := 0 ; :lTotal := .t. ; :nEditType := EDIT_GET
:bClrstd := {|| { If( ( oBrw:cAlias )->( Deleted() ), 255, nXbrColTxt ), ;
If( ( oBrw:cAlias )->SALARY = 0, nXbrCol2, nXbrCol1 ) } }

END


Image

column only visible with deleted background :
BACKGROUND aGrad VERTICAL


@ 10,10 XBROWSE oBrw ;
COLUMNS "First", "City", "State", "Married", "HireDate", "Age", "Salary" ;
COLSIZES nil,10 OF oDlg ;
SIZE 360,170 PIXEL ;
JUSTIFY .T. ;
ALIAS cAlias AUTOSORT FOOTERS LINES CELL NOBORDER


Image

oBrw:lTransparent := .F.
shows the defined column, but the rows without brush !
I think that is the reason for using oBrw:lTransparent := .T.


Image

Best regards
Uwe :?:
Last edited by ukoenig on Fri Mar 21, 2014 9:39 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: How to show Xbrowse-column-colors on a selected brush ?

Postby ukoenig » Thu Mar 20, 2014 12:52 pm

I found a solution.
Now it works like expected using gradient, brush and transparent
oBrw:SetBackGround is ENABLED !
Two solid brushes are defined, to paint the two column-colors.
I stll have to check to show the defined textcolor for DELETED on gradient and transparent.
Using a brush, it works.

The way it looks now
the column-color is painted ONLY on existing data.
the empty row ( bottom ) shows the brush :

Image

Image

Image

Working on a extended version of sample XBRGRAD.prg with many new options

Image

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 96 guests