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


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

Re: bColorCondition - once again

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.fsmpi.rwth-aachen.de!news-1.dfn.de!news.dfn.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From "Urs Eggmann" <Urs.Eggmann@shinternet.ch>
Newsgroups comp.lang.clipper.visual-objects
Subject Re: bColorCondition - once again
Date Mon, 24 Jun 2013 12:11:22 +0200
Lines 165
Message-ID <b2qkb4FgpluU1@mid.individual.net> (permalink)
References <07c4f917-9247-4618-9478-35f33a7757f1@googlegroups.com> <b2g3skF89j4U1@mid.individual.net> <06ae195c-a868-4076-90f1-2d6cee0604a1@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; format=flowed; charset="utf-8"; reply-type=original
Content-Transfer-Encoding 8bit
X-Trace individual.net OKmc6vjjz5tgc9zQk9pxqQGbN3GZrRxSEiKOIeD6j3XU6ey+1t
Cancel-Lock sha1:b9LbM+/GXudPa+XZVxxNjA+4ng0=
X-Priority 3
X-MSMail-Priority Normal
X-Newsreader Microsoft Outlook Express 6.00.2900.5931
X-MimeOLE Produced By Microsoft MimeOLE V6.00.2900.6157
X-EsetId 35EFE320EBB6393466AEBA
X-EsetScannerBuild 14140
Xref csiph.com comp.lang.clipper.visual-objects:5402

Show key headers only | View raw


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 

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


Thread

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

csiph-web