Common Desktop Environment: Internationalization Programmer's Guide

Preedit Area

A preedit area is used to display the string being preedited. The input method supports four modes of preediting: OffTheSpot, OverTheSpot (default), Root, and None.


Note -

A string that has been committed cannot be reconverted. The status of the string is moved from the preedit area to the location where the user is entering characters.


OffTheSpot

In OffTheSpot mode preediting using an input method, the location of preediting is fixed at just below the MainWindow area and on the right side of the status area as shown in Figure 1-4. A Japanese input method is used for the example.

Figure 1-4 Example of OffTheSpot preediting with the VendorShell widget (Japanese)

Graphic

In the system environment, when preediting using an input method, the preedit string being preedited may be highlighted in some form depending on the input method.

To use OffTheSpot mode, set the XmNpreeditType() resource of the VendorShell() widget either with the XtSetValues() function or with a resource file. The XmNpreeditType() resource can also be set as the resource of a TopLevelShell(), ApplicationShell(), or DialogShell() widget, all of which are subclasses of the VendorShell() widget class.

OverTheSpot (Default)

In OverTheSpot mode, the location of the preedit area is set to where the user is trying to enter characters (for example, the insert cursor position of the Text widget that has the current focus). The characters in a preedit area are displayed at the cursor position as an overlay window, and they can be highlighted depending on the input method.

Although a preedit area may consist of multiple lines in OverTheSpot mode. The preedit area is always within the MainWindow area and cannot cross its edges in any direction.

Keep in mind that although the preEdit string under construction may be displayed as though it were part of the Text widget's text, it is not passed to the client and displayed in the underlying edit screen until preedit ends. See Figure 1-5 for an illustration.

To use OverTheSpot mode explicitly, set the XmNpreeditType() resource of the VendorShell() widget either with the XtSetValues() function or with a resource file. The XmNpreeditType() resource can be set as the resource of a TopLevelShell(), ApplicationShell(), or DialogShell() widget because these are subclasses of the VendorShell() widget class.

Figure 1-5 Example of OverTheSpot preediting with the VendorShell widget (Japanese)

Graphic

Root

In Root mode, the preedit and status areas are located separate from the client's window. The Root mode behavior is similar to OffTheSpot. See Figure 1-6 for an illustration.

Figure 1-6 Example of Root preediting with the VendorShell widget (Japanese)

Graphic