* Sets up a blank text edit with the specified size and position. * @param state Pointer to state the text edit belongs to. * @param width Width in pixels. * @param height Height in pixels. * @param x X position in pixels. * @param y Y position in pixels. */
| 35 | * @param y Y position in pixels. |
| 36 | */ |
| 37 | TextEdit::TextEdit(State *state, int width, int height, int x, int y) : InteractiveSurface(width, height, x, y), _value(L""), _blink(true), _modal(true), _ascii(L'A'), _caretPos(0), _numerical(false), _change(0), _state(state) |
| 38 | { |
| 39 | _isFocused = false; |
| 40 | _text = new Text(width, height, 0, 0); |
| 41 | _timer = new Timer(100); |
| 42 | _timer->onTimer((SurfaceHandler)&TextEdit::blink); |
| 43 | _caret = new Text(16, 17, 0, 0); |
| 44 | _caret->setText(L"|"); |
| 45 | } |
| 46 | |
| 47 | /** |
| 48 | * Deletes contents. |