Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ DtEditor(3) — Digital UNIX 3.2c

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

Composite(3X)

Constraint(3X)

Core(3X)

DtCreateEditor(3)

DtEditorAppend(3)

DtEditorAppendFromFile(3)

DtEditorChange(3)

DtEditorCheckForUnsavedChanges(3)

DtEditorClearSelection(3)

DtEditorCopyToClipboard(3)

DtEditorCutToClipboard(3)

DtEditorDeleteSelection(3)

DtEditorDeselect(3)

DtEditorFind(3)

DtEditorFormat(3)

DtEditorGetContents(3)

DtEditorGetInsertionPosition(3)

DtEditorGetLastPosition(3)

DtEditorGetMessageTextFieldID(3)

DtEditorGetSizeHints(3)

DtEditorGotoLine(3)

DtEditorInsert(3)

DtEditorInsertFromFile(3)

DtEditorInvokeFindChangeDialog(3)

DtEditorInvokeFormatDialog(3)

DtEditorInvokeSpellDialog(3)

DtEditorPasteFromClipboard(3)

DtEditorReplace(3)

DtEditorReplaceFromFile(3)

DtEditorReset(3)

DtEditorSaveContentsToFile(3)

DtEditorSelectAll(3)

DtEditorSetContents(3)

DtEditorSetContentsFromFile(3)

DtEditorSetInsertionPosition(3)

DtEditorTraverseToEditor(3)

DtEditorUndoEdit(3)

XmFontList(3X)

XmForm(3X)

XmManager(3X)

XmTextField(3X)

DtEditor(3)  —  Subroutines

NAME

DtEditor − the DtEditor widget class

SYNOPSIS

#include <Dt/Editor.h>

DESCRIPTION

The DtEditor widget supports creating and editing text files.  It gives applications running in the desktop environment a consistent method for editing text data.  The widget consists of:

• A scrolled edit window for text

• Optional status line dialogs for finding and changing text

• Spell checking option

• Formatting options

• Convenience functions for programmatically controlling the widget

The DtEditor widget supports the following set of basic editing operations:

• Finding and changing text

• Simple formatting

• Spell checking

• Undoing the previous edit operation

All operations, except for spell checking, support locales with single- and multiple-byte characters. 

The DtEditor widget also supports input and output of ASCII text, multi-byte text and buffers of data.  Data can be passed between the application and the DtEditor widget, or a file and the widget. 

The DtEditor widget provides separate callback lists to track when text is selected or deselected.  In addition, it extends the standard help callback to report help requests from any of its components. 

Widget subclassing is not supported for the DtEditor widget class. 

Edit Window

The edit window supports basic editing operations such as cut and paste, find and change, simple formatting and spell checking. 

Mouse and Keyboard

Users can use the mouse for moving the edit cursor and for selecting portions of a document for editing operations.  Selection is based on the model specified in the Inter-Client Communication Conventions Manual (ICCCM). 
???? dear gentle C.O.: What does the following sentence mean ????
The DtEditor widget supports primary and secondary selection.

The user can cut, copy and paste text using the clipboard, primary transfer or secondary transfer.  The DtEditor widget accepts drops of text or text files.  It supports dragging of text within the DtEditor widget or to a different widget. 

The user interface tailors a new set of translations.  The default translations provide key bindings for moving the insertion cursor, and deleting, inserting and selecting text.  The insertion cursor, displayed as an I-beam, shows where input is inserted.  Input is inserted just before the insertion cursor. 

Status Line

The status line, which can be shown or hidden, displays the current line number, total line count and whether the DtEditor widget is in overstrike mode.  The current line number display shows the line number of the line containing the insertion cursor.  Users can go directly to any line in the document by entering the number into the current line number display.  The status line also provides a text field for displaying application-supplied messages.  For information on localizing the status line, see the Localization Resources section. 

Dialogs

The DtEditor widget includes three dialogs to provide a graphical user interface to its functionality:

• Find/Change dialog

• Spell dialog

• Format Settings dialog

The titles of all dialogs are controlled with the DtNdialogTitle resource.  All dialogs are posted using corresponding convenience functions and remain posted until dismissed by the user.  Each dialog includes Close and Help buttons in addition to buttons described in following lists.  For information on localizing these dialogs, see the Localization Resources section. 

The Find/Change dialog for the DtEditor widget enables users to search for, and optionally replace, a string in the edit window.  The dialog includes fields for specifying the find string and replacement string.  Buttons initiate the find, or change either the next occurrance or all occurrences of the find string to the replacement string.  When the user selects the Find button, the next occurrence of the specified string (regular expressions are not supported) is highlighted in the DtEditor widget, if found; otherwise, the DtEditor widget displays a message dialog stating the string was not found.  The Change To button changes the highlighted text to the replacement string, while the Change All button substitutes the replacement string for all occurrences of the find string. 

The functions, DtEditorFind(3) and DtEditorChange(3), provide a programmatic interface to the find and change functionality of the DtEditor widget. 

The Spell dialog is used to check the contents of the edit window for spelling errors.  It consists of a list of misspelled words, find string and replacement string fields, and the same set of buttons as the Find dialog.  Choosing a word from the list automatically selects it as the find string.  The list of misspelled words is automatically generated using the filter specified by DtNspellFilter when the dialog is displayed.  The actions for find, change to, and change all are the same as the Find dialog. 

The Format Settings dialog for the DtEditor widget enables users to format the contents of the edit window, format just the paragraph containing the insertion cursor, or specify the arguments used when formatting text.  The arguments include settings for the margins and how the text should be aligned.  The user has the choice of aligning the text flush with the left or right margin, centering each line of text between the margins, or aligning it flush with both margins.  Users enter the left and right margin values into text fields and choose an alignment option from a set of toggle buttons.  Two push buttons allow them to format the current paragraph or format the complete document. 

The margin values used for formatting do not have to be the same as the width of the edit window.  It is possible to format the text with margin values that are narrower or wider than the displayed edit window.  By default, values for the format margins are the edit window’s current size.  If text is formatted wider than the edit window and the DtNwordWrap resource is True, text wraps at the right edge of the edit window (see the description for DtNwordWrap), regardless of the right margin setting.  To format text wider than the edit window, DtNwordWrap should be False.  By default, values for the format margins are the edit window’s current size. 

The function, DtEditorFormat(3), provides a programmatic interface to the format functionality of the DtEditor widget. 

Classes

The DtEditor widget inherits behavior and resources from Core, Composite, Constraint, XmManager and XmForm classes. 

The class pointer is dtEditorWidgetClass. 

The class name is DtEditorWidget. 

New Resources

The following table defines a set of widget resources the application uses to specify data.  The application can also set the resource values for the inherited classes to set attributes for this widget.  To reference a resource by name or by class in a .Xdefaults file, remove the DtN or DtC prefix and use the remaining letters.  To specify one of the defined values for a resource in a .Xdefaults file, remove the Dt prefix and use the remaining letters (either lower case or upper case, but include any underscores between words).  The codes in the access column indicate if the given resource can be set at creation time (C), set by using XtSetValues (S), retrieved by using XtGetValues (G), or is not applicable (N/A). 

DtEditor Resource Set

Name Class Type Default Access




DtNautoShowCursorPosition DtCAutoShowCursorPosition Boolean True CSG




DtNblinkRate DtCBlinkRate int 500 CSG




DtNcolumns DtCColumns XmNcolumns dynamic CSG




DtNcusorPosition DtCCusorPosition XmTextPosition 0 CSG




DtNcusorPositionVisible DtCCusorPositionVisible Boolean True CSG




DtNdialogTitle DtCDialogTitle XmString NULL CSG




DtNeditable DtCEditable Boolean True CSG




DtNfontList DtCFontList XmFontList dynamic CSG




DtNmaxLength DtCMaxLength int largest integer CSG




DtNoverstrike DtCOverstrike Boolean False CSG




DtNrows DtCRows XmNrows dynamic CSG




DtNscrollHorizontal DtCScroll Boolean True CG




DtNscrollLeftSide DtCScrollSide Boolean dynamic CG




DtNscrollTopSide DtCScrollSide Boolean False CG




DtNscrollVertical DtCScroll Boolean True CG




DtNshowStatusLine DtCShowStatusLine Boolean False CSG




DtNspellFilter DtCspellFilter char ∗ spell CSG




DtNtextBackground DtCBackground Pixel dynamic CSG




DtNtextDeselectCallback DtCCallback XtCallbackList NULL C




DtNtextForeground DtCForeground Pixel dynamic CSG




DtNtextSelectCallback DtCCallback XtCallbackList NULL C




DtNtopCharacter DtCTextPosition XmTextPosition 0 CSG




DtNwordWrap DtCWordWrap Boolean True CSG




DtNautoShowCursorPosition
Ensures that the text visible in the scrolled edit window contains the insert cursor when set to True.  If the insert cursor changes, the contents of the DtEditor widget may scroll in order to bring the insertion point into the window. 

DtNblinkRate
Specifies the blink rate of the text cursor in milliseconds. The time indicated in the blink rate relates to the time the cursor is visible and the time the cursor is invisible (that is, the time it takes to blink the insertion cursor on and off is twice the blink rate). The cursor does not blink when the blink rate is set to 0 (zero). The value must not be negative.

DtNcolumns
Specifies the initial width of the area of the DtEditor widget as an integer number of characters. The width equals the number of characters specified by this resource multiplied by the maximum character width of the associated font. For proportionate fonts, the actual number of characters that fit on a given line may be greater than the value specified. The value must be greater than 0 (zero). The default value depends on the value of the DtNwidth resource. 

DtNcursorPosition
Indicates the position in the DtEditor widget where the current insert cursor is located. This position is determined by the number of characters from the beginning of the text. The first character position is 0 (zero).

DtNcursorPositionVisible
Indicates that the insert cursor position is marked by a blinking text cursor when the Boolean value is True. 

DtNdialogTitle
Specifies an XmString that appears as part of the titles for the dialogs displayed by the DtEditor widget. If this resource is non- NULL, it is prepended to the titles for the Find/Change, Spell and Format Settings dialogs. 

DtNeditable
Indicates that the user can edit the text when set to True.  Prohibits the user from editing the text when set to False. 

DtNfontList
Specifies the font list to be used for the DtEditor widget. If this value is NULL at initialization, the font list is initialized by looking up the parent hierarchy of the widget for an ancestor that is a subclass of the XmBulletinBoard(3X) or VendorShell widget class.  If such an ancestor is found, the font list is initialized to the DtNtextFontList of the ancestor widget.  If no such ancestor is found, the default is implementation dependent. 

  The DtEditor widget searches the font list for the first occurrence of a font set that has a XmFONTLIST_DEFAULT_TAG. If a default element is not found, the first font set in the font list is used. If the list contains no font sets, the first font in the font list is used. Refer to XmFontList(3X) for more information on a font list structure. 

DtNmaxLength
Specifies the maximum length of the text string that can be entered into the DtEditor widget from the keyboard. This value must be non-negative. Strings entered using the DtEditorSetContents(3) or DtEditorSetContentsFromFile(3) functions ignore this resource. 

DtNoverstrike
When set to False, characters typed into the DtEditor widget are inserted at the position of the insertion cursor.  This is the default behavior.  If set to True, characters entered into the DtEditor widget replace the characters that directly follow the insertion cursor.  When the end of the line is reached, characters are appended to the end of the line.  If the status line is visible, the DtNoverstrikeIndicatorLabel appears in the status line whenever DtNoverstrike is True. 

DtNrows
Specifies the initial height of the edit area of the DtEditor widget measured in character heights. The value must be greater than 0 (zero).

DtNscrollHorizontal
Adds a ScrollBar that allows the user to scroll horizontally through text when the Boolean value is True. 

DtNscrollLeftSide
Indicates that the vertical ScrollBar should be placed on the left side of the scrolled edit window when the Boolean value is True.  This attribute is ignored if DtNscrollVertical is False.  The default value may depend on the value of the XmNstringDirection resource. 

DtNscrollTopSide
Indicates that the horizontal ScrollBar should be placed on the top side of the scrolled edit window when the Boolean value is True. 

DtNscrollVertical
Adds a ScrollBar that allows the user to scroll vertically through text when the Boolean value is True. 

DtNshowStatusLine
If set to True, the DtEditor widget displays a status line below the text window.  The status line contains a field that displays the current line number of the insert cursor, total number of lines in the document, and whether the DtEditor widget is in overstrike mode.  Users can enter a line number in the line number display to go directly to that line. 

  The status line also includes a Motif Text Field widget ( XmTextField(3X)) for displaying application supplied messages.  This field is a convenient way for an application to display status and feedback about the document being edited.  The ID of the Text Field is retrieved using DtEditorGetMessageTextFieldID(3).  A message is displayed by setting the XmNvalue or XmNvalueWcs resource of this widget.  If the Text Field is not needed, it can be unmanaged by calling XtUnmanageWidget(3X) with its ID. 

DtNspellFilter
Specifies the filter used to identify spelling errors. The DtEditorInvokeSpellDialog(3) function filters the contents of a DtEditor widget through the filter specified by DtNspellFilter.  The filter specified should accept a file name and produce a list of misspelled and unrecognized words in this file on standard out.  The default filter is spell(1). 

DtNtextBackground
Specifies the background for the edit window.

DtNtextDeselectCallback
Specifies a function called whenever the selection becomes NULL (that is, no text is selected within the edit area).  The reason sent by the callback is DtEDITOR_TEXT_DESELECT. 

DtNtextForeground
Specifies the foreground for the edit window.

DtNtextSelectCallback
Specifies a function called whenever the selection becomes non- NULL (that is, some text is selected within the edit area).  The reason sent by the callback is DtEDITOR_TEXT_SELECT. 

DtNtopCharacter
Displays the line that contains the position of text at the top of the scrolled edit window. The line is displayed at the top of the DtEditor widget without shifting the text left or right. The position is determined by the number of characters from the beginning of the text. The first character position is 0 (zero).

  XtGetValues(3X) for DtNtopCharacter returns the position of the first character in the line that is displayed at the top of the DtEditor widget. 

DtNwordWrap
Indicates that text should not go off the right edge of the window, rather lines are broken at word breaks with soft carriage returns when they reach the right edge of the window.

  Word wrap affects only the visual appearance of the contents of a DtEditor widget.  The line breaks (soft carriage returns) are not physically inserted into the text.  The DtEditor widget supports substituting hard carriage returns when the contents of the widget are retrieved or saved to a file (see DtEditorGetContents(3) and DtEditorSaveContentsToFile(3)). 

Localization Resources

The following table defines a set of widget resources designed for localization of the DtEditor widget and its dialogs.  Default values for these resources depends on the locale. 

DtEditor Localization Resource Set

Name Class Type Default Access




DtNcenterToggleLabel DtCCenterToggleLabel XmString Dynamic CSG




DtNchangeAllButtonLabel DtCChangeAllButtonLabel XmString Dynamic CSG




DtNchangeButtonLabel DtCChangeButtonLabel XmString Dynamic CSG




DtNchangeFieldLabel DtCChangeFieldLabel XmString Dynamic CSG




DtNcurrentLineLabel DtCCurrentLineLabel XmString Dynamic CSG




DtNfindButtonLabel DtCFindButtonLabel XmString Dynamic CSG




DtNfindChangeDialogTitle DtCFindChangeDialogTitle XmString Dynamic CSG




DtNfindFieldLabel DtCFindFieldLabel XmString Dynamic CSG




DtNformatAllButtonLabel DtCFormatAllButtonLabel XmString Dynamic CSG




DtNformatParagraphButton- DtCFormatParagraphButton- XmString Dynamic CSG




Label Label







DtNformatSettingsDialogTitle DtCFormatSettingsDialogTitle XmString Dynamic CSG




DtNinformationDialogTitle DtCInformationDialogTitle XmString Dynamic CSG




DtNjustifyToggleLabel DtCJustifyToggleLabel XmString Dynamic CSG




DtNleftAlignToggleLabel DtCLeftAlignToggleLabel XmString Dynamic CSG




DtNleftMarginFieldLabel DtCLeftMarginFieldLabel XmString Dynamic CSG




DtNmisspelledListLabel DtCMisspelledListLabel XmString Dynamic CSG



DtNoverstrikeLabel DtCOverstrikeLabel XmString Dynamic CSG




DtNrightAlignToggleLabel DtCRightAlignToggleLabel XmString Dynamic CSG




DtNrightMarginFieldLabel DtCRightMarginFieldLabel XmString Dynamic CSG




DtNspellDialogTitle DtCSpellDialogTitle XmString Dynamic CSG




DtNtotalLineCountLabel DtCTotalLineCountLabel XmString Dynamic CSG




DtNcenterToggleLabel
Specifies the label for the center alignment toggle button in the Format Settings dialog. The default value in the C locale is Center. 

DtNchangeAllButtonLabel
Specifies the label for the button in the Find/Change dialog that changes all occurrences of the Find string in the document. The default value in the C locale is Change All. 

DtNchangeButtonLabel
Specifies the label for the button in the Find/Change dialog that changes the next occurrence of the Find string in the document. The default value in the C locale is Change. 

DtNchangeFieldLabel
Specifies the label for the field in the Find/Change dialog where the user specifies the replacement string. The default value in the C locale is Change To:. 

DtNcurrentLineLabel
Specifies the label for the current line number field in the status line. The default value in the C locale is Line:. 

DtNfindButtonLabel
Specifies the label for the button in the Find/Change dialog that finds the next occurrence of the Find string in the document. The default value in the C locale is Find. 

DtNfindChangeDialogTitle
Specifies the title for the Find/Change dialog. If DtNdialogTitle is non- NULL, it is prepended to this resource to form the title.  The default value in the C locale is Find/Change. 

DtNfindFieldLabel
Specifies the label for the field in the Find/Change dialog where the user specifies the search string. The default value in the C locale is Find:. 

DtNformatAllButtonLabel
Specifies the label for the button in the Format Settings dialog that formats the complete document. The default value in the C locale is All. 

DtNformatParagraphButtonLabel
Specifies the label for the button in the Format Settings dialog that formats the paragraph containing the insertion cursor. The default value in the C locale is Paragraph. 

DtNformatSettingsDialogTitle
Specifies the title for the Format Settings dialog. If DtNdialogTitle is non- NULL, it is prepended to this resource to form the title.  The default value in the C locale is Format Settings. 

DtNinformationDialogTitle
Specifies the title for the Information dialog used to present feedback and general information to the user. If DtNdialogTitle is non- NULL, it is prepended to this resource to form the title.  The default value in the C locale is Information. 

DtNjustifyToggleLabel
Specifies the label for the justify alignment toggle button in the Format Settings dialog. The default value in the C locale is Justify. 

DtNleftAlignToggleLabel
Specifies the label for the left alignment toggle button in the Format Settings dialog. The default value in the C locale is Left Align. 

DtNleftMarginFieldLabel
Specifies the label for the left margin value field in the Format Settings dialog. The default value in the C locale is Left Margin:. 

DtNmisspelledListLabel
Specifies the label for the list of unrecognized and misspelled words in the Spell dialog. The default value in the C locale is Misspelled Words:. 

DtNoverstrikeLabel
Specifies the label in the status line that indicates that the DtEditor widget is in overstrike mode. The default value in the C locale is Overstrike. 

DtNrightAlignToggleLabel
Specifies the label for the right alignment toggle button in the Format Settings dialog. The default value in the C locale is Right Align. 

DtNrightMarginFieldLabel
Specifies the label for the right margin value field in the Format Settings dialog. The default value in the C locale is Right Margin:. 

DtNspellDialogTitle
Specifies the title for the Format Settings dialog. If DtNdialogTitle is non- NULL, it is prepended to this resource to form the title.  The default value in the C locale is Spell. 

DtNtotalLineCountLabel
Specifies the label for the display showing the total number of lines in the document. The total number of lines displayed is part of the status line. The default value in the C locale is Total:. 

Inherited Resources

The DtEditor widget inherits behavior and resources from the superclasses named in the following tables.  For a complete description of each resource, refer to the man page for that superclass. 

XmForm Resource Set

Name Class Type Default Access




XmNfractionBase XmCMaxValue int 100 CSG




XmNhorizontalSpacing XmCSpacing Dimension 0 CSG




XmNrubberPositioning XmCRubberPositioning Boolean False CSG




XmNverticalSpacing XmCSpacing Dimension 0 CSG




XmManager Resource Set

Name Class Type Default Access




XmNbottomShadowColor XmCBottomShadowColor Pixel dynamic CSG




XmNbottomShadow- XmCBottomShadow- Pixmap XmUNSPECIFIED- CSG




Pixmap Pixmap _PIXMAP





XmNforeground XmCForeground Pixel dynamic CSG




XmNhelpCallback XmCCallback XtCallbackList NULL C




XmNhighlightColor XmCHighlightColor Pixel dynamic CSG




XmNhighlightPixmap XmCHighlightPixmap Pixmap dynamic CSG




XmNinitialFocus XmCInitialFocus Widget NULL CSG




XmNnavigationType XmCNavigationType XmNavigation- dynamic CSG




Type






XmNshadowThickness XmCShadowThickness Dimension dynamic CSG




XmNstringDirection XmCStringDirection XmString- dynamic CG




Dynamic






XmNtopShadowColor XmCTopShadowColor Pixel dynamic CSG




XmNtopShadowPixmap XmCTopShadowPixmap Pixmap dynamic CSG




XmNtraversalOn XmCTraversalOn Boolean dynamic CSG




XmNunitType XmCUnitType unsigned char dynamic CSG




XmNuserData XmCUserData XtPointer NULL CSG




Composite Resource Set

Name Class Type Default Access




XmNchildren XmCReadOnly WidgetList NULL G




XmNinsertPosition XmCInsertPosition XtOrderProc default procedure CSG




XmNnumChildren XmCReadOnly Cardinal 0 G




Core Resource Set

Name Class Type Default Access




XmNaccelerators XmCAccelerators XtAcceler- dynamic CSG




ators






XmNancestorSensitive XmCSensitive Boolean dynamic G




XmNbackground XmCBackground Pixel dynamic CSG




XmNbackgroundPixmap XmCPixmap Pixmap XmUNSPECIFIED- CSG




_PIXMAP





XmNborderColor XmCBorderColor Pixel XtDefaultForeground CSG




XmNborderPixmap XmCPixmap Pixmap XmUNSPECIFIED- CSG




_PIXMAP





XmNborderWidth XmCBorderWidth Dimension 0 CSG




XmNcolormap XmCColormap Colormap dynamic CG




XmNdepth XmCDepth int dynamic CG




XmNdestroyCallback XmCCallback XtCallback- NULL C




List






XmNheight XmCHeight Dimension dynamic CSG




XmNinitialResources- XmCInitialResources- Boolean True C




Persistent Persistent







XmNmappedWhenManaged XmCMappedWhenManaged Boolean True CSG




XmNscreen XmCScreen Screen ∗ dynamic CG




XmNsensitive XmCSensitive Boolean True CSG




XmNtranslations XmCTranslations XtTrans- dynamic CSG




lations






XmNwidth XmCWidth Dimension dynamic CSG




XmNx XmCPosition Position 0 CSG




XmNy XmCPosition Position 0 CSG




Callback Information

The DtEditor widget has three callback functions of interest:

XmNHelpCallback
An application that wishes to present help information to the user on the DtEditor widget and its dialogs should set XmNhelpCallback resource and use the reason field passed as part of DtEditorHelpCallbackStruct to set the contents of its Help dialog.  A pointer to the following structure is passed to XmNHelpCallback callback. 

typedef struct(int reason;
XEvent ∗event);
DtEditorHelpCallbackStruct;

reason
Indicates why the callback was invoked. The following list shows the possible reasons.

event
A pointer to the event that caused this callback to be invoked. It can be NULL. 

Reasons and Source of Help Request

This list shows the possible reasons the callback was invoked. 

DtEDITOR_HELP_EDIT_WINDOW
Edit window

DtEDITOR_HELP_STATUS_LINE
Status line

DtEDITOR_HELP_STATUS_CURRENT_LINE
Current line number display in status line

DtEDITOR_HELP_STATUS_TOTAL_LINES
Total line number display in status line

DtEDITOR_HELP_STATUS_MESSAGE
Message field in status line

DtEDITOR_HELP_STATUS_OVERSTRIKE
Overstrike indicator in status line

DtEDITOR_HELP_FORMAT_DIALOG
Help button in Format dialog

DtEDITOR_HELP_FORMAT_LEFT_MARGIN
Left margin field in Format dialog

DtEDITOR_HELP_FORMAT_RIGHT_MARGIN
Right margin field in Format dialog

DtEDITOR_HELP_FORMAT_ALIGNMENT
Alignment buttons in Format dialog

DtEDITOR_HELP_CHANGE_DIALOG
Help button in Find/Change dialog

DtEDITOR_HELP_CHANGE_FIND
Find field in Find/Change dialog

DtEDITOR_HELP_CHANGE_CHANGE
Change to field in Find/Change dialog

DtEDITOR_HELP_SPELL_DIALOG
Help button in Spell dialog

DtEDITOR_HELP_SPELL_MISSPELLED_WORDS
List of misspelled words in Spell dialog

DtEDITOR_HELP_SPELL_FIND
Find field in Spell dialog

DtEDITOR_HELP_SPELL_CHANGE
Change to field in Spell dialog

DtNtextSelectCallback and DtNtextDeselectCallback
An application that wishes to enable and disable certain commands or menu items based on whether there is a selection, should use the DtNtextSelectCallback and DtNtextDeselectCallback resources.  DtNtextSelectCallback specifies a function called whenever the selection becomes non- NULL (that is, some text is selected within the edit area) while DtNtextDeselectCallback specifies a function called whenever the selection becomes NULL (that is, no text is selected within the edit area).  The reasons sent by the callbacks are DtEDITOR_TEXT_SELECT and DtEDITOR_TEXT_DESELECT . 

Translations

The DtEditor widget translations are described in the following list. 

KLeft: backward-character()

MShift key-select(left)

MCtrl backward-word()

MShift backward-word(extend)

KRight: forward-character()

MShift key-select(right)

MCtrl forward-word()

MShift forward-word(extend)

KUp: process-up()

MShift process-shift-up()

MCtrl backward-paragraph()

MShift backward-paragraph(extend)

KDown: process-down()

MShift process-shift-down()

MCtrl forward-paragraph()

MShift MCtrl KDown:
forward-paragraph(extend)

KBeginLine: beginning-of-line()

MShift KBeginLine:
beginning-of-line(extend)

KEndLine: end-of-line()

MShift KEndLine:
end-of-line(extend)

KPageUp: previous-page()

MShift KPageUp:
previous-page(extend)

KPageDown: next-page()

MShift KPageDown:
next-page(extend)

KBeginData: beginning-of-file()

MShift KBeginData:
beginning-of-file(extend)

KEndData: end-of-file()

MShift KEndData:
end-of-file(extend)

KDelete: delete-next-character()

MCtrl KDelete:
clear-selection()

KBackSpace: delete-previous-character()

MCtrl KBackSpace:
delete-previous-word()

MShift KBackSpace:
delete-to-start-of-line()

MAlt KBackSpace:
undo-edit()

MCtrl Kz: undo-edit()

MCtrl K/:
select-all()

MCtrl Kg:
go-to-line()

MCtrl Kq:
quote-next-character()

MCtrl Kx: cut-clipboard()

MCtrl Kc: copy-clipboard()

MCtrl Kv: paste-clipboard()

KHelp: Help()

MShift KInsert toggle-overstrike()

KEnter new-line-and-input()

MAnyKCancel process-cancel

Action Routines

The DtEditor widget action routines are described here:

backward-character():
Moves the insertion cursor one character to the left. This action may have different behavior in a right-to-left language environment.

backward-paragraph(extend):
If this action is called with no argument, it moves the insertion cursor to the first non-whitespace character following the first previous blank line or beginning of the text. If the insertion cursor is already at the beginning of a paragraph, the action moves the insertion cursor to the beginning of the previous paragraph.

  If this action is called with an argument of extend, it moves the insertion cursor as in the case of no argument and extends the current selection.

backward-word(extend):
If this action is called with no argument, it moves the insertion cursor to the first non-whitespace character after the first whitespace character to the left or after the beginning of the line. If the insertion cursor is already at the beginning of a word, this action moves the insertion cursor to the beginning of the previous word. This action may have different behavior in a locale other than the C locale.

  If this action is called with an argument of extend, it moves the insertion cursor as in the case of no argument and extends the current selection.

beginning-of-file(extend):
If this action is called with no argument, moves the insertion cursor to the beginning of the text.

  If this action is called with an argument of extend, it moves the insertion cursor as in the case of no argument and extends the current selection.

beginning-of-line(extend):
If this action is called with no argument, it moves the insertion cursor to the beginning of the line.

  If this action is called with an argument of extend, it moves the insertion cursor as in the case of no argument and extends the current selection.

clear-selection():
Clears the current selection by replacing each character except <Return> with a <space> character. 

copy-clipboard():
Copies the current selection to the clipboard.

cut-clipboard():
Cuts the current selection to the clipboard.

delete-next-character():
If there is a non- NULL selection, this action deletes the selection; otherwise, it deletes the character following the insertion cursor. 

delete-previous-character():
If there is a non- NULL selection, this action deletes the selection; otherwise, it deletes the character of text immediately preceding the insertion cursor. 

delete-previous-word():
If there is a non- NULL selection, this action deletes the selection; otherwise, it deletes the characters preceding the insertion cursor to the next space, tab or beginning of the line character.  This action may have different behavior in a locale other than the C locale. 

delete-to-end-of-line():
If there is a non- NULL selection, this action deletes the selection; otherwise, it deletes the characters following the insertion cursor to the next end of line character. 

delete-to-start-of-line():
If there is a non- NULL selection, this action deletes the selection; otherwise, it deletes the characters preceding the insertion cursor to the previous beginning of line character. 

deselect-all():
Deselects the current selection.

end-of-file(extend):
If this action is called with no argument, it moves the insertion cursor to the end of the text.

  If this action is called with an argument of extend, it moves the insertion cursor as in the case of no argument and extends the current selection.

end-of-line(extend):
If this action is called with no argument, it moves the insertion cursor to the end of the line.

  If this action is called with an argument of extend, it moves the insertion cursor as in the case of no argument and extends the current selection.

forward-character():
Moves the insertion cursor one character to the right. This action may have different behavior in a right-to-left language environment.

forward-paragraph(extend):
If this action is called with no argument, it moves the insertion cursor to the first non-whitespace character following the next blank line. If the insertion cursor is already at the beginning of a paragraph, this action moves the insertion cursor to the beginning of the next paragraph.

  If this action is called with an argument of extend, it moves the insertion cursor as in the case of no argument and extends the current selection.

forward-word(extend):
If this action is called with no argument, it moves the insertion cursor to the first whitespace character or end of line following the next non-whitespace character. If the insertion cursor is already at the end of a word, this action moves the insertion cursor to the end of the next word. This action may have different behavior in a locale other than the C locale.

  If called with an argument of extend, this action moves the insertion cursor as in the case of no argument and extends the current selection.

go-to-line():
Moves the keyboard focus to the Current Line text field to allow the user to move the insertion cursor to a new line. This action is only valid if DtNshowStatusLine has a value of True.  For a description of the status line, see the Editor Status Line section. 

Help():
Calls the callbacks for XmNhelpCallback if any exist.  If there are no help callbacks for this widget, this action calls the help callbacks for the nearest ancestor that has them. 

insert-string(string):
If there is a non- NULL selection and the cursor is not disjoint from it, deletes the entire selection.  Inserts string before the insertion cursor. 

key-select(direction):
If this action is called with an argument of right it moves the insertion cursor one character to the right and extends the current selection.  If this action is called with an argument of left, it moves the insertion cursor one character to the left and extends the current selection. If this action is called with no argument, it extends the current selection.

newline-and-backup():
If there is a non- NULL selection and the cursor is not disjoint from it, this action deletes the entire selection.  Inserts a newline just before the insertion cursor and repositions the insertion cursor to the end of the line before the newline. 

newline-and-indent():
If there is a non- NULL selection and the cursor is not disjoint from it, this action deletes the entire selection.  Inserts a newline and then the same number of whitespace characters as at the beginning of the previous line. 

next-page(extend):
If this action is called with no argument, it moves the insertion cursor forward one page.

  If this action is called with an argument of extend, it moves the insertion cursor, as in the case of no argument, and extends the current selection.

paste-clipboard():
Pastes the contents of the clipboard before the insertion cursor.

previous-page(extend):
If this action is called with no argument, it moves the insertion cursor back one page.

  If this actins is called with an argument of extend, it moves the insertion cursor, as in the case of no argument, and extends the current selection.

process-cancel():
Cancels the current extend-adjust(), secondary-adjust() or process-bdrag() operation and leaves the selection state as it was before the operation; otherwise, (and if the parent is a manager) it passes the event to the parent. 

process-down():
Moves the insertion cursor down one line.

process-shift-down():
Moves the insertion cursor down one line.

process-shift-up():
Moves the insertion cursor up one line.

process-up():
Moves the insertion cursor up one line.

select-all():
Selects all text.

toggle-overstrike():
Toggles the state of the text insertion mode. By default, characters typed into the DtEditor widget are inserted at the position of the insertion cursor. In overstrike mode, characters entered into the DtEditor widget replace the characters that directly follow the insertion cursor. In overstrike mode, when the end of a line is reached, characters are appended to the end of the line.

quote-next-character():
Treats the next typed character as a special character and inserts it into the text without interpreting it. Enables the insertion of special instructional characters or special language characters, such as the character marking a form feed or the umlaut used in German text.

undo-edit():
Undoes the last change (deletion or insertion) made to the text. A change consists of either a set of consecutive insertions, or a set of consecutive deletions followed by up to one set of consecutive insertions. An insertion is consecutive if there have been no intervening deletions, and it is continuing forward from the same point. A deletion is consecutive if there have been no intervening insertions, and its start or end position is coincidental with the last deletion (that is, the deletion is continuing from the same point, either forward or backward). Undoing an edit once restores the original text. Undoing an edit twice restores the last change.

Convenience Functions

The Widget Library contains a number of functions that apply to the DtEditor widget.  The following lists summarize these functions. 

DtEditor Life Cycle Functions

DtCreateEditor
Creates a new instance of a DtEditor widget.

DtEditorReset
Restores a DtEditor widget to its initial state.

DtEditor Input/Output Functions

DtEditorAppend
Appends content data to the end of a DtEditor widget.

DtEditorAppendFromFile
Appends the contents of a file to the end of a DtEditor widget.

DtEditorGetContents
Retrieves the entire contents of a DtEditor widget.

DtEditorInsert
Inserts content data at the current insert position.

DtEditorInsertFromFile
Inserts the contents of a file at the current insert position.

DtEditorReplace
Replaces a portion of text with the supplied data.

DtEditorReplaceFromFile
Replaces a portion of text with the contents of a file.
Saves the entire contents to a file.

DtEditorSetContents
Loads content data into a DtEditor widget, replacing the entire contents of the widget.

DtEditorSetContentsFromFile
Loads the contents of a file into a DtEditor widget, replacing the entire contents of the widget.

DtEditor Selection Functions

DtEditorClearSelection
Replaces the currently selected contents with blanks.

DtEditorCopyToClipboard
Copies the currently selected contents to the clipboard.

DtEditorCutToClipboard
Removes the currently selected contents, placing it on the clipboard.

DtEditorDeleteSelection
Removes the currently selected contents.

DtEditorDeselect
Unselects any selected contents.

DtEditorPasteFromClipboard
Pastes the contents of the clipboard into a DtEditor widget, replacing any currently selected contents.

DtEditorSelectAll
Selects the entire contents of a DtEditor widget.

DtEditor Format Functions

DtEditorFormat
Formats the contents of all or part of a DtEditor widget.

DtEditorInvokeFormatDialog
Displays the format dialog that enables the user to specify format settings for margins and justification style and to perform formatting operations.

DtEditor Find and Change Text Functions

DtEditorChange
Changes one or all occurrences of a string.

DtEditorFind
Finds the next occurrences of a string.

DtEditorInvokeFindChangeDialog
Displays the dialog that enables the user to search for, and optionally change, a string.

DtEditorInvokeSpellDialog
Displays a dialog with a list of misspelled words in the current contents.

DtEditor Auxiliary Functions

DtEditorCheckForUnsavedChanged
Reports whether the contents of a DtEditor widget have been altered since they were last retrieved or saved.

DtEditorGetInsertionPosition
Returns the insertion cursor position of the DtEditor widget.

DtEditorGetLastPosition
Returns the position of the last character in the edit window.

DtEditorGetMessageTextFieldID
Retrieves the widget ID of the Text Field widget used to display application messages.

DtEditorGetSizeHints
Retrieves sizing information from a DtEditor widget.

DtEditorGoToLine
Moves the insert cursor to the specified line.

DtEditorSetInsertionPosition
Set the position of the insertion cursor.

DtEditorTraverseToEditor
Sets keyboard traversal to the editing area of a DtEditor widget.

DtEditorUndoEdit
Undoes the last edit made by a user.

SEE ALSO

Composite(3X), Constraint(3X), Core(3X), DtCreateEditor(3), DtEditorAppend(3), DtEditorAppendFromFile(3), DtEditorChange(3), DtEditorCheckForUnsavedChanges(3), DtEditorClearSelection(3), DtEditorCopyToClipboard(3), DtEditorCutToClipboard(3), DtEditorDeleteSelection(3), DtEditorDeselect(3), DtEditorFind(3), DtEditorFormat(3), DtEditorGetContents(3), DtEditorGetInsertionPosition(3), DtEditorGetLastPosition(3), DtEditorGetMessageTextFieldID(3), DtEditorGetSizeHints(3), DtEditorGotoLine(3), DtEditorInsert(3), DtEditorInsertFromFile(3), DtEditorInvokeFindChangeDialog(3), DtEditorInvokeFormatDialog(3), DtEditorInvokeSpellDialog(3), DtEditorPasteFromClipboard(3), DtEditorReplace(3), DtEditorReplaceFromFile(3), DtEditorReset(3), DtEditorSaveContentsToFile(3), DtEditorSelectAll(3), DtEditorSetContents(3), DtEditorSetContentsFromFile(3), DtEditorSetInsertionPosition(3), DtEditorTraverseToEditor(3), DtEditorUndoEdit(3), XmFontList(3X), XmForm(3X), XmManager(3X) XmTextField(3X). 
 
 
 
 
 
 

  —  20 July 1994

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026