User Tools

Site Tools


Sidebar

Privacy Policy

News

Version 2.50 is out since Jan 1st 2022


Frequently Asked Questions


Namespaces

Note for contributors

If you wish to create a new page in the DroidScript wiki, please click on the most appropriate namespace above and follow the notes for contributors there.

Because of spam, it has been necessary to add a CAPTCHA to the registration form and the save option for editing pages. You will not need to prove you are human if you are logged in, so please register.

Please feel free to improve any existing page, as well as adding new pages to increase the sum of public knowledge about DroidScript.

Formatting Syntax

built_in:textedit

This is an old revision of the document!


TextEdit control

Create

Create TextEdit objects using the CreateTextEdit method of the app object:

edt = app.CreateTextEdit( text, width, height, options );

You can use the SetOnChange or the SetOnTouch methods of the TextEdit to set the name of a function you want to be called when a the text is changed.

Use the SetText and GetText functions to set and get the text in the TextEdit

Methods

Some controls use the same methods.
For examples of the same methods look here.

Method Description
TextEdit.ClearHistory()
TextEdit.Destroy()
TextEdit.GetAbsHeight()
TextEdit.GetAbsWidth()
TextEdit.GetCursorLine() Returns the line with the Cursor as number
TextEdit.GetCursorPos() Returns the position of the Cursor as number
TextEdit.GetHtml() Returns the Text of a Textedit as Html
use this if the contol has a Html option
TextEdit.GetHeight()
TextEdit.GetLineCount() Returns the count of a line in the Textedit
TextEdit.GetLineStart( lineNum ) Returns the position of the start of a line as number
TextEdit.GetLineTop( lineNum )
TextEdit.GetMaxLines() Returns the count of all lines
TextEdit.GetPosition()
TextEdit.GetSelectedText() Returns the selected Text
TextEdit.GetSelectionEnd() Returns the endposition of the selected Text as number
TextEdit.GetSelectionStart() Returns the startposition of the selected text as number
TextEdit.GetText() Returns the Text of the Textedit
TextEdit.GetTextSize( mode ) Returns the Textsize of the Text
TextEdit.GetType()
TextEdit.GetVisibility()
TextEdit.GetWidth()
TextEdit.InsertText( text,start,end )
TextEdit.Redo()
TextEdit.Release()
TextEdit.ReplaceText( text,start,end )
TextEdit.SetBackColor( color )
TextEdit.SetBackGradient( color1,color2,color3,p4,p5,p6,p7 )
TextEdit.SetBackGradientRadial( x,y,r,color1,color2,color3,p7 )
TextEdit.SetBackground( imagefile,options )
TextEdit.SetCursorPos( number )
TextEdit.SetHint( text )
TextEdit.SetHtml( text )
TextEdit.SetMargins( left,top,right,bottom )
TextEdit.SetOnChange( callback ) Starts if the user change the Text in the Textedit
TextEdit.SetOnTouch( callback ) Starts if the user enter the Textedit
TextEdit.SetPadding( left,top,right,bottom )
TextEdit.SetPosition( left,top,width,height )
TextEdit.SetScale( x,y )
TextEdit.SetSelection( start,stop ) Select Text
start and stop are the positions in the text as number
TextEdit.SetSize( width,height )
TextEdit.SetText( text )
TextEdit.SetTextColor( color )
TextEdit.SetTextSize( size,mode )
TextEdit.SetVisibility( ShowHide )
TextEdit.Undo()

Options

Option Description
AutoSelectSelect all Text if user enter the Textedit
CenterJustify the text in the middle
LeftJustify the text to the left
MonospaceShows the Text in a Monospace Font
NoSpellDisable the spell-checker
NumberDefaults to the numeric keyboard
NoKeyboardShows no Keyboard
ReadOnlyYou cant change the Text
RightJustify the text to the right
SingleLineDoes'nt make a linebreak if
text is longer than the control
built_in/textedit.1424011019.txt.gz · Last modified: 2015/02/15 22:37 (external edit)