Patches to the Xew 3.1 release

This document will list the upcoming changes to the latest released Xew version. Usually these changes are useful only for those who are "pushing the limits" of the widgets. The changes and patches here will be reasonably stable and will most likely be included into the next release. But, beware, this is not 100% guaranteed.

patch #1
patches the files TextEd.c, TextEd.h, TextImport.c and TextImport.h in Xew directory (the patch must be run in that directory).
  1. the text range modification,
  2. support for the new XeTextChangeMode function (most of the diffs are for this),
  3. and a patch to XeTextSetInsertionPosition
The patch is relative to the clean Xew 3.1 version. After this, I Xew will be 3.1PL1 and future patches, if any, will be based on this.
patch #2
patches the files Frame.c, TextEd.c, TextEd.h and TextImport.c.
  1. XeFrame layout loop problem,
  2. Keyboard focus problem with MOTIF,
  3. XeTextChangeModeAndTag.

Text range modification

When a text range (or a selection) is marked and new text is added, the range is extended only if the editing position is clearly inside the range. Inserting text at in front or after the range does not extend it (earlier, typing at the end of range extended the range with new characters).

XeTextChangeMode(Widget w, char *mode, long length, long amount)

The function will add and lock the specified modes (mode,length) into insert point, and then change the 'amount' number of characters to match the locked modes. Only those modes that are locked will be changed, not all modes that are currently set at insert point.

The function does not move insert point, unless the "mode" string contains graphic characters (the mode string is processed exactly as with XeTextInsert, but with the side effect that any mode changing controls will also modify the locked attributes and is merged into the set of locked attributes (which already will contain attributes defined from initialState resource or from current XeTextInsertPrefix).

This function can be used in different ways. A simple use would be

	XeTextChangeMode(w, "\033[31m", 5L, 20L);
which will change the foreground rendition to RED for the next 20 virtual positions counting from the current insert point forward.

XeTextChangeModeAndTag(Widget w, char *mode, long length, long amount, XeTextTag tag)

Works similar to XeTextChangeModeAndTag, but changes also the tag value on the specified range.

XeTextSetInsertionPosition

This function did not set the actual cursorPosition resource value properly, it only set the internal pointer.

XeFrame layout loop problem

In some special cases XeFrame layout generated zero width or height for the child and went into infinite loop. This fix will make the layout to ignore the constraints that would result zero or negative dimensions.

MOTIF keyboard focus

When the widgets have been compiled with USING_MOTIF_122, there are some problems with getting the keyboard focus into TextEd when the explicit policy in effect. The patch will add an XmProcessTraversal call into select start handling (button1 down, or BSelect in Motif).

In addition, for demo appications in demo directory, the following extra line in Demo.ad makes them work better with USING_MOTIF_122 Xew library:

	*traversalOn: False


msa