ComboBox Colours

Started by SSL D., April 08, 2010, 04:14:00 PM

Previous topic - Next topic

SSL D.

Is there a way of displaying the contents of a ComboBox using multiple colours? Something similar to setArrayAttributes. A different colour is required for each item within the listing.

We'd like to list the name of a colour and it be shown as that colour.

Note: Ideally we'd like the BackColour to be changed rather than the font colour.

Reuben B.

Hi Kevin,

I am not aware of a means to apply rich-text attributes to combobox entries.  I would probably consider using a DISPLAY ARRAY comprised of a column of Labels (or TextEdits) with textFormat="html".  So you'd populate the array similar to ...

   LET arr[1].colour = '<div style="background-color:#FF0000">red</div>'
   LET arr[2].colour = '<div style="background-color:#00FF00">green</div>'
   LET arr[3].colour = '<div style="background-color:#0000FF">blue</div>'

... that gives you flexibility for background and foreground colours as well as 65536 colours to choose from.

Reuben

PS I'd also ask Pierre-Nicolas nicely if the colour picker dialog as used in Genero Studio Report Designer is something that could be called in a ui.Interface.frontCall() similar to the openFile,saveFile dialogs etc.
Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero

Sebastien F.

Another option is to use a Table + DISPLAY ARRAY with DIALOG.setArrayAttributes() to color the cells.

https://4js.com/techdocs/genero/fgl/devel/DocRoot/User/ClassDialog.html#setArrayAttributes

Seb