PML Customisation
User Guide
Gadget Set
: TextPane Gadgets
TextPane Gadgets
A
textpane gadget
provides a box on a form into which you may type and edit multiple lines of text or cut and paste text from elsewhere on the screen.
The contents of the textpane can be set and queried by your PML code. Optionally the text contents can be made non-editable.
You must specify the initial shape of the gadget. Optionally you may also supply a form position and a tag to be displayed to the top-left of the gadget.
textpane .text 'Text:' AT . . . width 10 height 20
textpane .text 'Text:' AT . . . height 20 aspect 0.5
The value of a textpane is its current contents as an array of strings, where each element of the array corresponds to a line of text in the gadget.
To make the textpane’s contents read-only, use the
seteditable
method:
!This.text.seteditable(FALSE)
To clear the current contents of a textpane gadget:
!This.text.clear()
To move the keyboard focus to this textpane gadget:
!This.text.setfocus()
To enquire how many lines of text a textpane gadget currently contains, use the count method:
!Nlines = !This.text.count
To set line 21 in a textpane gadget to
'Hello World
':
!This.text.setline( 21, 'Hello World' )
To read the current contents of line 21 as a string variable:
!Line = !This.text.line(21)
To set the entire contents of the textpane gadget to an array of strings:
!Lines[1] = 'Hello World'
!Lines[2] = ' '
!Lines[3] = 'Goodbye World'
!This.text.val = !Lines
To read the entire contents of the textpane gadget as an array of strings:
!LinesArray = !This.text.val
To set the current cursor position within a textpane gadget to line 21, character 15 you can use:
!This.text.setcurpos(21, 15)
or
!ArrayRowColumn[1] = 21
!ArrayRowColumn[2] = 15
!This.text.SetCurPos( !ArrayRowColumn )
To read current cursor position within a textpane gadget:
!ArrayRowColumn = !This.text.CurPos()
1974 to current year.
AVEVA Solutions Limited and its subsidiaries. All rights reserved.