Site Navigation

User Guide

Reference

Packages

 

DESCRIPTION

[TBD]

METHODS

Common methods apply to most windows, controls and resources.

new

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

Append(TEXT)

[TBD]

CanPaste

CanPaste()

Text data availlable in clibboard for a Paste.

CanUndo

CanUndo()

Determine whether an Textfield can be undone

CharFromPos

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

Clear()

[TBD]

Copy

Copy()

[TBD]

Cut

Cut()

[TBD]

EmptyUndoBuffer

EmptyUndoBuffer()

Reset the undo flag of an Textfield.

FmtLines

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

GetFirstVisibleLine()

Return the uppermost visible line.

GetLimitText

GetLimitText()

Return current text limit, in characters.

GetLine

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

GetLineCount()

Return the number of lines in a multiline Textfield.

GetMargins

GetMargins()

Return an array with right and left margins.

GetModify

GetModify()

Determine whether the content of a Textfield has been modified.

GetPasswordChar

GetPasswordChar()

Return the password character displayed .

GetRect

GetRect()

Return formatting rectangle is the limiting rectangle of the text.

GetSel

GetSel()

Returns a 2 item list giving the index of the start and end of the current selection

GetThumb

GetThumb()

Return the position of the scroll box (thumb) in a multiline Textfield.

HaveSel

HaveSel()

Check if a selection is availlable.

LimitText

LimitText([CHARS])

[TBD]

LineFromChar

LineFromChar(INDEX)

[TBD]

LineIndex

LineIndex(INDEX)

[TBD]

LineLength

LineLength(INDEX)

[TBD]

LineScroll

LineScroll(X,Y)

[TBD]

MaxLength

MaxLength([CHARS])

See LimitText()

Modified

Modified([FLAG])

[TBD]

Modify

Modify([FLAG])

See Modified()

PasswordChar

PasswordChar([CHAR])

[TBD]

Paste

Paste()

[TBD]

PosFromChar

PosFromChar(INDEX)

[TBD]

ReadOnly

ReadOnly([FLAG])

[TBD]

ReplaceSel

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

Scroll(COMMAND | LINE | HORIZONTAL, VERTICAL)

[TBD]

ScrollCaret

ScrollCaret()

[TBD]

Select

Select(START,END)

See SetSel()

SelectAll

SelectAll()

[TBD]

Selection

Selection()

See GetSel()

SetLimitText

SetLimitText(SIZE)

[TBD]

SetMargins

SetMargins([LEFT],[RIGHT])

[TBD]

SetModify

SetModify(FLAG)

[TBD]

SetPasswordChar

SetPasswordChar(CHAR)

[TBD]

SetReadOnly

SetReadOnly(FLAG)

[TBD]

SetRect

SetRect(LEFT,TOP,RIGHT,BOTTOM,[REDRAW])

[TBD]

SetSel

SetSel(START,END)

Selects the specified range of characters.

SetTabStops

SetTabStops( ...)

[TBD]

Undo

Undo()

[TBD]

EVENTS

Common events apply to most windows and controls.

Change

Change()

Sent when the text in the field is changed by the user.

GotFocus

GotFocus()

Sent when the control is activated.

LostFocus

LostFocus()

Sent when the control is deactivated.

MaxText

MaxText()

Sent when text has exceeded the specified number of characters

Scroll

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

Update()

Sent when an edit control is about to display altered text.

VERSION

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.

SUPPORT

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 and LICENCE

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.