Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #11100

Re: bBrowser cell color

From "Glen Townsley" <coogee.2015@gmail.com>
Newsgroups comp.lang.clipper.visual-objects
Subject Re: bBrowser cell color
Date 2017-10-28 05:55 +1000
Organization Aioe.org NNTP Server
Message-ID <ot02v6$1344$1@gioia.aioe.org> (permalink)
References <781533f1-4af6-4b80-b38c-6e98fa1a30d8@googlegroups.com>

Show all headers | View raw


Sebastian,

There are 2 ways I have approached this.

1. I create a protected variable of the server called aHiLite and fill it 
with the the record numbers of the records I want to highlight. The the 
colorcondition becomes something like

oColorCondition := bColorCondition{    { |oS| oS:IsHiLite() }, ;
                                                                oItemArrServer, 
;
                                                                color{ 
SELF:Owner:nHiLiteR, SELF:Owner:nHiLiteG, SELF:Owner:nHiLiteB }, ;
                                                                   }
I am using a foreground highlight, but you could easily use it for 
background highlights.

2. There is a little known feature of bBrowser that I have just started to 
use in the last month or so. The colorcondition's second parameter need not 
be a server object. So you can use

oColorCondition := bColorCondition{    { |oWindow| 
oWindow:ColourConditions() }, ;
                                                                    SELF, ;
                                                                    , ;
                                                                     }
oB:ColorCondition:Add( oColorCondition )

and call a method of the window. This method can return true/false but it 
can also return an array. The method might look like

METHOD ColourConditions() CLASS QtyAtCompMgtWin
    LOCAL uVal                                AS USUAL                    // 
can be array or false
    LOCAL oS                                AS bArrayServer
    LOCAL oB                                AS scbBrowser
    LOCAL aBGFormula                        AS ARRAY
    LOCAL aFGFormula                        AS ARRAY
    LOCAL oIni                                AS scFabRegistry

    uVal := FALSE

    oB := SELF:oDCbBrowseItems
    oS := oB:Server

    IF PCE_IsFormula( cDesc ) != #NOFORMULA 
// formula
            aBGFormula := { oIni:GetIniString( 'FORMULA', 'MAKE_BG_RED', 
251 ), ;
                                        oIni:GetIniString( 'FORMULA', 
'MAKE_BG_GREEN', 245 ), ;
                                        oIni:GetIniString( 'FORMULA', 
'MAKE_BG_BLUE', 181 ) }
            aFGFormula := { oIni:GetIniString( 'FORMULA', 'MAKE_FG_RED', 
0 ), ;
                                        oIni:GetIniString( 'FORMULA', 
'MAKE_FG_GREEN', 0 ), ;
                                        oIni:GetIniString( 'FORMULA', 
'MAKE_FG_BLUE', 0 ) }
            uVal := ArrayNew( BCS_ITEMS )
            uVal[BCS_BACKGROUND] := Brush{ Color{ aBGFormula[1], 
aBGFormula[2], aBGFormula[3] } }
            uVal[BCS_FOREGROUND] := Color{ aFGFormula[1], aFGFormula[2], 
aFGFormula[3] }
    endif
RETURN uVal

Again, I'm using it for row colorconditions but it should be able to be 
adapted for column colorconditions.

HTH

Glen Townsley

wrote in message 
news:781533f1-4af6-4b80-b38c-6e98fa1a30d8@googlegroups.com...

Hi everyone, there is a simple way to paint a cell indicating row (or recno) 
and column?
Today, if i want to paint a cell i use color conditions on columns and puts 
as condition something like:
Server:Recno = 1 .OR. Server:Recno = 7 .OR. Server:Recno = 23 .OR. and so 
on...

but i think tha must be a better solution.
Regards.

Sebastián 

Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

bBrowser cell color ccyasa.sbassano@gmail.com - 2017-10-26 16:31 -0700
  Re: bBrowser cell color "Glen Townsley" <coogee.2015@gmail.com> - 2017-10-28 05:55 +1000
    Re: bBrowser cell color ccyasa.sbassano@gmail.com - 2017-10-28 05:38 -0700
  Re: bBrowser cell color Martin <Martin@spam.spam> - 2017-10-31 12:08 +0000
    Re: bBrowser cell color "Urs Eggmann" <Urs.Eggmann@shinternet.ch> - 2017-10-31 13:12 +0100
      Re: bBrowser cell color Martin <Martin@spam.spam> - 2017-10-31 15:06 +0000
    Re: bBrowser cell color ccyasa.sbassano@gmail.com - 2017-10-31 06:32 -0700
      Re: bBrowser cell color James Martin <james@northwoodlumber.com> - 2017-10-31 10:33 -0400
        Re: bBrowser cell color ccyasa.sbassano@gmail.com - 2017-10-31 07:58 -0700
        Re: bBrowser cell color ccyasa.sbassano@gmail.com - 2017-10-31 08:00 -0700
      Re: bBrowser cell color Martin <Martin@spam.spam> - 2017-10-31 15:12 +0000
        Re: bBrowser cell color ccyasa.sbassano@gmail.com - 2017-10-31 09:07 -0700

csiph-web