Rich Text Editing

Genero Desktop Client supports rich text editing with integrated toolbox or rich text local actions.

In previous versions, TextEdits are able to display rich text. In input, it was possible to edit rich text, but this was not straightforward. Moreover, cursor and cursor2 attributes correspond to plain text, not to the real value.

GDC 2.22 introduces rich text editing feature:

Figure: Rich text editing interface

The figure is a screen shot showing the Rich text editing feature.

GDC 2.22 provides:

  • text format: bold, italic, underline
  • paragraph alignment: left, center, right, justify
  • lists: bullet, decimal
  • paragraph indentation
  • font size
To enable richtext editing, you need to set textFormat styleAttribute to "html" .
<StyleAttribute name="textFormat" value="html" />

To modify your document, you can use:

Integrated richtext toolbox

By default, when the mouse reaches the top border of the TextEdit, a toolbox will appear. The toolbox will disappear when the mouse leaves the top border area.

This default behavior allows to keep the same height for your textedit as before - this is specially useful if you only use textedit to display rich text: the toolbox is only visible in input. If you want always display the toolbox, you can set the following styleAttribute:
<StyleAttribute name="textFormat" value="html" />
<StyleAttribute name="showEditToolBox" value="yes" />
Figure: Rich text editing interface with toolbox always displayed.

The figure is a screen shot showing the toolbox displayed with the Rich text editing feature.
Note:
  • The textedit will be wide enough to display the toolbox entirely, even if you define a small width in the .per. Please take this in account when designing your form.
  • The textedit will be high enough to display the number of lines defined in the .per (with the textedit font). This means that a textedit with a height of 1 will display toolbox and one line, which is much higher than without the toolbox.

Rich text local actions

Besides integrated toolbox, new local actions have been created for each rich text capability. As any local action, you can configure accelerator keys, and bind them to action views like ToolBar buttons.

Table 1. Local action names, accelerators, and icons
Name Default Accelerator Icon Name Icon
richtextbold control-b textbold
text bold icon
richtextitalic control-i textitalic
text italic icon
richunderline control-u textunder
text underline icon
richtextalignleft control-l textleft
text left align icon
richtextaligncenter control-e textcenter
text center icon
richtextalignright control-r textright
text right align icon
richtextalignjustify control-j textjustify
text justify icon
richtextlistbullet None textlistbullet
text bullet list icon
richtextlistdecimal None textlistnumbered
text number list icon
richtextdecreaseident None textindentdecrease
text indent decrease icon
richtextincreaseident None textindentincrease
text indent increase icon
richtextdecreasefontsize None textfontsizedown
text font size down icon
richtextincreasefontsize None textfontsizeup
text font size up icon
Then you can hide the toolbox using the following styleAttribute:
<StyleAttribute name="textFormat" value="html" />
<StyleAttribute name="showEditToolBox" value="no" />
Important:
  • We are not generating html code by ourselves. We are using a component dealing with rich text which provides a "toHTML" export. As we have nearly no way to influence the export, and are completely dependent on the component, future versions of GDC may behave differently if the component provider decides to change the export. Should this occur, we will add some entries in the Migration Guide.
  • cursor and cursor2 attributes are now following better html code, but they are still not 100% corresponding. For instance, if you load an html file with a hidden part, cursors will be wrongly set. We recommend using cursor and cursor2 with care when textFormat is set to html.