Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: ComboBox Colours  (Read 8853 times)
SSL D.
Posts: 11


« on: April 08, 2010, 04:14:00 pm »

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.


* BG Color.jpg (17.41 KB, 174x368 - viewed 1777 times.)

* Font Color.jpg (9.17 KB, 116x293 - viewed 1771 times.)
Reuben B.
Four Js
Posts: 1116


« Reply #1 on: April 12, 2010, 12:10:13 am »

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.
Four Js
Posts: 545


« Reply #2 on: April 22, 2010, 06:17:40 pm »

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
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines