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


Groups > comp.lang.clipper.visual-objects > #5387 > unrolled thread

bColorCondition - once again

Started byKrystian <softb@softb.pl>
First post2013-06-19 16:03 -0700
Last post2013-06-21 16:54 +0200
Articles 5 — 3 participants

Back to article view | Back to comp.lang.clipper.visual-objects


Contents

  bColorCondition - once again Krystian <softb@softb.pl> - 2013-06-19 16:03 -0700
    Re: bColorCondition - once again "Urs Eggmann" <Urs.Eggmann@shinternet.ch> - 2013-06-20 12:29 +0200
      Re: bColorCondition - once again Krystian <softb@softb.pl> - 2013-06-20 15:15 -0700
        Re: bColorCondition - once again "Urs Eggmann" <Urs.Eggmann@shinternet.ch> - 2013-06-24 12:11 +0200
    Re: bColorCondition - once again D.J.W. van Kooten <public@ic2remove.this.com> - 2013-06-21 16:54 +0200

#5387 — bColorCondition - once again

FromKrystian <softb@softb.pl>
Date2013-06-19 16:03 -0700
SubjectbColorCondition - once again
Message-ID<07c4f917-9247-4618-9478-35f33a7757f1@googlegroups.com>
Hallo,

I fight with the bbrowser and colors for separate cells.
There is a database with personal data and two fields for each day of month.
In one field is stored the kind of day ("black" or "red"; not shown in the bb) and in the second a user should type a data.
I would like to distinguish the cells with different colors depends on the kind of the day. People (in rows) have different combinations of red and black days.
How should i write the color condition ?
I tried many versions but i still look for ...
for dd := 1 to 31
....
cfld := 'RD_'+mmdd (mm - month, dd - day : RD_0620) field for kind of the day
ccond := "Server:FieldGet("+cfld+") = 'R'"
ocolor := bColorCondition(ccond, srv, ...
or
ocolor := bCC(&("{|Server|"+ccond+"}"), srv ,,,

Thank you for any suggestion
Krystian 

[toc] | [next] | [standalone]


#5389

From"Urs Eggmann" <Urs.Eggmann@shinternet.ch>
Date2013-06-20 12:29 +0200
Message-ID<b2g3skF89j4U1@mid.individual.net>
In reply to#5387
Hi Krystian,

Show us a little bit more code.... (Geoff would say (g))

In your fragment I miss  the lines:
oBrowser:ColorCondition:Add(oColorCondition)
oBrowser:Refresh()
are they  there?
regards
Urs


"Krystian" <softb@softb.pl> schrieb im Newsbeitrag 
news:07c4f917-9247-4618-9478-35f33a7757f1@googlegroups.com...
> Hallo,
>
> I fight with the bbrowser and colors for separate cells.
> There is a database with personal data and two fields for each day of 
> month.
> In one field is stored the kind of day ("black" or "red"; not shown in the 
> bb) and in the second a user should type a data.
> I would like to distinguish the cells with different colors depends on the 
> kind of the day. People (in rows) have different combinations of red and 
> black days.
> How should i write the color condition ?
> I tried many versions but i still look for ...
> for dd := 1 to 31
> ....
> cfld := 'RD_'+mmdd (mm - month, dd - day : RD_0620) field for kind of the 
> day
> ccond := "Server:FieldGet("+cfld+") = 'R'"
> ocolor := bColorCondition(ccond, srv, ...
> or
> ocolor := bCC(&("{|Server|"+ccond+"}"), srv ,,,
>
> Thank you for any suggestion
> Krystian 

[toc] | [prev] | [next] | [standalone]


#5394

FromKrystian <softb@softb.pl>
Date2013-06-20 15:15 -0700
Message-ID<06ae195c-a868-4076-90f1-2d6cee0604a1@googlegroups.com>
In reply to#5389
W dniu czwartek, 20 czerwca 2013 12:29:13 UTC+2 użytkownik Urs Eggmann napisał:
> Hi Krystian,
> 
> 
> 
> Show us a little bit more code.... (Geoff would say (g))
> 
> 
> 
> In your fragment I miss  the lines:
> 
> oBrowser:ColorCondition:Add(oColorCondition)
> 
> oBrowser:Refresh()
> 
> are they  there?
> 
> regards
> 
> Urs
> 
> 
> 
> 
> 
> "Krystian" <softb@softb.pl> schrieb im Newsbeitrag 
> 
> news:07c4f917-9247-4618-9478-35f33a7757f1@googlegroups.com...
> 
> > Hallo,
> 
> >
> 
> > I fight with the bbrowser and colors for separate cells.
> 
> > There is a database with personal data and two fields for each day of 
> 
> > month.
> 
> > In one field is stored the kind of day ("black" or "red"; not shown in the 
> 
> > bb) and in the second a user should type a data.
> 
> > I would like to distinguish the cells with different colors depends on the 
> 
> > kind of the day. People (in rows) have different combinations of red and 
> 
> > black days.
> 
> > How should i write the color condition ?
> 
> > I tried many versions but i still look for ...
> 
> > for dd := 1 to 31
> 
> > ....
> 
> > cfld := 'RD_'+mmdd (mm - month, dd - day : RD_0620) field for kind of the 
> 
> > day
> 
> > ccond := "Server:FieldGet("+cfld+") = 'R'"
> 
> > ocolor := bColorCondition(ccond, srv, ...
> 
> > or
> 
> > ocolor := bCC(&("{|Server|"+ccond+"}"), srv ,,,
> 
> >
> 
> > Thank you for any suggestion
> 
> > Krystian

Hallo,
Thank you for your concern.
Here is an excerpt from PostInit
in the database rcp_dane there are three fields for each day 
RD_mmdd - the kind of the day - red, black
GP_mmdd - the amount of hours
ZM_mmdd - the starting hour/the begin of the work
i would like to color fields GP_?? and ZM_?? in connection with the value of RD_??

tnp := {{'ZM_', 'Zmiana'}, {'GP_', 'Praca'}}

dt1 := xData_pocz
pocz_pol := n

DO WHILE dt1 <= xData_kon
 suf_dt := Right(DToS(dt1), 4)
 suf_cap := right(suf_dt, 2)+left(suf_dt, 2)
 FOR np := 1 TO 2
  n := n + 1

  pole := tnp[np, 1]+suf_dt
  oCol := bDataColumn{SELF:oDCB_Browser, SELF:rcp_dane, pole, #field}
  SELF:oDCB_Browser:AddColumn(oCol)
  SELF:oDCB_Browser:OpenColumn(oCol,n)
  SELF:oDCB_Browser:ColumnList[n]:Caption := Transform(suf_cap, '@R 99-99')+' '+xTab_skd[DoW(dt1)]+crlf+tnp[np, 2]
  SELF:oDCB_Browser:ColumnList[n]:Width := 70
  IF np = 2
   SELF:oDCB_Browser:ColumnList[n]:FieldSpec:Picture := "@R ##:99"
  ENDIF

  IF dt1 = Today()
   SELF:oDCB_Browser:ColumnList[n]:DataView := bViewStyle{, Brush{Color{COLORGREEN}}, BALIGN_CENTER}
  ELSE
   SELF:oDCB_Browser:ColumnList[n]:DataView := bViewStyle{,, BALIGN_CENTER}
  ENDIF
			
  oCol:Editable := TRUE
  oCol:AutoEdit := #Excel

  pole := 'RD_' + suf_dt			
  warunek := "Server:FieldGet("+pole+") = 'R'"
//oColor := bColorCondition{&("{|Server| "+warunek+"}"), oCol:Server, Color{COLORBLUE}, Brush{Color{COLORRED}}}

  oColor := bColorCondition{{|Server|_Rodzaj_dnia(Server, dt1) = 'R'}, SELF:rcp_dane, Color{COLORBLUE}, Brush{Color{COLORRED}}}
  oCol:ColorCondition:Add(oColor)
			
  warunek := "Server:FieldGet("+pole+") # 'R'"
  oColor := bColorCondition{{|Server|Server:FIELDGET(String2Symbol('RD_'+Right(DToS(dt1), 4))) # 'R'}, SELF:rcp_dane, Color{COLORRED}, Brush{Color{COLORBLUE}, HATCHDIAGONALCROSS}}

// oColor := bColorCondition{&("{|Server| "+warunek+"}"), oCol:Server, Color{COLORRED}, Brush{Color{COLORBLUE}, HATCHDIAGONALCROSS}}
 oCol:ColorCondition:Add(oColor)
			
// 			warunek := 'Server:Kolor_dnia()'
// 			oColor := bColorCondition{warunek, SELF:Server, Color{COLORRED}, Brush{Color{COLORBLUE}, HATCHDIAGONALCROSS}}

  SELF:oDCB_Browser:Recalculate()
  SELF:oDCB_Browser:Refresh()
  SELF:oDCB_Browser:Redraw( #Caption, TRUE )
  SELF:oDCB_Browser:Redraw( #FromColumn, TRUE, n )
NEXT
dt1 ++
ENDDO

Thank you
Krystian

[toc] | [prev] | [next] | [standalone]


#5402

From"Urs Eggmann" <Urs.Eggmann@shinternet.ch>
Date2013-06-24 12:11 +0200
Message-ID<b2qkb4FgpluU1@mid.individual.net>
In reply to#5394
Hi Krystian,

Check your mail, there you will find a sample-app. I could not send a
binariy attachment here.
regards
Urs


"Krystian" <softb@softb.pl> schrieb im Newsbeitrag 
news:06ae195c-a868-4076-90f1-2d6cee0604a1@googlegroups.com...
W dniu czwartek, 20 czerwca 2013 12:29:13 UTC+2 użytkownik Urs Eggmann 
napisał:
> Hi Krystian,
>
>
>
> Show us a little bit more code.... (Geoff would say (g))
>
>
>
> In your fragment I miss  the lines:
>
> oBrowser:ColorCondition:Add(oColorCondition)
>
> oBrowser:Refresh()
>
> are they  there?
>
> regards
>
> Urs
>
>
>
>
>
> "Krystian" <softb@softb.pl> schrieb im Newsbeitrag
>
> news:07c4f917-9247-4618-9478-35f33a7757f1@googlegroups.com...
>
> > Hallo,
>
> >
>
> > I fight with the bbrowser and colors for separate cells.
>
> > There is a database with personal data and two fields for each day of
>
> > month.
>
> > In one field is stored the kind of day ("black" or "red"; not shown in 
> > the
>
> > bb) and in the second a user should type a data.
>
> > I would like to distinguish the cells with different colors depends on 
> > the
>
> > kind of the day. People (in rows) have different combinations of red and
>
> > black days.
>
> > How should i write the color condition ?
>
> > I tried many versions but i still look for ...
>
> > for dd := 1 to 31
>
> > ....
>
> > cfld := 'RD_'+mmdd (mm - month, dd - day : RD_0620) field for kind of 
> > the
>
> > day
>
> > ccond := "Server:FieldGet("+cfld+") = 'R'"
>
> > ocolor := bColorCondition(ccond, srv, ...
>
> > or
>
> > ocolor := bCC(&("{|Server|"+ccond+"}"), srv ,,,
>
> >
>
> > Thank you for any suggestion
>
> > Krystian

Hallo,
Thank you for your concern.
Here is an excerpt from PostInit
in the database rcp_dane there are three fields for each day
RD_mmdd - the kind of the day - red, black
GP_mmdd - the amount of hours
ZM_mmdd - the starting hour/the begin of the work
i would like to color fields GP_?? and ZM_?? in connection with the value of 
RD_??

tnp := {{'ZM_', 'Zmiana'}, {'GP_', 'Praca'}}

dt1 := xData_pocz
pocz_pol := n

DO WHILE dt1 <= xData_kon
 suf_dt := Right(DToS(dt1), 4)
 suf_cap := right(suf_dt, 2)+left(suf_dt, 2)
 FOR np := 1 TO 2
  n := n + 1

  pole := tnp[np, 1]+suf_dt
  oCol := bDataColumn{SELF:oDCB_Browser, SELF:rcp_dane, pole, #field}
  SELF:oDCB_Browser:AddColumn(oCol)
  SELF:oDCB_Browser:OpenColumn(oCol,n)
  SELF:oDCB_Browser:ColumnList[n]:Caption := Transform(suf_cap, '@R 
99-99')+' '+xTab_skd[DoW(dt1)]+crlf+tnp[np, 2]
  SELF:oDCB_Browser:ColumnList[n]:Width := 70
  IF np = 2
   SELF:oDCB_Browser:ColumnList[n]:FieldSpec:Picture := "@R ##:99"
  ENDIF

  IF dt1 = Today()
   SELF:oDCB_Browser:ColumnList[n]:DataView := bViewStyle{, 
Brush{Color{COLORGREEN}}, BALIGN_CENTER}
  ELSE
   SELF:oDCB_Browser:ColumnList[n]:DataView := bViewStyle{,, BALIGN_CENTER}
  ENDIF

  oCol:Editable := TRUE
  oCol:AutoEdit := #Excel

  pole := 'RD_' + suf_dt
  warunek := "Server:FieldGet("+pole+") = 'R'"
//oColor := bColorCondition{&("{|Server| "+warunek+"}"), oCol:Server, 
Color{COLORBLUE}, Brush{Color{COLORRED}}}

  oColor := bColorCondition{{|Server|_Rodzaj_dnia(Server, dt1) = 'R'}, 
SELF:rcp_dane, Color{COLORBLUE}, Brush{Color{COLORRED}}}
  oCol:ColorCondition:Add(oColor)

  warunek := "Server:FieldGet("+pole+") # 'R'"
  oColor := 
bColorCondition{{|Server|Server:FIELDGET(String2Symbol('RD_'+Right(DToS(dt1), 
4))) # 'R'}, SELF:rcp_dane, Color{COLORRED}, Brush{Color{COLORBLUE}, 
HATCHDIAGONALCROSS}}

// oColor := bColorCondition{&("{|Server| "+warunek+"}"), oCol:Server, 
Color{COLORRED}, Brush{Color{COLORBLUE}, HATCHDIAGONALCROSS}}
 oCol:ColorCondition:Add(oColor)

// warunek := 'Server:Kolor_dnia()'
// oColor := bColorCondition{warunek, SELF:Server, Color{COLORRED}, 
Brush{Color{COLORBLUE}, HATCHDIAGONALCROSS}}

  SELF:oDCB_Browser:Recalculate()
  SELF:oDCB_Browser:Refresh()
  SELF:oDCB_Browser:Redraw( #Caption, TRUE )
  SELF:oDCB_Browser:Redraw( #FromColumn, TRUE, n )
NEXT
dt1 ++
ENDDO

Thank you
Krystian 

[toc] | [prev] | [next] | [standalone]


#5398

FromD.J.W. van Kooten <public@ic2remove.this.com>
Date2013-06-21 16:54 +0200
Message-ID<prp8s8dh64j7rdk29vvhvluleqd4opr5bj@4ax.com>
In reply to#5387
On Wed, 19 Jun 2013 16:03:27 -0700 (PDT), Krystian <softb@softb.pl>
wrote:

Hello Krystian,

>How should i write the color condition ?


Something like this, to colour the column  containg field #cust when
datein has expired >10 days


oColumn := oBrowser:GetColumn(#CUST)
IF oColumn<>NULL_OBJECT
	nExpire:=10
	cExpcond:="(Today()-Server:datum>"+NTrim(nExpire)+".AND.
Today()-Server:datein<"+NTrim(nExpire+10)+") .and. .not. Server:Paid"
oBrush := Brush{ Color{ 255,200,200}}
oColorCondition := bColorCondition{ cExpCond,odbMyDBF,,oBrush }
oColumn:ColorCondition:Add(oColorCondition)				
ENDIF

or this

cColCond1 := "server:towho=='" + cUser + "'" // To colour items of the
logged in user green
SELF:oDCBAgenda:SetColorConditions (#DESC, cColCond2, Color
{COLORBLACK}, oBrushOrange)   		
(etc)

Dick

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.clipper.visual-objects


csiph-web