ZEBRA and TAGGING

This forum is for eXpress++ general support.
Post Reply
Message
Author
Victorio
Posts: 633
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

ZEBRA and TAGGING

#1 Post by Victorio »

Hi,
I use ZEBRA in DCBROWSE, it is fine, super function,
but I also need tagging records, and this not work .
I mean, colors from ZEBRA rewrites TAG color.

Can use ZEBRA and TAGGING simultaneously ?, or need write own function ?

Edit : now i used two lines of DCBROWSE, with if else...
if x=1 // if want use tagging and no need zebra
...DCBROWSE
...
else
... DCBROWSE
ZEBRA ...
endif

I do not need in this case to work with ZEBRA and TAGGING records both.

User avatar
Auge_Ohr
Posts: 1428
Joined: Wed Feb 24, 2010 3:44 pm

Re: ZEBRA and TAGGING

#2 Post by Auge_Ohr »

hi,

can you please show a Picture of your Problem.
is your "Tagging Color" overwrite by Row-Cursor ?
greetings by OHR
Jimmy

Victorio
Posts: 633
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

Re: ZEBRA and TAGGING

#3 Post by Victorio »

Hi, Jimmy,

If I put ZEBRA to DCBROWSE, and "tagging" rows, still stay b/w (tagcolor bg I have yellow).
If disable ZEBRA, tagging is ok.

here is part of source :

if jearchiv=1 .and. aktivarchiv=0 .and. oa_pa=1 // iba pri splnení sa načíta verzia zo ZEBROU
***********************************************************
* with ZEBRA, but tagging no function
@pozypa,10 DCBROWSE oBrowsepa ALIAS "CPARCELY" ;
SIZE rozxpa, rozypa PIXEL ;
NOSOFTTRACK ;
SCOPE ;
OPTIMIZE ;
CURSORMODE XBPBRW_CURSOR_ROW ;
ITEMMARKED {||Eval(bVLA),Eval(bSTA),;
DC_GetRefresh(GetList,, ;
DCGETREFRESH_TYPE_EXCLUDE,(GETLIST_BROWSE))} ;
SCROLLBARHEIGHT 12 ;
TAGENABLE ;
TAGELEMENT 35 ;
TAGCOLOR GRA_CLR_RED, GRA_CLR_YELLOW ;
TAGMODE DCGUI_TAGMODE_CLEAR ;
ZEBRA {|lEven1|Jd_BrowseZebraColor3(lEven1,CPARCELY->S)}

else
*****
* without ZEBRA, tagging is ok
@pozypa,10 DCBROWSE oBrowsepa ALIAS "CPARCELY" ;
SIZE rozxpa, rozypa PIXEL ;
NOSOFTTRACK ;
SCOPE ;
OPTIMIZE ;
CURSORMODE XBPBRW_CURSOR_ROW ;
ITEMMARKED {||Eval(bVLA),Eval(bSTA),;
DC_GetRefresh(GetList,, ;
DCGETREFRESH_TYPE_EXCLUDE,(GETLIST_BROWSE))} ;
SCROLLBARHEIGHT 12 ;
TAGENABLE ;
TAGELEMENT 35 ;
TAGCOLOR GRA_CLR_RED, GRA_CLR_YELLOW ;
TAGMODE DCGUI_TAGMODE_CLEAR
endif
*****

in Jd_BrowseZebraColor3 I have settings for several BG colors by field "S" in ALIAS CPARCELY

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: ZEBRA and TAGGING

#4 Post by rdonnay »

Tag color doesn't work with ZEBRA.
This feature was added by another eXpress++ user and I haven't fully tested it with tagging.

Here is a workaround that will work for you:

Code: Select all

LOCAL aEvenRowColor := {GRA_CLR_BLACK,GraMakeRGBColor({255,255,170})}
LOCAL aOddRowColor := {GRA_CLR_BLACK,GraMakeRGBColor({159,231,176})}

@ 0,0 DCBROWSE oBrowse DATA aDir SIZE 100,20 FIT ;
      ITEMSELECTED {||DC_ReadGuiEvent(DCGUI_EXIT_OK,GetList)} ;
      PRESENTATION DC_BrowPres() ;
      COLOR {|a,b,o|IIF(aDir[oBrowse:arrayElement,11],{GRA_CLR_RED,GRA_CLR_YELLOW}, ;
                    IIF(oBrowse:arrayElement%2==0, aEvenRowColor, aOddRowColor ))} ;
      TAGENABLE ;
        TAGELEMENT 35 ;       
        TAGMODE DCGUI_TAGMODE_CLEAR
The eXpress train is coming - and it has more cars.

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: ZEBRA and TAGGING

#5 Post by rdonnay »

If you are browsing a database, then this is the best technique. It handles tagged records and deleted records.

Code: Select all

@ 1,0 DCBROWSE oBrowse ALIAS 'ROSTER' SIZE 140,29 ;
      TAGENABLE ;
        TAGCOLOR GRA_CLR_RED, GRA_CLR_YELLOW ;
      COLOR {|o|BrowseRowColor(o)}

* ---------------

STATIC FUNCTION BrowseRowColor(oBrowse)

LOCAL aColor

// Don't change this
IF ROSTER->(RecNo()) <> oBrowse:nBRow
  oBrowse:lBRow := !oBrowse:lBRow
  oBrowse:nBRow := ROSTER->(RecNo())
ENDIF

// This is your custom code
IF ROSTER->(DC_Tagged())
  aColor := {GRA_CLR_BLACK,GRA_CLR_YELLOW}
ELSEIF ROSTER->(deleted())
  aColor := {GRA_CLR_RED,GRA_CLR_WHITE}
ELSEIF oBrowse:lBRow
  aColor := {nil,GRA_CLR_WHITE}
ELSE
  aColor := {nil,GraMakeRGBColor({230,230,230})}
ENDIF

RETURN aColor
The eXpress train is coming - and it has more cars.

Post Reply