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

Method OnMouseUp

libraries/ZWidget/src/widgets/textedit/textedit.cpp:309–332  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

307}
308
309bool TextEdit::OnMouseUp(const Point& pos, int key)
310{
311 if (mouse_selecting && key == IK_LeftMouse)
312 {
313 if (ignore_mouse_events) // This prevents text selection from changing from what was set when focus was gained.
314 {
315 ReleaseMouseCapture();
316 ignore_mouse_events = false;
317 mouse_selecting = false;
318 }
319 else
320 {
321 scroll_timer->Stop();
322 ReleaseMouseCapture();
323 mouse_selecting = false;
324 ivec2 sel_end = GetCharacterIndex(pos);
325 selection_length = ToOffset(sel_end) - ToOffset(selection_start);
326 cursor_pos = sel_end;
327 SetFocus();
328 Update();
329 }
330 }
331 return true;
332}
333
334void TextEdit::OnKeyChar(std::string chars)
335{

Callers 1

OnWindowMouseUpMethod · 0.45

Calls 1

StopMethod · 0.45

Tested by

no test coverage detected