Xdialog Text Pointer

Description

Xdialog allows you to control the insertion point and selected text in a text control on an Xdialog box. Normally, when you place a text control on an Xdialog box, you bind the control to a character variable. For example:

text = "some text"
ui_dlg_box("title","[.20text]")

However, if you want to be able to control the Insertion Point and Selected text, then you must bind the control to a pointer variable that has a .text and a .object property, as shown in the example below. The .text property contains the text in the variable. The .object property gives you access to the properties and methods of this text object.

dim ptext as P
dim ptext.text as C
dim ptext.object as P
ptext.text = "some text"
ui_dlg_box("title","[.20ptext]");
ptext.object.delete()

The methods available to manipulate an Xdialog text control are:

  • .DELETE()

    Cuts the currently selected text.

  • .GET_CURSOR()

    Returns the position of the cursor.

  • .GET_SELECT()

    Returns the currently selected text

  • .INSERT_TEXT()

    Inserts the TextString at the position of the cursor.

  • .PASTE()

    Inserts the text contents of the Clip Board at the position of the cursor.

  • .REPLACE_TEXT()

    Inserts the TextString at the location of the currently selected text.

  • .SELECT()

    Highlights text in the text control.

  • .SET_CURSOR()

    Sets the location of the cursor and sets focus to the text control.

  • .SHOW_CARET()

    Displays the cursor, causing the text box to scroll if it is not currently visible.

See Also