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 char that is shown instead of the text with -password => 1.
-prompt => (see below)
-readonly => 0/1 (default 0)
text can't be changed.
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,
-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'').
[TBD]
[TBD]
[TBD]
[TBD]
[TBD]
[TBD]
[TBD]
[TBD]
Selects the specified range of characters.