Browse cell font

jmac13

Member
Hi all,
I'm using open edge 10.2b

[FONT=&quot]I'm trying to change the font of browse cell on a certain condition[/FONT] i know i can do that via:


Code:
[FONT=&quot]assign grades.sht-name:font in browse {&browse-name} = 106[/FONT].

but this would mean a huge list for my temp table is there a way i can do this with handles? i only want the cells not the whole column as the next lind might not meet the condtion
 

RKR

Member
on row-display of browse {&browse-name}
do:
if <your condition> then assign grades.sht-name:font in browse {&browse-name} = 106.
end.
 

jmac13

Member
sorry i must not of explained it well.

I know about the above code. But that method would mean doing a line for each field which there are loads of. is there not a better way?

e.g:

Code:
on row-display of browse {&browse-name}
do:
if <your condition> then 
      loop:
      loop thru fields and sent font for that row to 106
     end.
 
 
end.
 

RKR

Member
def var hColumn as handle no-undo.
hColumn = browse {&browse-name}:first-column.
do while valid-handle(hColumn):
<set font>
hColumn = hColumn:next-column.
end.



sorry i must not of explained it well.

I know about the above code. But that method would mean doing a line for each field which there are loads of. is there not a better way?

e.g:

Code:
on row-display of browse {&browse-name}
do:
if <your condition> then 
loop:
loop thru fields and sent font for that row to 106
end.
 
 
end.
 

jmac13

Member
doesnt that just set the whole columns font though?.. I want certain lines to be a certain font
 

RKR

Member
My sample did not completely worked. The next method I have tested and it works very well in OE 10.2

You cannot access the method first-column and next-column from within a row-display trigger. But you can create a temp-table that contains all the handles of the columns in a browse before the query is opened and the browse is filled.

def temp-table ttCol
field ColHandle as handle.

def var hCol as handle.
hCol = browse {&browse-name}:first-column.
do while valid-handle(hCol):
create ttCol.
assign ttCol.ColHandle = hCol.
hCol = hCol:next-column.
end.

in the row-display you can then do a for each on the temp-table.

if <condition> then do:
for each ttCol.
ttCol.ColHandle:FONT = 106.
end.
end.

this sets only the font of the currently displayed row. all other rows remain untouched.

greetings,
Ruud
 
Top