| 548 | } |
| 549 | |
| 550 | void TextEdit::OnSetFocus() |
| 551 | { |
| 552 | if (!readonly) |
| 553 | timer->Start(500); |
| 554 | if (select_all_on_focus_gain) |
| 555 | SelectAll(); |
| 556 | ignore_mouse_events = true; |
| 557 | cursor_pos.y = lines.size() - 1; |
| 558 | cursor_pos.x = lines[cursor_pos.y].text.length(); |
| 559 | |
| 560 | Update(); |
| 561 | |
| 562 | if (FuncFocusGained) |
| 563 | FuncFocusGained(); |
| 564 | } |
| 565 | |
| 566 | void TextEdit::OnLostFocus() |
| 567 | { |