MCPcopy Create free account
hub / github.com/ColorCop/ColorCop / OnLButtonDown

Method OnLButtonDown

ColorCop/ColorCopDlg.cpp:1463–1597  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1461}
1462
1463void CColorCopDlg::OnLButtonDown(UINT nFlags, CPoint point) {
1464 CDialog::OnLButtonDown(nFlags, point);
1465 CString strStatus = "";
1466
1467 // the left mouse button was pressed, lets find out where
1468
1469 CWnd* pWnd = ChildWindowFromPoint(point);
1470 if (pWnd && pWnd->GetSafeHwnd() == m_EyeLoc.GetSafeHwnd()) {
1471 // left mouse button down on the eyedropper
1472 m_isEyedropping = TRUE;
1473 m_InitialMove = TRUE;
1474 m_bCalcColorPal = TRUE; // ReCalculate Color Palette
1475
1476 SetCapture();
1477 SetTimer(1, 100, NULL); // install the timer
1478
1479 m_EyeLoc.SetIcon(m_hBlank);
1480 SetCursor(m_hEyeCursor);
1481 return;
1482
1483 } else if (pWnd && pWnd->GetSafeHwnd() == m_Magnifier.GetSafeHwnd()) {
1484 // left mouse button down on the magnifier
1485
1486 SetCursor(m_hMagCursor);
1487 m_isMagnifying = true;
1488 SetCapture();
1489 SetTimer(1, 100, NULL); // install the timer
1490
1491 m_Magnifier.SetIcon(m_hBlank);
1492
1493 } else if (pWnd && pWnd->GetSafeHwnd() == m_MagWindow.GetSafeHwnd()) {
1494 // left mouse button down on magnification window
1495 // we should get the color, because we can.
1496 // it's in the client window.
1497
1498
1499 if (m_Appflags & MAGWHILEEYEDROP) {
1500 m_MagDrop = true;
1501 }
1502
1503
1504 m_isEyedropping = TRUE;
1505 m_InitialMove = TRUE; // Push color to color history
1506 m_bCalcColorPal = TRUE; // ReCalculate Color Palette
1507 SetCapture();
1508 m_EyeLoc.SetIcon(m_hBlank);
1509 SetCursor(m_hEyeCursor);
1510 PostMessage(WM_MOUSEMOVE, HTCAPTION, MAKELPARAM(point.x, point.y));
1511 return;
1512
1513 } else if (pWnd && pWnd->GetSafeHwnd() == m_ColorPalette.GetSafeHwnd()) {
1514 m_isEyedropping = TRUE;
1515 m_InitialMove = FALSE; // Push color to color history
1516 m_bCalcColorPal = FALSE; // ReCalculate Color Palette
1517 SetCapture();
1518 m_EyeLoc.SetIcon(m_hBlank);
1519 SetCursor(m_hEyeCursor);
1520 PostMessage(WM_MOUSEMOVE, HTCAPTION, MAKELPARAM(point.x, point.y));

Callers

nothing calls this directly

Calls 1

SetIconMethod · 0.80

Tested by

no test coverage detected