PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US

X
Y
  • Definition
  • Special case: RTF control
  • Limit: Modifying the position of the input cursor
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures

Definition

The mouse cursor is used to easily view the location where the action will be performed. For a control in edit, the cursor turns into a blinking vertical line, allowing you to easily identify the location of the next character typed.

If a selection is performed in the control, the selected characters are displayed in "reverse video". The position of the cursor corresponds to the beginning of the area displayed in "reverse video".
Some examples:
Image with input cursor located at the beginning of the area
The input cursor is located at the beginning of the input area. Its position is 1.
Image with input cursor located at the end of the area
The input cursor is located at the end of the input area. Its position is 7 in this example.
Image with input cursor located at the beginning of the area in reverse video
The input cursor is located at the beginning of the area in "reverse video" (position 3 in this example). ..CursorEnd is used to find out and modify the end of the selected area.
Versions 19 and later
Universal Windows 10 App This property is now available in Windows Store Apps mode.
New in version 19
Universal Windows 10 App This property is now available in Windows Store Apps mode.
Universal Windows 10 App This property is now available in Windows Store Apps mode.
Versions 20 and later
Android This property is now available for the table columns in the Android applications.
New in version 20
Android This property is now available for the table columns in the Android applications.
Android This property is now available for the table columns in the Android applications.
Versions 21 and later
Universal Windows 10 App This property is now available in Universal Windows 10 App mode.
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 21
Universal Windows 10 App This property is now available in Universal Windows 10 App mode.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Universal Windows 10 App This property is now available in Universal Windows 10 App mode.
iPhone/iPad This function is now available for the iPhone/iPad applications.
..Cursor is used to find out and modify the position of the mouse cursor in one fo the following controls:
  • Edit control.
  • Editable combo box.
  • "Edit control" table column and "Editable combo box" table column.
  • Versions 22 and later
    WINDEV Word Processing control.
    New in version 22
    WINDEV Word Processing control.
    WINDEV Word Processing control.
Note: To find out the text selected in an edit control, an editable combo box or a table column, you have the ability to use ..SelectedText.
Versions 15 and later
Android This property is now available for the Android applications on the edit controls.
New in version 15
Android This property is now available for the Android applications on the edit controls.
Android This property is now available for the Android applications on the edit controls.
Versions 20 and later
Android This property is now available for the Android applications on the table columns.
New in version 20
Android This property is now available for the Android applications on the table columns.
Android This property is now available for the Android applications on the table columns.
Tip: To select a text section in an edit control from a button:
  1. The "Auto erase" option must not be checked in the edit control (except if the entire content of the control must be deleted).
  2. The button must be an "Interruption" button and it must contain the following code for example:
    // -- Click code of BTN_Selection button (Interrupt button)
    // Select the entire text
    EDT_Edit1..Cursor = 1
    EDT_Edit1..CursorEnd = Length(EDT_Edit1) + 1
    ScreenFirst(EDT_Edit1)
// Insert a character string at cursor position
EDT_ControlName = Left(EDT_ControlName, EDT_ControlName..Cursor) + ...
" is called " + Right(EDT_ControlName, EDT_ControlName..Cursor)
Syntax

Finding out the position of the input cursor Hide the details

<Current Value> = <Control Name>..Cursor
<Current Value>: Integer
Current position of the input cursor in the control. This position can vary between:
  • 0 (the control is not in edit and there is no input cursor).
  • The number of characters displayed in the control + 1 (the input cursor is located at the end of the input area).
<Control Name>: Character string (with or without quotes)
Name of the control in which the input cursor is displayed.

Modifying the position of the input cursor Hide the details

<Control Name>..Cursor = <New value>
<Control Name>: Character string (with or without quotes)
Name of the control where the position of the input cursor must be modified.
<New value>: Integer
New position of the input cursor, between 1 and the number of characters currently displayed in the control + 1.
Remarks
WINDEVWindowsUser code (UMC)

Special case: RTF control

The number of characters displayed in an RTF control can differ if this control contains CR characters (Carriage Return).
Indeed, the CR character corresponds to two characters in a non-RTF control while it corresponds to one character in an RTF control.

Limit: Modifying the position of the input cursor

The position of the input cursor can be modified only if the control is currently in edit. If the control is not currently in edit, ..Cursor returns 0.
Reminder: To force the input in a control, use ScreenFirst or ReturnToCapture.
Minimum required version
  • Version 9
This page is also available for…
Comments
Video Cursor
https://youtu.be/k_dH_1Gd4lI

https://windevdesenvolvimento.blogspot.com/2019/02/dicas-2009-windev-comandos-42-cursor.html
amarildo
Feb. 06 2019
Suggestion for next release
It could be interesting that the Cursor property also worked on browser
Josep Castany
Sep. 15 2015