HDML allows you to display formatted text in display cards and display content areas of entry and choice cards. It provides a variety of statements to specify how text is wrapped and scrolled, and how it is placed on the phone display.
The <, >, ", $, and & characters are reserved. To display one of these characters in formatted text, specify one of the following escape sequences.
The UP.SDK provides a Perl utility function named HDMLEscapeString(), which converts the HDML reserved characters in a string to valid escape sequences. For more information, see the UP.SDK Tools and APIs Reference manual.
You can use the following HDML statements to start new lines of formatted text.
In <LINE> mode, the phone ignores white space such as multiple spaces, carriage returns, and newlines; these characters do not start new lines. In <WRAP> mode, the phone uses whitespace to conduct word wrapping.
<WRAP> is the default line wrapping mode for formatted text in display, entry, and choice cards. Formatted text in these cards uses the <WRAP> mode until a line starting with a <LINE> statement is encountered. <LINE> is the default wrapping mode for the text in individual choice entry elements.
If a card contains more lines of text than the phone can display, the phone displays as many lines as will fit on the display. Some phones may display visual cues to indicate to the user that there is additional text in the current card. The user can scroll down and see the remaining lines by pressing the down arrow key. After scrolling down, the user can scroll back to the first lines by pressing the up arrow key.
To create aligned columns of text, insert <TAB> statements in the text. The phone automatically sets tab stops for you. It treats contiguous lines containing tabs as rows in a table, setting the number of columns to the number of tabs in the line with the most tabs. It sets the width of each column to accommodate the column's largest cell.
The HDML compiler converts multiple contiguous spaces, returns, and newlines into a single space. To display multiple contiguous spaces, insert nonbreaking spaces with the element. Each element has the width of a regular space. Note that if you want to allow wrapping in the middle of a series of contiguous nonbreaking spaces, you must insert a regular space where you want to allow wrapping. If you don't want the phone to wrap a line on a particular space, replace the space with a element.
By default, formatted text is left aligned. To change the alignment, you can use the following statements at the beginning of a line.
A <RIGHT> or <CENTER> statement applies to the entire line.
The following HDML deck generates the display shown in Figure 1-12:
3.0>FIGURE 1-12. Display card with formatted text containing tabs
The phone display in this example uses a vertical bar (|) as visual cue to indicate there is additional text to which the user can scroll.