Document revision date: 10 November 2000
[Compaq] [Go to the documentation home page] [How to order documentation] [Help on this site] [How to contact us]
[OpenVMS documentation]

DECwindows Extensions to Motif


Previous Contents Index


DXmCSTextGetString

Retrieves all the text from the compound string text widget.

Format


XmString DXmCSTextGetString(widget) 
          Widget  widget; 


Return Value

A pointer to a compound string holding all the current text in the compound string text widget.

Arguments

widget

The identifier (widget ID) of the compound string text widget.

Description

The DXmCSTextGetString routine retrieves the current compound string from the compound string text widget. The application is responsible for freeing the storage associated with the compound string by calling the Intrinsic routine XtStringFree. See the DXmCreateCSText, DXmCSTextSetString, and DXmCSTextReplace routines for related information. See also the X Window System Toolkit manual for more information about using the Intrinsic routines.

DXmCSTextGetTopPosition

Retrieves (returns) the logical position of the first character in the displayed text.

Format


DXmCSTextPosition DXmCSTextGetTopPosition(widget) 
                   Widget  widget 


Return Value

An integer that represents the logical position of the first character in the text buffer.

Arguments

widget

The identifier (widget ID) of the compound string text widget.

Description

The DXmCSTextGetTopPosition routine returns the logical position of the first character in the displayed text. If the direction is left to right, the first character is at the top left of the display. If the direction is right to left the first character is at the top right of the display.

DXmCSTextHasSelection

Indicates whether the compound string text widget currently owns the primary selection.

Format


Boolean DXmCSTextHasSelection(widget) 
         Widget  widget 


Return Value

A Boolean value that, when True, indicates that the widget currently owns the primary selection.

Arguments

widget

The identifier (widget ID) of the compound string text widget.

Description

The DXmCSTextHasSelection routine returns True if the compound string text widget currently owns the primary selection and False if it does not.

DXmCSTextHorizontalScroll

Scrolls text horizontally.

Format


void DXmCSTextHorizontalScroll(widget, n) 
      Widget  widget 
      int     n 


Arguments

widget

The identifier (widget ID) of the compound string text widget.

n

An integer that represents the number of pixels to scroll to the left or right. A positive value means scroll right; a negative value means scroll left.

Description

The DXmCSTextHorizontalScroll routine scrolls text horizontally (left or right) by the given number of pixels.

DXmCSTextInsert

Inserts new text into the compound string text widget.

Format


DXmCSTextStatus DXmCSTextInsert(widget, pos, value) 
                 Widget             widget 
                 DXmCSTextPosition  pos; 
                 XmString           value; 


Return Value

A value that represents the status (success or failure) of the insertion operation, as follows:
Value Description
DXmCSTextStatusEditDone Text was inserted successfully.
DXmCSTextStatusEditError Text was not inserted (failure).

Arguments

widget

The identifier (widget ID) of the compound string text widget.

pos

The logical position at which to insert the new text.

value

The compound string representation of the text.

Description

The DXmCSTextInsert routine inserts new text into the compound string text widget at the specified logical position, returning the success or failure of that operation.

DXmCSTextNumLines

Retrieves (returns) the number of visible lines in the compound string text widget.

Format


int DXmCSTextNumLines(widget) 
     Widget  widget 


Return Value

An integer that represents the number of visible lines.

Arguments

widget

The identifier (widget ID) of the compound string text widget.

Description

The DXmCSTextNumLines routine returns an integer that represents the number of lines in the compound string text widget that are visible to the user.

DXmCSTextPaste

Pastes the data from the clipboard into the text at the current cursor position.

Format


Boolean DXmCSTextPaste(widget) 
         Widget  widget 


Return Value

A Boolean value that, when True, indicates that the data was pasted successfully from the clipboard into the text.

Arguments

widget

The identifier (widget ID) of the compound string text widget.

Description

The DXmCSTextPaste routine pastes the data from the clipboard into the text at the current cursor position, returning the success or failure of that operation. (See the OSF/Motif Programmer's Reference and the OSF/Motif Programmer's Guide for more information about the clipboard.) See the DXmCreateCSText, DXmCSTextCopy, DXmCSTextCut, and DXmCSTextRemove routines for related information.

DXmCSTextPosToXY

Retrieves (returns) the x and y position of a specified character in the text.

Format


Boolean DXmCSTextPosToXY(widget, position, x, y) 
         Widget             widget; 
         DXmCSTextPosition  position; 
         Position           *x; 
         Position           *y; 


Return Value

A Boolean function that, when True, returns the x and y position of the character in text. When False, no x and y position is returned.

Arguments

widget

The identifier (widget ID) of the compound string text widget.

position

Specifies the position in the text of the character for which the x- and y-coordinates will be returned.

x

A pointer to the x-coordinate relative to the upper left corner of the widget. (Valid only when the routine returns True.)

y

A pointer to the y-coordinate relative to the upper left corner of the widget. (Valid only when the routine returns True.)

Description

The DXmCSTextPosToXY routine converts the logical position of a specified character in the text to the corresponding x- and y-coordinates. See the DXmCSTextXYToPos routine for related information.

DXmCSTextRemove

Removes the currently selected (highlighted) text.

Format


Boolean DXmCSTextRemove(widget) 
         Widget  widget 


Return Value

A Boolean value that, when True, indicates that the text was removed successfully.

Arguments

widget

The identifier (widget ID) of the compound string text widget.

Description

The DXmCSTextRemove routine removes the currently selected (highlighted) text, returning the success or failure of that operation. See the DXmCreateCSText, DXmCSTextCopy, DXmCSTextCut, and DXmCSTextPaste routines for related information.

DXmCSTextReplace

Replaces a specified segment of text in a compound string text widget.

Format


DXmCSTextStatus DXmCSTextReplace(widget, from_pos, to_pos, value) 
                 Widget             widget; 
                 DXmCSTextPosition  from_pos; 
                 DXmCSTextPosition  to_pos; 
                 XmString           value; 


Return Value

A value that represents the status (success or failure) of the replace operation, as follows:
Value Description
DXmCSTextStatusEditDone Text replaced successfully.
DXmCSTextStatusEditError Text not replaced (failure).

Arguments

widget

The identifier (widget ID) of the compound string text widget.

from_pos

Represents the first character position of the text being replaced.

to_pos

Represents the last character position of the text being replaced.

value

Replacement text for part of the current text in the compound string text widget, or additional text to be inserted into the compound string text widget.

Description

The DXmCSTextReplace routine replaces part of the text in the compound string text widget. Within the widget, positions are numbered starting at 0 and increasing sequentially. For example, to replace the second and third characters in the text, from_pos should be 1 and to_pos should be 3. To insert text after the fourth character, from_pos and to_pos should both be 4. See the DXmCreateCSText, DXmCSTextSetString, and DXmCSTextGetString routines for related information.

DXmCSTextSetAddMode

Controls whether the CSText widget is in Add Mode.

Format


void DXmCSTextSetAddMode(widget,state) 
      Widget   widget; 
      Boolean  state; 


Arguments

widget

The identifier (widget ID) of the compound string text widget.

state

A Boolean function that, when True, turns on Add Mode and, when False, turns off Add Mode.

Description

The DXmCSTextSetAddMode routine controls whether the CSText widget is in Add Mode, which, when True, allows the user to move the insertion cursor without affecting the primary selection.

DXmCSTextSetEditable

Specifies whether the text in the widget can be edited by the user.

Format


void DXmCSTextSetEditable(widget, editable) 
      Widget   widget; 
      Boolean  editable;  


Arguments

widget

The identifier (widget ID) of the compound string text widget.

editable

A Boolean value that, when True, indicates that the user can edit the text in the compound string text widget. When False, the user cannot edit the text.

Description

The DXmCSTextSetEditable specifies whether text in the compound string text widget can be edited by the user, returning either True or False to indicate the permission state. See the DXmCreateCSText and DXmCSTextGetEditable routines for related information.

DXmCSTextSetHighlight

Changes the highlighting of the compound string text located between two specified logical positions.

Format


void DXmCSTextSetHighlight(widget, left, right, mode) 
      Widget             widget; 
      DXmCSTextPosition  left;  
      DXmCSTextPosition  right; 
      XmHighlightMode    mode; 


Arguments

widget

The identifier (widget ID) of the compound string text widget.

left

The left boundary of the text to be highlighted.

right

The right boundary of the text to be highlighted.

mode

One of the following types of highlighting:
Value Description
XmHIGHLIGHT_NORMAL Removes highlighting
XmHIGHLIGHT_SELECTED Uses reverse video
XmHIGHLIGHT_SECONDARY_SELECTED Uses underlining

Description

The DXmCSTextSetHighlight routine changes the highlighting of the compound string text located between two specified positions, by removing the highlighting or by implementing underlining or reverse video. This visual change in the display does not affect (set) the selections.

DXmCSTextSetInsertionPosition

Sets the insertion cursor to the specified logical position in the text.

Format


void DXmCSTextSetInsertionPosition(widget, position) 
      Widget             widget; 
      DXmCSTextPosition  position; 


Arguments

widget

The identifier (widget ID) of the compound string text widget.

position

The position of the insertion cursor.

Description

The DXmCSTextSetInsertionPosition routine sets the insertion cursor to the specified logical position (indicated by number of characters) in the text. See the DXmCSTextGetInsertionPosition for related information.

DXmCSTextSetMaxLength

Sets the maximum allowable length of the text in the compound string text widget.

Format


void DXmCSTextSetMaxLength(widget, max_length) 
      Widget  widget; 
      int     max_length; 


Arguments

widget

The identifier (widget ID) of the compound string text widget.

max_length

An integer that represents the maximum length, in characters, of the text in the compound string text widget. This argument sets the XmNmaxLength resource used by the DXmCreateCSText routine.

Description

The DXmCSTextSetMaxLength routine sets the maximum allowable length of the text in the compound string text widget. It prohibits the user from entering text longer than this limit. See the related routines DXmCreateCSText and DXmCSTextGetMaxLength.

DXmCSTextSetSelection

Designates the specified text as the current primary selection by highlighting it in the compound string text widget.

Format


void DXmCSTextSetSelection(widget, first, last, time) 
      Widget              widget; 
      DXmCSTextPosition   first; 
      DXmCSTextPosition   last; 
      Time                time; 


Arguments

widget

The identifier (widget ID) of the compound string text widget.

first

Represents the position of the first character in text being selected.

last

Represents the position of the last character in the text being selected.

time

Specifies the time of the event that generated the call to the DXmCSTextSetSelection routine.

Description

The DXmCSTextSetSelection routine designates the specified text as the current primary selection by highlighting it in the compound string text widget. Within the text window, first marks the position of the first character in the text and last marks the last character. The field characters start at 0 and increase sequentially.

See the DXmCreateCSText, DXmCSTextGetSelection, and DXmCSTextClearSelection routines for related information.


DXmCSTextSetString

Replaces all the text in the compound string text widget with new text.

Format


void DXmCSTextSetString(widget, value) 
      Widget    widget; 
      XmString  value; 


Arguments

widget

The identifier (widget ID) of the compound string text widget.

value

The text that replaces all text in the current compound string text widget.

Description

The DXmCSTextSetString routine replaces all the text in the compound string text widget with new text specified by the value argument. See the DXmCreateCSText and DXmCSTextGetString routines for related information.

DXmCSTextSetTopPosition

Sets the logical position of the first character in the displayed text.

Format


void DXmCSTextSetTopPosition(widget, top_position) 
      Widget             widget; 
      DXmCSTextPosition  top_position; 


Arguments

widget

The identifier (widget ID) of the compound string text widget.

top_position

The logical position of the first character in the text.

Description

The DXmCSTextSetTopPosition routine sets the logical position of the first character in the displayed text. If the direction is left to right, the first character is at the top left of the display. If the direction is right to left the first character is at the top right of the display.

DXmCSTextShowPosition

Displays text located at a specified position.

Format


void DXmCSTextShowPosition(widget, position) 
      Widget             widget; 
      DXmCSTextPosition  position; 


Arguments

widget

The identifier (widget ID) of the compound string text widget.

position

The logical position of a character in the text that is to be displayed.

Description

The DXmCSTextShowPosition displays the text located at a specified position, which is the logical position of a character in that text.

DXmCSTextVerticalScroll

Scrolls text vertically.

Format


void DXmCSTextVerticalScroll(widget, n) 
      Widget  widget; 
      int     n; 


Arguments

widget

The identifier (widget ID) of the compound string text widget.

n

An integer that represents the number of lines to scroll up or down. A positive value means scroll up; a negative value means scroll down.

Description

The DXmCSTextVerticalScroll routine scrolls text vertically by the given number of lines. See the DXmCSTextHorizontalScroll routine for related information.


Previous Next Contents Index

  [Go to the documentation home page] [How to order documentation] [Help on this site] [How to contact us]  
  privacy and legal statement  
5635PRO_009.HTML