Green Bar effect using TBrowse() or custom function? 
Author Message
 Green Bar effect using TBrowse() or custom function?

Is there any way to program using the TBROWSE function to simulate Green Bar Paper when browsing a file (specifically a text file)?

Does anyone have any routines that will do this without TBROWSE?



Tue, 18 Feb 2003 00:51:00 GMT  
 Green Bar effect using TBrowse() or custom function?
John

Play around with the 'colorblock' of TBColumn class to get the effect you
want.
To get alternate colors for each line use 'oTB:RowPos % 2 == 0' to get your
odd/even colours.

--
HTH
Steve Quinn
Born free........Taxed to death.
I used to have a handle on life, but it broke.
WANTED: Meaningful Overnight Relationship.
BEER: It's not just for breakfast anymore.


Is there any way to program using the TBROWSE function to simulate Green Bar
Paper when browsing a file (specifically a text file)?

Does anyone have any routines that will do this without TBROWSE?



Tue, 18 Feb 2003 08:08:34 GMT  
 Green Bar effect using TBrowse() or custom function?
Hi Stephen,
                 I am using clipper 5.2e.  I cant find any reference to "
RowPos %2 ".  Is this only a clip5.3 ability?

--
Scott Burke


Quote:
> John

> Play around with the 'colorblock' of TBColumn class to get the effect you
> want.
> To get alternate colors for each line use 'oTB:RowPos % 2 == 0' to get
your
> odd/even colours.



Tue, 18 Feb 2003 16:13:16 GMT  
 Green Bar effect using TBrowse() or custom function?
Scot

From the Help on TBrowse
-------------------------------------------------------
     RowPos                                          (Assignable)

        Contains a numeric value indicating the data row where the browse
cursor
        is currently located.  Data rows are numbered from one, starting
with
        the topmost data row.  Screen rows containing headings, footings or
        separators are not considered data rows.

        nCurrentRow := oTB:RowPos

From the Help on TBColumn
-------------------------------------------------------

     ColorBlock                                       (Assignable)

        Contains an optional code block that determines the color of data
        items as they are displayed.  If present, this block is executed
each
        time a new value is retrieved via the TBColumn:Block (the data
        retrieval block).  The newly retrieved data value is passed as an
        argument to the TBColumn:ColorBlock, which must return an array
        containing two numeric values.  The values returned are used as
        indexes into the color table of the TBrowse object as described in
        the TBColumn:defColor reference below.

        The TBColumn:ColorBlock allows display colors for data items based
on
        the value of the data being displayed.  For example, negative
numbers
        may be displayed in a different color than positive numbers.

        oTBCol:ColorBlock := {|x| IF(x < 0, {5,2},;
                                IF(x > 0, {8,2}, {4,2}))}

---------------------------------------------------------------
So what you do is something along the lines of

oTB := TBrowseNew{}
oCol := TBColumnNew{}
oCol:colorblock := {|| if( oTB:rowpos % 2 == 0, {5,2},{4,2})}
oTB:Addcoluimn(oCol)
Add more columns etc...

--
HTH
Steve Quinn
Born free........Taxed to death.
I used to have a handle on life, but it broke.
WANTED: Meaningful Overnight Relationship.
BEER: It's not just for breakfast anymore.


Quote:
> Hi Stephen,
>                  I am using clipper 5.2e.  I cant find any reference to "
> RowPos %2 ".  Is this only a clip5.3 ability?

> --
> Scott Burke



> > John

> > Play around with the 'colorblock' of TBColumn class to get the effect
you
> > want.
> > To get alternate colors for each line use 'oTB:RowPos % 2 == 0' to get
> your
> > odd/even colours.



Wed, 19 Feb 2003 10:20:39 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Scroll bars and TBrowse

2. (SETF (FUNCTION FOO) (FUNCTION BAR)) ?

3. Tbrowse help needed - tbrowse [1/1]

4. need function for tbrowse with user search

5. Avoiding functions with side effects

6. Functions without side effects (was Old confusion)

7. Wrapping a side-effecting function library

8. Side-effect free functions

9. bashing BASIC (Was: Functions without side effects)

10. Side effects in Ada functions

11. openMP: threadprivate not effected and function variables not passed

12. Function side effects

 

 
Powered by phpBB® Forum Software