Common methods apply to most windows, controls and resources.
Creates a new Textfield object;
can also be called as PARENT->
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
-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.
$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.
Text data availlable in clibboard for a Paste.
Determine whether an Textfield can be undone
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.
Reset the undo flag of an Textfield.
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.
Return the uppermost visible line.
Return current text limit, in characters.
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.
Return the number of lines in a multiline Textfield.
Return an array with right and left margins.
Determine whether the content of a Textfield has been modified.
Return the password character displayed .
Return formatting rectangle is the limiting rectangle of the text.
Returns a 2 item list giving the index of the start and end of the current selection
Return the position of the scroll box (thumb) in a multiline Textfield.
Check if a selection is availlable.
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)
Selects the specified range of characters.
Common events apply to most windows and controls.
Sent when the text in the field is changed by the user.
Sent when the control is activated.
Sent when the control is deactivated.
Sent when text has exceeded the specified number of characters
Sent when one of the window scrollbars is moved. SCROLLBAR identifies which bar was moved, 0 for horizontal and 1 for vertical.
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.
For further support join the users mailing list(
email@example.com) 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.