Beispiel #1
0
void Filesets_ContinueDrag (HWND hDlg)
{
   if (l.fDragging)
      {
      LPIDENT lpi = NULL;
      HLISTITEM hItemTarget;

      DWORD dw = GetMessagePos();
      POINT pt = { LOWORD(dw), HIWORD(dw) };
      HWND hTarget = WindowFromPoint (pt);

      if (hTarget != NULL)
         {
         POINT ptClient = pt;
         ScreenToClient (hTarget, &ptClient);

         if ((lpi = IdentifyPoint (hTarget, ptClient, &hItemTarget)) != NULL)
            {
            if (!lpi->fIsServer() && !lpi->fIsAggregate())
               lpi = NULL;
            }
         }

      if (lpi != l.lpiTarget)
         {
         ImageList_DragLeave (NULL);

         if (l.hItemTarget)
            {
            LPARAM dwFlags = FastList_GetItemFlags (l.hwndTarget, l.hItemTarget);
            FastList_SetItemFlags (l.hwndTarget, l.hItemTarget, dwFlags & (~FLIF_DROPHIGHLIGHT));
            l.hItemTarget = NULL;
            l.lpiTarget = NULL;
            }

         if ((l.lpiTarget = lpi) != NULL)
            {
            l.hwndTarget = hTarget;
            l.hItemTarget = hItemTarget;
            LPARAM dwFlags = FastList_GetItemFlags (l.hwndTarget, l.hItemTarget);
            FastList_SetItemFlags (l.hwndTarget, l.hItemTarget, dwFlags | FLIF_DROPHIGHLIGHT);
            }

         ScreenToClient (NULL, &pt);
         ImageList_DragEnter (NULL, pt.x, pt.y);
         }

      ImageList_DragMove (LOWORD(dw), HIWORD(dw));
      }
}
Beispiel #2
0
void TScrollBar::DoMouseDown(const TPoint& point, TMouseButton button, TModifierState state)
{
	if (button == kLeftButton)
	{
//	ASSERT(fTrackingPart == kNone);

		fTrackingPart = IdentifyPoint(point, fTrackingRect);
		fInTrackingRect = true;

		switch (fTrackingPart)
		{
			case kArrow1:
			{
				TDrawContext	context(this);
				DrawArrow1(context, true);
				HandleCommand(this, this, (IsVertical() ? kScrollUpCommandID : kScrollLeftCommandID));
				EnableIdling(true);
				break;
			}
			
			case kArrow2:
			{
				TDrawContext	context(this);
				DrawArrow2(context, true);
				HandleCommand(this, this, (IsVertical() ? kScrollDownCommandID : kScrollRightCommandID));
				EnableIdling(true);
				break;
			}

			case kPageUp:
				HandleCommand(this, this, (IsVertical() ? kPageUpCommandID : kPageLeftCommandID));
				EnableIdling(true);
				break;

			case kPageDown:
				HandleCommand(this, this, (IsVertical() ? kPageDownCommandID : kPageRightCommandID));
				EnableIdling(true);
				break;

			default:
				break;
		}

		fLastPoint = point;
	}
}
void SimpleDraw::IdentifyPoint2( Vec3d  p )
{
	// Green
	IdentifyPoint(p, 0.2f, 1.0f, 0.2f, 12.0f);
}