Page 1 of 2

Zebra stripes and FREEZELEFT problem

Posted: Sun Sep 12, 2010 9:46 am
by skiman
Hi,

While implementing the Zebra stripes of Jack Duijf in my application I had some browses with problems. The browse didn't appear on the screen. The application isn't crashing, but the browse wasn't shown.

After looking to these browses I came to the conclusion that all my browses which are using FREEZELEFT had this problem. After disabling the FREEZELEFT, these browses also appeared without problem.

Maybe someone already encountered this problem? Any solution for this?

Re: Zebra stripes and FREEZELEFT problem

Posted: Wed Sep 15, 2010 6:20 am
by skiman
Hi Roger,

In an attempt to speed up the zebra, I added the :evenrow to the browse object. Jack added it to the dcbrowsecolumn, but not to the dcbrowse object.

Can you add it to _dcxBrow.prg?

- VAR evenrow for the DC_XbpBrowse class.

- I default evenrow to .F. in the INIT method of dc_xbpbrowse and dc_xbpColumn

- Modification of DrawRow method.

Code: Select all

METHOD DC_XbpColumn:DrawRow(nP1,xP2)
::LastRow      := nP1 + ::nOffset
::EvenRow      := (Abs(::LastRow) % 2) = 0
::parent:evenrow := ::evenrow
RETURN ::XbpColumn:DrawRow(nP1,xP2)
This way the Zebra function can be simplified, and the zebra stripes are a LOT faster. The original getcolumn() in the zebra function takes too much time.

Code: Select all

Function Zebra(oBrowseOrCol)
****************************
LOCAL aRet           := {GRA_CLR_BLACK,GRA_CLR_WHITE}                         // Default black/white
LOCAL  lEvenRow

if valtype( lEvenRow:= oBrowseorCol:EvenRow ) == "L" .and. lEvenrow
    aRet        := {GRA_CLR_BLACK,GRA_CLR_YELLOW}
endif
Return aRet
This way it is also working with freezeleft.

Re: Zebra stripes and FREEZELEFT problem

Posted: Wed Sep 15, 2010 10:53 am
by rdonnay
Thank you. Will do.

Re: Zebra stripes and FREEZELEFT problem

Posted: Mon Jul 02, 2012 2:30 am
by Koverhage
Roger,

can you do this in 258 ?

Re: Zebra stripes and FREEZELEFT problem

Posted: Tue Jul 03, 2012 7:38 am
by Koverhage
Roger,

up to build 254 i this work


COLOR { |o| Zebra(o) }

with build 257 this does not work.

With build 257 this work only if i change o to oBrowse

Re: Zebra stripes and FREEZELEFT problem

Posted: Tue Jul 03, 2012 9:09 am
by rdonnay
The latest changes to the colors and presentation of the browse system were added by Jack Duijf.
I thought that I had given it all a good test by running all of my applications, but I apparently missed a few things.
Tom Liehr reported similar problems with the color system.

I am trying to work through these issues and will have a fix in build 258.

Re: Zebra stripes and FREEZELEFT problem

Posted: Sun Jul 22, 2012 5:53 am
by hz_scotty
v257
ZEBRA und FREEZE reported this

Code: Select all

   @ 3,1 DCBROWSE ::oBrowse ALIAS ::ARTSTAMM SIZE 135+nBreite,27+nHoehe;
         CURSORMODE XBPBRW_CURSOR_ROW;
         PRESENTATION aPres ; //
         ITEMSELECTED {|| DoA_Zeig(::ARTSTAMM,::lNew), ::oBrowse:refreshall() ,DC_SetAppFocus(::eSeek)  };
         WHEN {|| !(::ARTSTAMM)->(Eof())} ;
         SCOPE ;
         USEVISUALSTYLE ;
         FREEZELEFT {1} ;
         ZEBRA aEvenRowColor,aOddRowColor
ZEBRA alone -> works
FREEZELEFT alone -> works
Both -> crashed

Workaround?

Re: Zebra stripes and FREEZELEFT problem

Posted: Mon Jul 23, 2012 10:32 am
by rdonnay
Ok, I can reproduce the problem.
Will have a fix or workaround soon.

Re: Zebra stripes and FREEZELEFT problem

Posted: Mon Jul 23, 2012 11:21 am
by hz_scotty
Thanks for Workaround!

Another Problem with ZEBRA Color is, when you scroll the browse beyond the right side of the screen
the fields of view are no longer Zebra.
The Color looks like the 1st line in the Browse. Gray in my case.

Perhaps if you scroll to right or left and up and down sometimes Zebra is back ok but mostly not.

Re: Zebra stripes and FREEZELEFT problem

Posted: Mon Jul 23, 2012 11:40 am
by rdonnay
Here is an updated _DCXBROW.PRG that fixes the Zebra problems.
It employs Chris Andries faster solution and also corrects the freezeleft error.