dbTalk Databases Forums  

alternating row colors

comp.databases.paradox comp.databases.paradox


Discuss alternating row colors in the comp.databases.paradox forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
marco
 
Posts: n/a

Default alternating row colors - 12-31-2006 , 02:47 AM






pdx7,w2000/XP


rn = self.rowNo
if rn.mod(2) = 0 then
self.color=gray
else
self.color = transparent
endIf

putting this code in the open method of each field of a grid works
pretty well but leaves a short space with of the grid color among field.
The same code the tableframe.record open method does leave spaces but
does not work scrolling.
So the solution is?

thanks
marco

p.s: if you read this today 31.12 shame on you for not taking care of
your family instead of being crucified in front of your pc! But ou would
be execused as a martyr...
Happy new year to whom is reading this tomorrow

Reply With Quote
  #2  
Old   
Robert Molyneux
 
Posts: n/a

Default Re: alternating row colors - 12-31-2006 , 04:03 AM






Put the code in the newValue method of a field in the table frame / grid.

The open method only fires once. The newValue method fires for every row as
it is displayed or changed.

Try using one of the Windows colours (see help for Color Constants) instead
of gray.

"marco" <n_sp_hum_marco.foglia (AT) tucsoft (DOT) com> wrote

Quote:
pdx7,w2000/XP


rn = self.rowNo
if rn.mod(2) = 0 then
self.color=gray
else
self.color = transparent
endIf

putting this code in the open method of each field of a grid works
pretty well but leaves a short space with of the grid color among field.
The same code the tableframe.record open method does leave spaces but
does not work scrolling.
So the solution is?

thanks
marco

p.s: if you read this today 31.12 shame on you for not taking care of
your family instead of being crucified in front of your pc! But ou would
be execused as a martyr...
Happy new year to whom is reading this tomorrow



Reply With Quote
  #3  
Old   
marco
 
Posts: n/a

Default Re: alternating row colors - 01-02-2007 , 11:27 AM



Robert Molyneux wrote:
Quote:
Put the code in the newValue method of a field in the table frame / grid.

The open method only fires once. The newValue method fires for every row as
it is displayed or changed.
Cher Robert,

merci pour ta reponse,

-if you put the code in a field you will have small gaps between fields
on the same row.
-with open method works well (apart the small gaps)
-with newvalue does not work at all

I thought this code in the open method [ #record5 instead of self]:
if rn.mod(2) = 0 then
#record5.color=gray
else
#record5self.color = white
endIf

but does not work


Quote:
Try using one of the Windows colours (see help for Color Constants) instead
of gray.
i dont know if pdx7 help give you the translation of a color into
longint but while programming it's much faster to use basic color string
unless you manage to remember the code for gray (12632256), yellow
(65535), red (255). I suppose the chances corel programmers will change
the gray code are <1/10000000...





Quote:
"marco" <n_sp_hum_marco.foglia (AT) tucsoft (DOT) com> wrote in message
news:45977917$1_6 (AT) news (DOT) bluewin.ch...

pdx7,w2000/XP


rn = self.rowNo
if rn.mod(2) = 0 then
self.color=gray
else
self.color = transparent
endIf

putting this code in the open method of each field of a grid works
pretty well but leaves a short space with of the grid color among field.
The same code the tableframe.record open method does leave spaces but
does not work scrolling.
So the solution is?

thanks
marco

p.s: if you read this today 31.12 shame on you for not taking care of
your family instead of being crucified in front of your pc! But ou would
be execused as a martyr...
Happy new year to whom is reading this tomorrow




Reply With Quote
  #4  
Old   
Robert Molyneux
 
Posts: n/a

Default Re: alternating row colors - 01-02-2007 , 04:18 PM



Marco, try this code in a field in a table frame - note that the container
(ie the record) is the object to be coloured.

;==============
method newValue(var eventInfo Event)
var

myRec longint

endvar

myRec = self.recno

self.container.color = iif(myRec.mod(2) = 0, cl3DLight, Transparent)

endMethod
;==============


"marco" <n_sp_hum_marco.foglia (AT) tucsoft (DOT) com> wrote

Quote:
Robert Molyneux wrote:
Put the code in the newValue method of a field in the table frame /
grid.

The open method only fires once. The newValue method fires for every row
as
it is displayed or changed.

Cher Robert,

merci pour ta reponse,

-if you put the code in a field you will have small gaps between fields
on the same row.
-with open method works well (apart the small gaps)
-with newvalue does not work at all

I thought this code in the open method [ #record5 instead of self]:
if rn.mod(2) = 0 then
#record5.color=gray
else
#record5self.color = white
endIf

but does not work



Try using one of the Windows colours (see help for Color Constants)
instead
of gray.
i dont know if pdx7 help give you the translation of a color into
longint but while programming it's much faster to use basic color string
unless you manage to remember the code for gray (12632256), yellow
(65535), red (255). I suppose the chances corel programmers will change
the gray code are <1/10000000...






"marco" <n_sp_hum_marco.foglia (AT) tucsoft (DOT) com> wrote in message
news:45977917$1_6 (AT) news (DOT) bluewin.ch...

pdx7,w2000/XP


rn = self.rowNo
if rn.mod(2) = 0 then
self.color=gray
else
self.color = transparent
endIf

putting this code in the open method of each field of a grid works
pretty well but leaves a short space with of the grid color among field.
The same code the tableframe.record open method does leave spaces but
does not work scrolling.
So the solution is?

thanks
marco

p.s: if you read this today 31.12 shame on you for not taking care of
your family instead of being crucified in front of your pc! But ou would
be execused as a martyr...
Happy new year to whom is reading this tomorrow






Reply With Quote
  #5  
Old   
marco
 
Posts: n/a

Default Re: alternating row colors - 01-03-2007 , 04:01 AM



Robert Molyneux wrote:
Quote:
Marco, try this code in a field in a table frame - note that the container
(ie the record) is the object to be coloured.

;==============
method newValue(var eventInfo Event)
var

myRec longint

endvar

myRec = self.recno

self.container.color = iif(myRec.mod(2) = 0, cl3DLight, Transparent)

endMethod
;==============
yeah, that's perfect!
thank you
mrco


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.