Package wx :: Class TextCtrl

[frames | no frames]

## Type TextCtrl

    object --+
             |
        Object --+
                 |
        EvtHandler --+
                     |
                Window --+
                         |
                   Control --+
                             |
                            TextCtrl

Known Subclasses:
  `BaseMaskedTextCtrl`, `Calltip`, `CTextCellEditor`, `DispatcherListing`, `ExpandoTextCtrl`, `IntCtrl`, `RightTextCtrl`, `SearchCtrl`, `SessionListing`, `TreeTextCtrl`

Proxy of C++ TextCtrl class

Method Summary
Control | ``__init__`(self, parent, id, pos, size, style, validator, name)` Create a Control.
| `AppendText(self, text)`
bool | `CanCopy(self)`
bool | `CanCut(self)`
bool | `CanPaste(self)`
bool | `CanRedo(self)`
bool | `CanUndo(self)`
| `ChangeValue(self, value)`
| `Clear(self)`
| `Copy(self)`
bool | ``Create`(self, parent, id, pos, size, style, validator, name)` Do the 2nd phase and create the GUI control.
| `Cut(self)`
| `DiscardEdits(self)`
bool | `EmulateKeyPress(self, event)`
VisualAttributes | ``GetClassDefaultAttributes`(variant)` Get the default attributes for this class. (Static method)
TextAttr | `GetDefaultStyle(self)`
long | `GetInsertionPoint(self)`
long | `GetLastPosition(self)`
int | `GetLineLength(self, lineNo)`
String | `GetLineText(self, lineNo)`
int | `GetNumberOfLines(self)`
String | `GetRange(self, from, to)`
(from, to) | ``GetSelection`()` If the return values from and to are the same, there is no selection.
String | `GetString(self, from, to)`
String | `GetStringSelection(self)`
bool | `GetStyle(self, position, style)`
String | `GetValue(self)`
(result, col, row) | ``HitTest`(pt)` Find the row, col coresponding to the character at the point given in pixels.
(result, position) | ``HitTestPos`(pt)` Find the character position in the text coresponding to the point given in pixels.
bool | `IsEditable(self)`
bool | `IsEmpty(self)`
bool | `IsModified(self)`
bool | `IsMultiLine(self)`
bool | `IsSingleLine(self)`
bool | `LoadFile(self, file, fileType)`
| `MacCheckSpelling(self, check)`
| `MarkDirty(self)`
| `Paste(self)`
(x, y) | `PositionToXY(pos)`
| `Redo(self)`
| `Remove(self, from, to)`
| `Replace(self, from, to, value)`
bool | `SaveFile(self, file, fileType)`
| `SelectAll(self)`
| `SendTextUpdatedEvent(self)`
bool | `SetDefaultStyle(self, style)`
| `SetEditable(self, editable)`
| `SetInsertionPoint(self, pos)`
| `SetInsertionPointEnd(self)`
| ``SetMaxLength`(*args, **kwargs)` SetMaxLength(self, unsigned long len)
| `SetModified(self, modified)`
| `SetSelection(self, from, to)`
bool | `SetStyle(self, start, end, style)`
| `SetValue(self, value)`
| `ShowPosition(self, pos)`
| `Undo(self)`
| `write(self, text)`
| `WriteText(self, text)`
long | `XYToPosition(self, x, y)`

Property Summary
| `DefaultStyle`: See `GetDefaultStyle` and `SetDefaultStyle`
| `InsertionPoint`: See `GetInsertionPoint` and `SetInsertionPoint`
| `LastPosition`: See `GetLastPosition`
| `NumberOfLines`: See `GetNumberOfLines`
| `Selection`: See `GetSelection` and `SetSelection`
| `StringSelection`: See `GetStringSelection`
| `thisown`: The membership flag
| `Value`: See `GetValue` and `SetValue`

Instance Method Details

### __init__(self, parent, id=-1, value=EmptyString, pos=DefaultPosition, size=DefaultSize, style=0, validator=DefaultValidator, name=TextCtrlNameStr)
(Constructor)

Create a Control. Normally you should only call this from a subclass' __init__ as a plain old wx.Control is not very useful.

  Parameters:
    `parent`
    (type=Window)

    `id`
    (type=int)

    `pos`
    (type=Point)

    `size`
    (type=Size)

    `style`
    (type=long)

    `validator`
    (type=Validator)

    `name`
    (type=String)

  Returns:
    Control
  Overrides:
    `wx.Control.__init__` (inherited documentation)

### Create(self, parent, id=-1, value=EmptyString, pos=DefaultPosition, size=DefaultSize, style=0, validator=DefaultValidator, name=TextCtrlNameStr)

Do the 2nd phase and create the GUI control.

  Parameters:
    `parent`
    (type=Window)

    `id`
    (type=int)

    `pos`
    (type=Point)

    `size`
    (type=Size)

    `style`
    (type=long)

    `validator`
    (type=Validator)

    `name`
    (type=String)

  Returns:
    bool
  Overrides:
    `wx.Control.Create` (inherited documentation)

### GetSelection()

If the return values from and to are the same, there is no selection.

  Returns:
    (from, to)

### HitTest(pt)

Find the row, col coresponding to the character at the point given in pixels. NB: pt is in device coords but is not adjusted for the client area origin nor scrolling.

  Parameters:
    `pt`
    (type=Point)

  Returns:
    (result, col, row)
  Overrides:
    `wx.Window.HitTest`

### HitTestPos(pt)

Find the character position in the text coresponding to the point given in pixels. NB: pt is in device coords but is not adjusted for the client area origin nor scrolling.

  Parameters:
    `pt`
    (type=Point)

  Returns:
    (result, position)

### SetMaxLength(*args, **kwargs)

SetMaxLength(self, unsigned long len)

Static Method Details

### GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL)

Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control -- which is a much better idea than hard coding specific colours or fonts which might look completely out of place on the user's system, especially if it uses themes.

The variant parameter is only relevant under Mac currently and is ignore under other platforms. Under Mac, it will change the size of the returned font. See `wx.Window.SetWindowVariant` for more about this.

  Parameters:
    `variant`
    (type=int)

  Returns:
    VisualAttributes

Property Details

### DefaultStyle

See `GetDefaultStyle` and `SetDefaultStyle`

  Get Method:
    `GetDefaultStyle`(self)
  Set Method:
    `SetDefaultStyle`(self, style)

### InsertionPoint

See `GetInsertionPoint` and `SetInsertionPoint`

  Get Method:
    `GetInsertionPoint`(self)
  Set Method:
    `SetInsertionPoint`(self, pos)

### LastPosition

See `GetLastPosition`

  Get Method:
    `GetLastPosition`(self)

### NumberOfLines

See `GetNumberOfLines`

  Get Method:
    `GetNumberOfLines`(self)

### Selection

See `GetSelection` and `SetSelection`

  Get Method:
    `GetSelection`()
  Set Method:
    `SetSelection`(self, from, to)

### StringSelection

See `GetStringSelection`

  Get Method:
    `GetStringSelection`(self)

### thisown

The membership flag

### Value

See `GetValue` and `SetValue`

  Get Method:
    `GetValue`(self)
  Set Method:
    `SetValue`(self, value)

Generated by Epydoc 2.1.20050511.rpd on Thu Mar 22 12:09:40 2007 | http://epydoc.sf.net