QText

The QText application demonstrates the usage of TCoeFont, TBidiText, CCoeTextDrawerBase, and XCoeTextDrawer.
In UIQ 3, a control can no longer keep a pointer or reference to a CFont object as the zoom factor of the control may change, for instance if the screen mode changes. Instead the new TCoeFont class must be used to represent a font's logical or absolute size and style. A CCoeFontProvider can be used to return a reference to a CFont when required given a TCoeFont description.
Also use of CGraphicsContext, CWindowGc, and CBitmapGc classes DrawText() methods is now strongly discouraged. The correct approach is to use the new XCoeTextDrawer to draw text kept in TBidiText objects.
The QText application contains a single view which displays a text string loaded from resource at the top of the screen. This string is intended to wrap over several lines. A second string loaded from resource in is displayed in the centre of the screen. Both text strings are wrapped within TBidiText objects and are drawn using an XCoeTextDrawer object.
The size of the text is configurable and is mapped to the current zoom level. A zoom dialog is provided to change the zoom level.
The text style is configurable and can be displayed as plain, bold or italic. Text color is also configurable and a dialog is provided to select from a 16 color palette.
Class summary
CBidiTextApplication is the entry point to the application.
CBidiTextDocument represents the document in the application.
CBidiTextAppUi is responsible for creating the view.
CBidiTextView presents two text strings drawn by a XCoeTextDrawer. The style and color of the text can be configured.
CColourSelectDialog presents a simple dialog with a 16-color palette. Selection of a color changes the color of the text in CBidiTextView.
Usage
First, run bldmake from the projects group directory where the bld.inf file is located:
This creates a batch file, called abld.bat, which you use in the next step. To build the project, you call abld build which will build the project for all default targets in both release and debug variants. To build for a particular target and variant, use abld build target-name variant, for example,
builds the project for the debug variant of WINSCW only. To run it, choose the application name from the Launcher.
UI configuration
This example supports the reference UI Configurations that are supported in the UIQ 3 SDK. For development purposes, UiqEnv allows to change the UI Configuration in the emulator in order to develop and test the application with varying phone styles.
Changes in this version
Version 1.1 2006-12-28
Minor documentation changes.
Version 1.0 2006-12-07
First release.
Download:
QText
You need to be a registered member of the UIQ Developer Community and logged in to be able to download this file.