MCPcopy Create free account
hub / github.com/KLayout/klayout / handle_click

Method handle_click

src/laybasic/laybasic/layMove.cc:388–433  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

386}
387
388bool
389MoveService::handle_click (const db::DPoint &p, unsigned int buttons, bool drag_transient, db::Transaction *transaction)
390{
391 std::unique_ptr<db::Transaction> trans_holder (transaction);
392
393 if (! m_dragging) {
394
395 mp_transaction.reset (trans_holder.release ());
396 ui ()->drag_cancel ();
397
398 if (mp_editables->begin_move (p, ac_from_buttons (buttons))) {
399
400 ui ()->hover_reset ();
401
402 mp_editables->clear_transient_selection ();
403
404 m_dragging = true;
405 m_dragging_transient = drag_transient;
406
407 show_toolbox (true);
408 ui ()->grab_mouse (this, false);
409
410 m_shift = db::DPoint ();
411
412 return true;
413
414 }
415
416 } else {
417
418 m_dragging = false;
419
420 show_toolbox (false);
421 ui ()->ungrab_mouse (this);
422
423 mp_editables->end_move (p, ac_from_buttons (buttons), mp_transaction.release ());
424
425 if (m_dragging_transient) {
426 mp_editables->clear_selection ();
427 }
428
429 return true;
430
431 }
432 return false;
433}
434
435void
436MoveService::drag_cancel ()

Callers

nothing calls this directly

Calls 12

uiFunction · 0.70
ac_from_buttonsFunction · 0.70
resetMethod · 0.45
releaseMethod · 0.45
drag_cancelMethod · 0.45
begin_moveMethod · 0.45
hover_resetMethod · 0.45
grab_mouseMethod · 0.45
ungrab_mouseMethod · 0.45
end_moveMethod · 0.45
clear_selectionMethod · 0.45

Tested by

no test coverage detected