| 340 | } |
| 341 | |
| 342 | std::string TextField::getSelectedText() { |
| 343 | int begin = std::min(cursor, selection); |
| 344 | int len = std::abs(selection - cursor); |
| 345 | return text.substr(begin, len); |
| 346 | } |
| 347 | |
| 348 | void TextField::insertText(std::string text) { |
| 349 | // Rack uses UNIX newlines so remove all CR characters |