How to color specific cell in LIST control during runtime?

As I have read some topic, it said there is no feature to color an entire row for the list so I am going color it per cell. I am trying to create a code that creates a greenbar effect in my listbox, I have already tried PROPLIST:Color, PROPLIST:BackColor, PROPSTYLE:BackColor. I thought I have to point the cell coordinates then set its color but I cannot find out how to do it.

Any help or tips would be very much appreciated. Thank you.

Found this somewhere:
File: ListCellToolTip&Style2.zip
Author: Ron Eisner
Email: [email protected]
Date: 010326
Version: 2.0
Clarion Version: C5b
Target: 32-bits
Distribution: Freeware
Description: Small example of LIST using STYLE and TOOLTIP.
Instructions: Open the project file (*.prj); compile and run!
Examine source as desired.

Comments:

A small handwritten example program demonstrating a LIST control with both styles and tooltips.

The program fills a queue with random garbage. A tooltip field is maintained for each cell.

The following features are demonstrated:

*{PROP:Format}: Set dynamically
*{PROP:Format}: Omit field from display.
*Styles:
{PROPSTYLE:FontStyle}
{PROPSTYLE:FontColor}
{PROPSTYLE:FontName}
{PROPSTYLE:FontSize}
{PROPSTYLE:BackColor}
*Cell Tooltips
*Column Tooltips
*Conditional Tooltips
*Adjustable Window TIMER
*Status bar
*SPIN: Wrap-around at range limits
*Hand-coded ACCEPT loop.
*LIST{PROP:Format}: Display bug in C5b and below.

[end]

ListCell.zip (3.6 KB)

1 Like

Thank you very much for this. This would be very helpful. :smiley:

Hi,

I think starting from C5.5 this greenbar feature for a browse is built-in.
In the browse go to Actions -> Browse Box Behaviour, choose the Styles Tab.

See the setting like i use them.
Only thing you need to do, go to Actions -> Listbox Styles
And add the two styles you’re going to use.
For example:
image

For style number 1, i used:
image

And for style number 2:
image

That’s all !
No handcoding needed.

4 Likes

Hi @rob_bac. :slightly_smiling_face: But what I am trying to do is to make a full hancoded routine so I can put it to my template. I’ll check the codes generated by this. Thank you for sharing :sunglasses:

I have a question here. :point_down:


I cannot see any code that defines those fields as a style field. I have tried to rename the fields then recompiled just to know if there is just a naming convention to detect if it is a style. But it still works, so no naming convention for fields. How it happen? Thanks.

The queue doesn’t differentiate between style fields. The listbox just expects the right stuff to be present when the style property exists within the listbox format. It doesn’t matter what the name is, as long as the LONG is in the right place within the queue.
In the template generated queues, you’ll see FieldName_Style.

In ABBROWSE.TPW, the style field is generated via:

#IF(%QueueFieldHasStyle)
#INSERT(%MakeField, %QueueField, ‘Style’, ‘LONG’, ‘Field style’)
#ENDIF

1 Like

For reference, look for this section in the help:

1 Like

Sirs @jslarve and @brahn. Thanks for the info. :sunglasses:

1 Like

Romuald maybe you’r looking for this:

https://comformark.com.au/news/post/a-clarion-template-to-change-browse-colors

1 Like

Hi @Dirk , I will check this. Thank you. :sunglasses: