| 329 | } |
| 330 | |
| 331 | bool LineEdit::OnMouseUp(const Point& pos, int key) |
| 332 | { |
| 333 | if (mouse_selecting && key == IK_LeftMouse) |
| 334 | { |
| 335 | if (ignore_mouse_events) // This prevents text selection from changing from what was set when focus was gained. |
| 336 | { |
| 337 | ReleaseMouseCapture(); |
| 338 | ignore_mouse_events = false; |
| 339 | mouse_selecting = false; |
| 340 | } |
| 341 | else |
| 342 | { |
| 343 | scroll_timer->Stop(); |
| 344 | ReleaseMouseCapture(); |
| 345 | mouse_selecting = false; |
| 346 | int sel_end = GetCharacterIndex(pos.x); |
| 347 | SetSelectionLength(sel_end - selection_start); |
| 348 | cursor_pos = sel_end; |
| 349 | SetFocus(); |
| 350 | Update(); |
| 351 | } |
| 352 | } |
| 353 | return true; |
| 354 | } |
| 355 | |
| 356 | void LineEdit::OnKeyChar(std::string chars) |
| 357 | { |