[TBD]
Common methods apply to most windows, controls and resources.
new(PARENT, %OPTIONS)
Creates a new Textfield object;
can also be called as PARENT->AddTextfield(%OPTIONS)
.
Class specific %OPTIONS are:
-align => left/center/right (default left) aligns the text in the control accordingly. -keepselection => 0/1 (default 0) the selection is not hidden when the control loses focus. -multiline => 0/1 (default 0) the control can have more than one line (note that newline is "\r\n", not "\n"!). -password => 0/1 (default 0) masks the user input (like password prompts). -passwordchar => CHAR (default '*') The specified CHAR that is shown instead of the text with -password => 1 -lowercase => 0/1 (default 0) Convert all caracter into lowercase -uppercase => 0/1 (default 0) Convert all caracter into uppercase -autohscroll => 0/1 (default 1 (0 for a multiline Textfield)) Automatically scroll to right as text is typed past the right margin; If 0 for a multiline Textfield, then wrap to the next line. -autovscroll => 0/1 (default 1) For a multiline Textfiled automatically scroll down as lines pass the bottom of the control. -number => 0/1 (default 0) Allows only digits to be entered into the edit control -prompt => (see below) -readonly => 0/1 (default 0) text can't be changed. -wantreturn => 0/1 (default 0) when dialogui => 1 is in effect, stops the <ENTER> key behaving as a click on the default button, and allows the key to be entered in a multi-line Textfield
The -prompt
option is very special; if a string is passed, a
Win32::GUI::Label object (with text set to the string passed) is created
to the left of the Textfield.
Example:
$Window->AddTextfield( -name => "Username", -left => 75, -top => 150, -width => 100, -height => 20, -prompt => "Your name:", );
Furthermore, the value to -prompt can be a reference to a list containing the string and an additional parameter, which sets the width for the Label (eg. [ STRING, WIDTH ] ). If WIDTH is negative, it is calculated relative to the Textfield left coordinate. Example:
-left => 75, (Label left) (Textfield left) -prompt => [ "Your name:", 30 ], 75 105 (75+30)
-left => 75, -prompt => [ "Your name:", -30 ], 45 (75-30) 75
Note that the Win32::GUI::Label object is named like the Textfield, with a "_Prompt" suffix (in the example above, the Label is named "Username_Prompt").
See also the common options.
Append(TEXT)
[TBD]
CanPaste()
Text data availlable in clibboard for a Paste.
CanUndo()
Determine whether an Textfield can be undone
CharFromPos(X, Y)
Returns a two elements array identifying the character nearest to the position specified by X and Y. The array contains the zero-based index of the character and its line index.
Clear()
[TBD]
Copy()
[TBD]
Cut()
[TBD]
EmptyUndoBuffer()
Reset the undo flag of an Textfield.
FmtLines(FLAG)
Set the inclusion flag of soft line break characters on or off within a multiline TextField. A soft line break consists of two carriage returns and a linefeed and is inserted at the end of a line that is broken because of word wrapping.
GetFirstVisibleLine()
Return the uppermost visible line.
GetLimitText()
Return current text limit, in characters.
GetLine(LINE)
Get a line of text.
LINE: zero based index to the line to be retrieved
Returns the text of the line. Returns undef if LINE is greater than the number of lines in the Textfied.
GetLineCount()
Return the number of lines in a multiline Textfield.
GetMargins()
Return an array with right and left margins.
GetModify()
Determine whether the content of a Textfield has been modified.
GetPasswordChar()
Return the password character displayed .
GetRect()
Return formatting rectangle is the limiting rectangle of the text.
GetSel()
Returns a 2 item list giving the index of the start and end of the current selection
GetThumb()
Return the position of the scroll box (thumb) in a multiline Textfield.
HaveSel()
Check if a selection is availlable.
LimitText([CHARS])
[TBD]
LineFromChar(INDEX)
[TBD]
LineIndex(INDEX)
[TBD]
LineLength(INDEX)
[TBD]
LineScroll(X,Y)
[TBD]
MaxLength([CHARS])
See LimitText()
Modified([FLAG])
[TBD]
Modify([FLAG])
See Modified()
PasswordChar([CHAR])
[TBD]
Paste()
[TBD]
PosFromChar(INDEX)
[TBD]
ReadOnly([FLAG])
[TBD]
ReplaceSel(STRING, [FLAG])
Replaces the current selection with the given STRING. The optional FLAG parameter can be set to zero to tell the control that the operation cannot be undone; see also Undo().
Scroll(COMMAND | LINE | HORIZONTAL, VERTICAL)
[TBD]
ScrollCaret()
[TBD]
Select(START,END)
See SetSel()
SelectAll()
[TBD]
Selection()
See GetSel()
SetLimitText(SIZE)
[TBD]
SetMargins([LEFT],[RIGHT])
[TBD]
SetModify(FLAG)
[TBD]
SetPasswordChar(CHAR)
[TBD]
SetReadOnly(FLAG)
[TBD]
SetRect(LEFT,TOP,RIGHT,BOTTOM,[REDRAW])
[TBD]
SetSel(START,END)
Selects the specified range of characters.
SetTabStops( ...)
[TBD]
Undo()
[TBD]
Common events apply to most windows and controls.
Change()
Sent when the text in the field is changed by the user.
GotFocus()
Sent when the control is activated.
LostFocus()
Sent when the control is deactivated.
MaxText()
Sent when text has exceeded the specified number of characters
Scroll(SCROLLBAR)
Sent when one of the window scrollbars is moved. SCROLLBAR identifies which bar was moved, 0 for horizontal and 1 for vertical.
Update()
Sent when an edit control is about to display altered text.
Documentation for Win32::GUI v1.06 created 13 Feb 2008
This document is autogenerated by the build process. Edits made here will be lost. Edit docs/per_package.tpl instead.
Homepage: http://perl-win32-gui.sourceforge.net/.
For further support join the users mailing list(perl-win32-gui-users@lists.sourceforge.net
) from the website
at http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users. There is a searchable list archive at http://sourceforge.net/mail/.
Copyright (c) 1997..2008 Aldo Calpini. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.