The EditControl class provides methods to query and modify edit controls, which are also called entry lines in the ooDialog documentation. It inherits all methods of the DialogControl class (see page DialogControl Class).
Use the GetEditControl method (see page GetEditControl) to retrieve an object of the EditControl class.
The EditControl class requires the class definition file oodwin32.cls:
::requires "oodwin32.cls"
Instances of the EditControl class implement the methods listed in the following EditControl Instance Methods table.
Table 16-1. EditControl Instance Methods
Method... | ...on page |
---|---|
AddStyle | AddStyle |
EnsureCaretVisibility | EnsureCaretVisibility |
FirstVisibleLine | FirstVisibleLine |
GetLine | GetLine |
GetStyle | GetStyle |
GetText | GetText |
HideBalloon | HideBalloon |
IsModified | IsModified |
LineFromIndex | LineFromIndex |
LineIndex | LineIndex |
LineLength | LineLength |
LineScroll | LineScroll |
Lines | Lines |
Margins | Margins |
PasswordChar | PasswordChar |
PasswordChar= | PasswordChar= |
RemoveStyle | RemoveStyle |
ReplaceStyle | ReplaceStyle |
ReplaceSelText | ReplaceSelText |
ScrollCommand | ScrollCommand |
Select | Select |
Selected | Selected |
SetCue | SetCue |
SetLimit | SetLimit |
SetMargins | SetMargins |
SetModified | SetModified |
SetReadOnly | SetReadOnly |
SetText | SetText |
ShowBalloon | ShowBalloon |
>>-anEditControl~Selected--------------------------------------><
The Selected method retrieves the indexes of the starting and ending character of the text selected. If the starting index equals the ending index, no text is selected and the index specifies the current cursor position. If the ending index is 0 and the starting index is 1, the entire text is selected.
The one-based starting and ending index of the current selection, separated by a blank.
The following example displays the starting and ending index of the text selection of the edit control NAME. It then selects the entire text of the edit control.
edit = MyDialog~GetEditControl("NAME") if edit == .Nil then return parse value edit~Selected with start end say "Starting index of selection is" start say "Ending index of selection is" end edit~Select(1,0)