class CEdit
__init__(self, parent, initial_text, nchars = None)

Class CEdit represents an edit (or entry) control, a one-line box
in which the user types and edits text.  To read the text after
the user has entered it, use GetWindowText().

If the edit control is in a dialog box, the Enter and Esc keys will
dismiss the dialog box as usual, even if the Edit Control has focus.

Instance Variables

wpyParent, wpyText, wpyChildList, wpySizeX/Y, wpyLocX/Y

wpyPasswordChar, char or None, readonly after Create()
	If this is changed from None to a character such as "*", then
	that character will be shown in the control rather than the
	characters actually typed.

wpyTextColor, the tuple (r, g, b)
	Sets the text color to the given color.

wpyBrush, an instance of a CBrush (don't forget to Create() it).
	Sets the background color to the color of the brush.

Methods

__init__(self, parent, initial_text, nchars = None)
	Return an editbox with self.wpySizeX/Y set according to the arguments given.
parent, object
	The view or dialog parent of the control.
initial_text, string
	The initial text to display in the edit control.  Assigned to wpyText.
nchars, int or None
	The size of the editbox is nchars average characters if given, else
	it is the size of initial_text if given, else it is 10 characters.

Create(self)
	Make the editbox visible by calling the underlying GUI.

SetSel(self, char1, char2)
	Set the selection to the range char1 to char2, and set the cursor to
	just before char2.  If char1 == char2, just set the cursor, not the
	selection.  Use a large char2 (such as 999) to indicate the end of
	the edit control.

SetWindowText(self, text)
	Write the text to the editbox replacing any existing text.

GetWindowText(self)
	Get the edited text from the editbox.  Returns a string.

Messages
OnChar(self, char, flags)
	Sent to the edit control when the user presses a key.  Useful for
	dismissing the edit control when the user presses "enter".  If
	the edit control is in a dialog box, the dialog box will be dismissed
	when the user presses "enter" or "esc".


class CMultiEdit
__init__(self, parent, initial_text, nchars = None, nlines = 4)

Class CMultiEdit represents a multi-line edit control.  It is similar to
CEdit, except for supporting multiple lines.  The methods used to access
the text are the same as used for CEditView.  Use of SetWindowText() and
GetWindowText() requires return-newline on Windows
and newline alone on Tk, so use of these should be avoided.
Also, initial_text must be just one line (the longest line for sizing) if it
is used.  Do not include returns or newlines.  Clear the control and
append text as desired.

To include scroll bars on a CMultiEdit, set self.wpyHScrollSize and/or
self.wpyVScrollSize to non-zero.  The size of the scroll bars is available
as self.wpyScrollWidth, and is not included in the size returned from
the constructor.

BUG: In a Windows dialog, the "enter" key doesn't work; use ^M or ^J.


Examples

# Create a label and editbox.
editlabel = CLabel(self, "Edit: ")
editlabel.wpyLocX = x
editlabel.wpyLocY = y
editlabel.Create()

editbox = CEdit(self, "initial text", 20)
editbox.wpyLocX = x + editlabel.wpySizeX
editbox.wpyLocY = y
editbox.Create()
