Task of color of the chosen field in DCBROWSE DCBROWSECOL

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Task of color of the chosen field in DCBROWSE DCBROWSECOL

#1 Post by Eugene Lutsenko »

How to set color of the chosen field in DCBROWSE DCBROWSECOL?

Image

Too dark color of the cursor. I would allocate new paragraphs simply in bold if could, but it was necessary to allocate with color.

By the way, and how to make, that the font type in the field depended on its value? I tried to make how Clifford prompted with color of a field, with use of the block of a code, but at me it did not turn out.

Code: Select all

/* ----- Create browse ----- */

aColors := { {GRA_CLR_WHITE,GRA_CLR_DARKRED}, ;
             {GRA_CLR_WHITE,GRA_CLR_DARKBLUE}, ;
             {GRA_CLR_BLACK,GRA_CLR_DARKGREEN} }

aPres := ;
  { { XBP_PP_COL_HA_FGCLR, GRA_CLR_WHITE },    /*  Header FG Color  */     ;
    { XBP_PP_COL_HA_BGCLR, GRA_CLR_DARKGRAY }, /*  Header BG Color  */     ;
    { XBP_PP_COL_FA_FGCLR, GRA_CLR_YELLOW },   /*  Footer FG Color  */     ;
    { XBP_PP_COL_FA_BGCLR, GRA_CLR_DARKGRAY }, /*  Footer BG Color  */     ;
    { XBP_PP_COL_DA_ROWSEPARATOR, XBPCOL_SEP_DOTTED },  /* Row Sep  */     ;
    { XBP_PP_COL_DA_COLSEPARATOR, XBPCOL_SEP_DOTTED },  /* Col Sep  */     ;
    { XBP_PP_COL_DA_ROWHEIGHT, 20 },                  /* Row Height */     ;
    { XBP_PP_COL_DA_CELLHEIGHT, 20 }  }              /* Cell Height */

PRIVATE bColorBlock:={|| iif(Dost_mod->P_Avr_T=M_MaxVal,{GRA_CLR_RED,nil},iif(Dost_mod->P_Avr_T=0,{GRA_CLR_WHITE,nil},{GRA_CLR_BLACK,nil})) }  // Клиффорд

@ 1, 0 DCBROWSE oBrowse ALIAS 'Dost_mod' SIZE 131,27    ;
       PRESENTATION DC_BrowPres() ;                                     // Только просмотр БД Users
       HEADLINES 4                ;                                     // Кол-во строк в заголовке

WNF = 8
DCBROWSECOL FIELD Dost_mod->Type_Model HEADER "Наименование модели и частного критерия"    PARENT oBrowse                  COLOR bColorBlock WIDTH 31  
DCBROWSECOL FIELD Dost_mod->Int_Krit   HEADER "Интегральный критерий"                      PARENT oBrowse                  COLOR bColorBlock WIDTH 15  
DCBROWSECOL DATA FieldAnchor(3)        HEADER "Вероятность;правильной;идентифкации"        PARENT oBrowse FONT "9.Courier" COLOR bColorBlock WIDTH WNF 
DCBROWSECOL DATA FieldAnchor(4)        HEADER "Вероятность;правильной;не идентифкации"     PARENT oBrowse FONT "9.Courier" COLOR bColorBlock WIDTH WNF 
DCBROWSECOL DATA FieldAnchor(5)        HEADER "Средняя;вероятность;правильного;результата" PARENT oBrowse FONT "9.Courier Bold"  COLOR bColorBlock WIDTH WNF 
DCBROWSECOL FIELD Dost_mod->Date       HEADER "Дата;получения;результата"                  PARENT oBrowse FONT "9.Courier" COLOR bColorBlock WIDTH 10  
DCBROWSECOL FIELD Dost_mod->Time       HEADER "Время;получения;результата"                 PARENT oBrowse FONT "9.Courier" COLOR bColorBlock WIDTH  8  

DCGETOPTIONS TABSTOP

DCREAD GUI ;
   OPTIONS GetOptions ;
   MODAL ;
   TITLE '4.1.3.6. Обобщ.форма по достов.моделей при разн.инт.крит.'+'. Текущая модель: "'+UPPER(Ar_Model[M_CurrInf])+'"';
   FIT ;
   CLEAREVENTS

User avatar
sdenjupol148
Posts: 151
Joined: Thu Jan 28, 2010 10:27 am
Location: NYC

Re: Task of color of the chosen field in DCBROWSE DCBROWSECO

#2 Post by sdenjupol148 »

Eugene,

Add these parameters to your PRESENTATION Clause in DCBROWSE:

{ XBP_PP_COL_DA_HILITE_FGCLR, GRA_CLR_WHITE },; /// Cell Highlighted FG
{ XBP_PP_COL_DA_HILITE_BGCLR, GRA_CLR_BLUE },; /// Cell Highlighted BG

You can of course change the color GRA_CLR_WHITE and GRA_CLR_BLUE to anything you want.

XBP_PP_COL_DA_HILITE_FGCLR is the highlighted foreground color
XBP_PP_COL_DA_HILITE_BGCLR is the highlighted background color

Good Luck!

Bobby Drakos

skiman
Posts: 1199
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Task of color of the chosen field in DCBROWSE DCBROWSECO

#3 Post by skiman »

Hi Bobby,

Glad to see you are online. I saw the news yesterday evening, and it seemed as Sandy damaged a lot. I don't know if it is in the area where you are living.
Best regards,

Chris.
www.aboservice.be

Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Re: Task of color of the chosen field in DCBROWSE DCBROWSECO

#4 Post by Cliff Wiernik »

I don't think I was able to change the foreground color successfully. My routine changes the background color and works fine. You are trying to change the foreground color.

A sample is attached. The normal background is the light orange color. The blue bar is the normal cursor bar and the black on light yellow is when the color is changed. Again, if I recall, I was not able to change the foreground color in this way without other non-desired effects.

Code: Select all

color to use for different acctmemo lines
*+      depending on the cCode received
*+
*+      X - Collection Department Management/Supervisory Staff
*+      Y - Credit Department Management/Supervisory Staff
*+
*+±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
*+
FUNCTION ME_GetColors(cCode)
  LOCAL aColors := {nil, GRAMakeRGBColor(m->G_MemoBGCLR)}
  
  DO CASE
    CASE TRIM(cCode) == 'X'
      aColors := {nil, GRAMakeRGBColor({m->G_MemoBGCLR[1], m->G_MemoBGCLR[2]+50, m->G_MemoBGCLR[3]+0} ) }
    CASE TRIM(cCode) == 'Y'                                                     // PC BDJ 12-14-07
      aColors := {nil, GRAMakeRGBColor({120,225,255}) }                         // PC BDJ 12-14-07
  ENDCASE

  RETURN aColors
Attachments
browse.jpg
browse.jpg (212.87 KiB) Viewed 9022 times

User avatar
sdenjupol148
Posts: 151
Joined: Thu Jan 28, 2010 10:27 am
Location: NYC

Re: Task of color of the chosen field in DCBROWSE DCBROWSECO

#5 Post by sdenjupol148 »

Hi Chris,

During the height of the hurricane which was 8:00 PM Monday evening, my family and I ventured outside of our home to see how bad it was.
Basically, all we had was a few raindrops and some wind.
Ten miles in either direction there was chaos, flooding and power outages; but in our neighborrhood, not even the trash cans got tossed about.
If it wasn't for the pictures on the news, we would never guess that anything happened.
We are obviously very fortunate!

Thanks for thinking of us.
Hope all is well with you.

Bobby

Post Reply