Item Formatting

REMINDER
  • InfoQube supports Rich-text formatting for grids, items and the HTML editing pane.
  • Editing in the HTML pane is similar to word-processors. See 4. Document Pane.
  • In grids, formatting is structured as a hierarchy. In increasing order of precedence, these are:
    1. Overall default font: set in Tools>Options>General>View: Grid font and Grid font size settings
    2. Grid specific font: set in Grid>Properties>Options: Default Font
    3. Item format: Applies to the whole item or to specific columns. See Item Formatting.
    4. Outline style. See 3. Outline Styles
    5. Embedded format: See Embedded Formatting
    6. Conditional format. See Conditional Formatting
 

This page describes Item formatting, which has priority over grid specific font and overall default font.
Keep in mind that ouline styles, In-cell formatting and conditional formatting have priority over item formatting. 

Item formatting consists of :
  1. Font (face, size, bold, etc)
  2. Text color
  3. Back color.
These display attributes are saved in 3 fields defined in Tools > Options > This file > General. By default the fields are respectively:
  1. ItemFont
  2. ItemForeColor
  3. ItemColor
To perform item formatting, first ensure that you are not editing. If currently editing, format will be applied to selected text (see in-cell formatting Embedded Formatting)
 
You can use the formatting toolbar buttons :   
 
It contains the following icons:
  • Font dialog
  • Shortcuts for bold, italic, underline, strikethrough
  • Highlight text (bright yellow back color)
  • Grow font, shrink font
  • Item Text color
  • Item Back color
  • Item Hyperlink
 
or edit the fields directly (in a grid or the properties pane)
 
By default it is applied to the entire row but you can choose to just have certain columns get the item formatting using Grid > Properties > Options > "Item Font applies to field
 

1. Setting an Item's Backcolor (row highlighting)

You can highlight an item with any color via it's right-click menu in the grid (Item Color).
 
 
First we see a list of  named colors, then more colors & then an option to custom choose/create (even) more colors.
Named colors are defined in Tools > Options > This file > General > Named colors
 

2. Using the Item Forecolor and Backcolor Fields

Setting an Item's color using the context menu actually just sets its ItemBackColor field. You can change that field and its color will update automatically next time you close/open the grid. You can also change its fore color using the field ItemForeColor. Both of these values are set using either VB Hex Color Codes or Named Colors (see below). You can also change an Item's font by using its ItemFont field.
 
And since they are normal fields, you can update them using equations as well (see Field Management Dialog - Equations).
 

3. Changing the Item forecolor and backcolor fields

It is possible to have multiple item fore/backcolors defined for an item (e.g. one for printing, one for screen). By default colors are defined in ItemForeColor and ItemBackColor fields. But you can change this at the database level (perhaps just while you print). To do so:
  1. Create a new text field: AlternateItemColor
  2. In Tools>>Options>>This Database>>General>>Item backcolor field: replace the default item color field (ItemColor) with the field AlternateItemColor
  3. Press F5 to refresh the grid. You can also open a new instance of the grid (right-click on the tab or shift+click on the grid name)
In the this example, the User Manual item as ItemColor=Yellow and AlternateItemColor=Red. Using Tools>>Options, one can toggle between the two colors.
 
 
 

4. Color Codes and Names

4.1 Color Codes

InfoQube uses VB hex numbers (e.g. the Red above is &HAAAAFF ) for its color codes. These are in BGR format while the rest of the web uses RGB. To add a new color you have to find it's VB hex number, one good tool for this is Bullseye Color Picker. You can use other sites and tools also, but be sure to swap the B and R if required.
 

4.2 Named Colors

Anywhere you can use a VB Hex Code you can also use a name if IQ knows it. These are called Named Colors. You can change or add new Named Colors in the database options at  Tools > Options | This file > General > Named Colors  (see 3.10.20.70 This file>General).

 As you can see there is a list of colors there
Red|&HAAAAFF|Orange|&H99CCFF|Yellow|&HAAFFFF|Blue|&HFFFFAA|   etc.
 
  • First comes the color name which shows via item context menu (and can be used in equations / auto-assign rules).
  • Then a separator '|'
  • The comes the code for the color
  • Then another separator before the name of the next color
 
It's important to remember that you need to restart to see any Named Color changes and that Named Colors only apply to the current file only.
 
For instructions on adding the standard list of X11 colors see Web Named Colors.