void CFWL_ScrollBarImpDelegate::OnMouseMove(FX_DWORD dwFlags,
                                            FX_FLOAT fx,
                                            FX_FLOAT fy) {
  DoMouseMove(0, m_pOwner->m_rtMinBtn, m_pOwner->m_iMinButtonState, fx, fy);
  DoMouseMove(1, m_pOwner->m_rtThumb, m_pOwner->m_iThumbButtonState, fx, fy);
  DoMouseMove(2, m_pOwner->m_rtMaxBtn, m_pOwner->m_iMaxButtonState, fx, fy);
  DoMouseMove(3, m_pOwner->m_rtMinTrack, m_pOwner->m_iMinTrackState, fx, fy);
  DoMouseMove(4, m_pOwner->m_rtMaxTrack, m_pOwner->m_iMaxTrackState, fx, fy);
}
/*  Dispatch a single event
 *  @param   anEvent - the event to dispatch
 *  @return  A boolean which states whether we handled the event
 */
PRBool nsMacMessagePump::DispatchEvent(EventRecord *anEvent)
{
  PRBool handled = PR_FALSE;

  if (!mProcessEvents)
    return handled;
  
  switch(anEvent->what) {
    // diskEvt is gone in Carbon, and so is unhandled here.
    // keyUp, keyDown, and autoKey now have Carbon event handlers in
    //  nsMacWindow.

    case mouseDown:
      handled = DoMouseDown(*anEvent);
      break;

    case mouseUp:
      handled = DoMouseUp(*anEvent);
      break;

    case osEvt: {
      unsigned char eventType = ((anEvent->message >> 24) & 0x00ff);
      if (eventType == mouseMovedMessage)
        handled = DoMouseMove(*anEvent);
      break;
    }
      
    case kHighLevelEvent:
      ::AEProcessAppleEvent(anEvent);
      handled = PR_TRUE;
      break;
  }

  return handled;
}
LRESULT CALLBACK WndProc (HWND hWnd, UINT Message,
			 WPARAM wParam, LPARAM lParam)
{
    switch(Message)
    {
	case WM_COMMAND:
	    return DoWMCommand(wParam, hWnd);

	case WM_LBUTTONDOWN:
	    DoLButtonDown(hWnd,lParam);
	    break;

	case WM_LBUTTONUP:
	    DoLButtonUp(hWnd,lParam);
	    break;

	case WM_MOUSEMOVE:
	    DoMouseMove(hWnd,lParam);
	    break;

	case WM_PAINT:
	    DoPaint(hWnd);
	    break;

	case WM_DESTROY:
	    PostQuitMessage(0);
	    break;

	default:
	    return DefWindowProc(hWnd,Message,wParam,lParam);
    }
    return 0;
}
void XGPopMenuView::DoPrePeriodic()
{
	XRect r;
	
	if (fScrollFlag && (fTime < XGGetTime())) {
		r = GetContentRect();
		if (PtInRect(fLastPos,&r)) {
			DoMouseMove(fLastPos,0);
		}
	}
}
Exemple #5
0
//
/// Releases the mouse capture if the caption bar is enabled and a mouse button is
/// pressed. Sets hitTest, indicating the mouse button has been pressed. Captures
/// the mouse message and repaints the smaller buttons before returning esComplete.
//
TEventStatus
TTinyCaption::DoLButtonUp(uint modKeys, const TPoint& pt)
{
    if (TCEnabled && DownHit != HTNOWHERE) {
        ReleaseCapture();
        DoMouseMove(modKeys, pt);

        uint   hitTest;
        TPoint screenPt = pt;
        ClientToScreen(screenPt);    // Cvt to screen coord
        DoNCHitTest(screenPt, hitTest);

        if (hitTest == DownHit) {
            DownHit = HTNOWHERE;
            switch (hitTest) {
            case HTSYSMENU:
                if (CloseBox)
                    PostMessage(WM_CLOSE);
                return esComplete;

            // We have to handle these buttons also to prevent defproc from
            // painting the standard big min/max buttons when left mouse button is
            // pressed
            //
            case HTMINBUTTON:
                HandleMessage(WM_SYSCOMMAND, SC_MINIMIZE);
                return esComplete;

            case HTMAXBUTTON:
                HandleMessage(WM_SYSCOMMAND, IsZoomed() ? SC_RESTORE : SC_MAXIMIZE);
                return esComplete;
            }
        }
        DownHit = HTNOWHERE;
    }
    return esPartial;
}
Exemple #6
0
/*************
 * DESCRIPTION:	handles movement of mouse
 *						calls DoMouseMove from mouse.cpp
 * INPUT:			nFlags   Specifies if various flags are set
 *						point    coordinates of mouse cursor
 * OUTPUT:			-
 *************/
void CCamView::OnMouseMove(UINT nFlags, CPoint point)
{
    CPoint pntScreen;
    RECTANGLE r;

    pntScreen = point;
    ClientToScreen(&point);

    if (!bLeftButton)
        return;

    // return when OnMouseMove was caused from SetCursorPos
    if (pntOldCursor == point)
        return;

    if (pDisplay->editmode & EDIT_SELBOX)
    {
        if (pDisplay->boxmode == BOXMODE_RENDERWINDOW)
            pDisplay->GetRenderRect(&r);
        else
        {
            r.left = pDisplay->view->left;
            r.right = pDisplay->view->right;
            r.top = pDisplay->view->top;
            r.bottom = pDisplay->view->bottom;
        }
        pDisplay->DrawSelBox();
        if (pntScreen.x < r.left)
            pDisplay->selbox.right = r.left;
        else
        {
            if (pntScreen.x > r.right)
                pDisplay->selbox.right = r.right;
            else
                pDisplay->selbox.right = pntScreen.x;
        }
        if (pntScreen.y < r.top)
            pDisplay->selbox.bottom = r.top;
        else
        {
            if (pntScreen.y > r.bottom)
                pDisplay->selbox.bottom = r.bottom;
            else
                pDisplay->selbox.bottom = pntScreen.y;
        }
        pDisplay->DrawSelBox();
    }
    else
    {
        if (pDisplay->editmode & EDIT_ACTIVE)
        {
            if (nFlags & (MK_LBUTTON | MK_RBUTTON))
            {
                mouse_data.oldmousex = pntOldCursor.x;
                mouse_data.oldmousey = pntOldCursor.y;
                DoMouseMove(pDisplay, point.x, point.y, &mouse_data);
                //		Invalidate(FALSE);
                Redraw(REDRAW_OBJECTS, mouse_data.changed);

                SetCursorPos(pntOldCursor.x, pntOldCursor.y);

                mouse_data.changed = TRUE;
            }
        }
    }
}
Exemple #7
0
BOOL CALLBACK SearchWindowDialogProc
(
	HWND hwndDlg, // handle to dialog box 
	UINT uMsg, // message 
	WPARAM wParam, // first message parameter 
	LPARAM lParam // second message parameter 
	)
{
	BOOL bRet = FALSE;  // Default return value.

	switch (uMsg)
	{
	case WM_INITDIALOG:
	{
		if (isParentKill) CheckDlgButton(hwndDlg, IDC_CHECK1, 1);
		bRet = TRUE;
		break;
	}

	case WM_MOUSEMOVE:
	{
		bRet = TRUE;

		if (g_bStartSearchWindow)
		{
			// Only when we have started the Window Searching operation will we 
			// track mouse movement.
			DoMouseMove(hwndDlg, uMsg, wParam, lParam);
		}

		break;
	}

	case WM_LBUTTONUP:
	{
		bRet = TRUE;

		if (g_bStartSearchWindow)
		{
			// Only when we have started the window searching operation will we
			// be interested when the user lifts up the left mouse button.
			DoMouseUp(hwndDlg, uMsg, wParam, lParam);
		}

		break;
	}

	case WM_COMMAND:
	{
		WORD wNotifyCode = HIWORD(wParam); // notification code 
		WORD wID = LOWORD(wParam);         // item, control, or accelerator identifier 
		HWND hwndCtl = (HWND)lParam;      // handle of control 

		if ((wID == IDOK))
		{
			if (hStoreWnd != hwndDlg)
			{
				HWND hTargetWnd = hStoreWnd;
				if (IsDlgButtonChecked(hwndDlg, IDC_CHECK1))
				{
					while (GetParent(hTargetWnd))
					{
						hTargetWnd = GetParent(hTargetWnd);
					}
					isParentKill = true;
				}
				else
					isParentKill = false;
				SetParent(hTargetWnd, hwndDlg);
			}
			bRet = TRUE;
			EndDialog(hwndDlg, wID);
		}
		else if (wID == IDCANCEL)
		{
			ExitProcess(0);
		}

		if (wID == IDC_STATIC_ICON_FINDER_TOOL)
		{
			// Because the IDC_STATIC_ICON_FINDER_TOOL static control is set with the SS_NOTIFY
			// flag, the Search Window's dialog box will be sent a WM_COMMAND message when this 
			// static control is clicked.
			bRet = TRUE;
			// We start the window search operation by calling the DoSearchWindow() function.
			SearchWindow(hwndDlg);
			break;
		}

		break;
	}

	default:
	{
		bRet = FALSE;
		break;
	}
	}

	return bRet;
}
Exemple #8
0
//
/// Responds to a mouse-move message by calling DoMouseMove. If DoMouseMove does not
/// return IsComplete, EvMouseMove calls TWindow::EvMouseMove.
//
void
TTinyCaption::EvMouseMove(uint modKeys, const TPoint& pt)
{
    if (DoMouseMove(modKeys, pt) == esPartial)
        TWindow::EvMouseMove(modKeys, pt);
}