MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / OnClicked

Method OnClicked

Source/Snapshots.cpp:293–334  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

291}
292
293void Snapshots::OnClicked(float x, float y, bool right)
294{
295 IDrawableModule::OnClicked(x, y, right);
296
297 if (right)
298 return;
299
300 if (mGrid->TestClick(x, y, right, true))
301 {
302 float gridX, gridY;
303 mGrid->GetPosition(gridX, gridY, true);
304 GridCell cell = mGrid->GetGridCellAt(x - gridX, y - gridY);
305
306 int idx = cell.mCol + cell.mRow * mGrid->GetCols();
307
308 if (GetKeyModifiers() == kModifier_Shift || mStoreMode)
309 {
310 StoreSnapshot(idx, true);
311 }
312 else if (GetKeyModifiers() == kModifier_Alt || mDeleteMode)
313 {
314 DeleteSnapshot(idx);
315 }
316 else if (GetKeyModifiers() == kModifier_Command)
317 {
318 mSnapshotRenameIndex = idx;
319 if (idx >= 0 && idx < (int)mSnapshotCollection.size())
320 {
321 mSnapshotLabel = mSnapshotCollection[idx].mLabel;
322 mSnapshotLabelEntry->UpdateDisplayString();
323 }
324 mSnapshotLabelEntry->MakeActiveTextEntry(!K(setCaretToEnd));
325 mSnapshotLabelEntry->SelectAll();
326 }
327 else
328 {
329 SetSnapshot(idx, NextBufferTime(false));
330 }
331
332 UpdateGridValues();
333 }
334}
335
336bool Snapshots::MouseMoved(float x, float y)
337{

Callers

nothing calls this directly

Calls 10

GetKeyModifiersFunction · 0.85
NextBufferTimeFunction · 0.85
sizeMethod · 0.80
UpdateDisplayStringMethod · 0.80
MakeActiveTextEntryMethod · 0.80
SelectAllMethod · 0.80
TestClickMethod · 0.45
GetPositionMethod · 0.45
GetGridCellAtMethod · 0.45
GetColsMethod · 0.45

Tested by

no test coverage detected