MCPcopy Create free account
hub / github.com/ZDoom/Raze / OnMouseUp

Method OnMouseUp

libraries/ZWidget/src/widgets/lineedit/lineedit.cpp:331–354  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

329}
330
331bool 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
356void LineEdit::OnKeyChar(std::string chars)
357{

Callers

nothing calls this directly

Calls 1

StopMethod · 0.45

Tested by

no test coverage detected