Alaska Software Inc. - XbpColumn:colorBlock not working with usevisualstyle.
Username: Password:
AuthorTopic: XbpColumn:colorBlock not working with usevisualstyle.
Itai Ben-ArtziXbpColumn:colorBlock not working with usevisualstyle.
on Mon, 05 Apr 2021 00:11:04 -0700
XbpColumn:colorBlock := {<nColorFG>,<nColorBG>} is working fine if
usevisualstyle = .F..  Otherwise, only <nColorBG1> is working and
<nColorFG> is ignored.
Can I set the <nColorFG> and keep usevisualstyle := .T. in XbpBrowse?
How?

Many thanks,
-Itai
Jim LeeRe: XbpColumn:colorBlock not working with usevisualstyle.
on Tue, 06 Apr 2021 01:42:48 +0200
hi,

yuu can use

oApp:usevisualstyle := .T
oBrowse:DataArea:usevisualstyle := .F

just to show Color of Colorblock


<Itai Ben-Artzi> schrieb im Newsbeitrag 
news:3sdl6gh3nqd73plnccs8b5e1f9ft093qg0@4ax.com...
> XbpColumn:colorBlock := {<nColorFG>,<nColorBG>} is working fine if
> usevisualstyle = .F..  Otherwise, only <nColorBG1> is working and
> <nColorFG> is ignored.
> Can I set the <nColorFG> and keep usevisualstyle := .T. in XbpBrowse?
> How?
>
> Many thanks,
> -Itai
Itai Ben-ArtziRe: XbpColumn:colorBlock not working with usevisualstyle.
on Tue, 06 Apr 2021 01:18:44 -0700
Jim,
XbpBrowse object does not have :DataArea var.

Setting XbpColumn:usevisualstyle for each column is the same as
setting it to the entire XbpBrowse.

The problem is that setting foreground color
(oBrowse:GetColumn(i):ColorBlock) is not working if :usevisualstyle is
set to .T. (setting background color is working alright).  Thus, to
set a foreground color for each cell, oBrowse:usevisualstyle must be
tuned off (.F.). is it a bug?

I'd like to keep the flat style of the browser and be able to set
foreground color as well.

-Itai
Jim LeeRe: XbpColumn:colorBlock not working with usevisualstyle.
on Wed, 07 Apr 2021 02:42:07 +0200
hi

> > XbpBrowse object does not have :DataArea var.

you are right, it is XbpColumn()

   FOR i:=1 TO F_LEN
      oCol := oBrowse:addColumn( DirBlock( aArray, i ), aHeading[i,1], 
aHeading[i,2] )
      oCol:heading:UseVisualStyle := .T.
      oCol:heading:styleClass := "Header"
      oCol:heading:stylePart := 1
      oCol:heading:lbClick := STR2Block( i , oBrowse )

      oCol:dataArea:useVisualStyle := .F.
   NEXT

    set Color fo Column
   oBrowse:getColumn( F_NAME + 1 ):colorBlock := {|| { GRA_CLR_RED, NIL } }


<Itai Ben-Artzi> schrieb im Newsbeitrag 
news:586o6ghd09dn8bpvgu1njv61q0728gpti0@4ax.com...
> Jim,
> XbpBrowse object does not have :DataArea var.
>
> Setting XbpColumn:usevisualstyle for each column is the same as
> setting it to the entire XbpBrowse.
>
> The problem is that setting foreground color
> (oBrowse:GetColumn(i):ColorBlock) is not working if :usevisualstyle is
> set to .T. (setting background color is working alright).  Thus, to
> set a foreground color for each cell, oBrowse:usevisualstyle must be
> tuned off (.F.). is it a bug?
>
> I'd like to keep the flat style of the browser and be able to set
> foreground color as well.
>
> -Itai
Itai Ben-ArtziRe: XbpColumn:colorBlock not working with usevisualstyle.
on Tue, 13 Apr 2021 01:22:20 -0700
Jim,
I've tried that but the line separators are gone and I need them.
With Ownerdraw, the color cannot be controlled based on data from DBF
(Ownerdraw works fine with browsing an array).  I've tried different
color for odd and even rows (to create elusive line separator), but
[again] it does not work with DBF browser.  The following works on the
first page, but stop working if data is scrolled (browsing an array is
fine):
oBrowse:GetColumn(i):ColorBlock := {|x,c,r| iif(r%2=0, {,WHITE},
{,LIGHTGREEN}) }

-Itai