void CFWL_ScrollBarImpDelegate::OnLButtonUp(FX_DWORD dwFlags,
                                            FX_FLOAT fx,
                                            FX_FLOAT fy) {
  FWL_StopTimer(m_pOwner->m_hTimer);
  m_pOwner->m_bMouseDown = FALSE;
  DoMouseUp(0, m_pOwner->m_rtMinBtn, m_pOwner->m_iMinButtonState, fx, fy);
  DoMouseUp(1, m_pOwner->m_rtThumb, m_pOwner->m_iThumbButtonState, fx, fy);
  DoMouseUp(2, m_pOwner->m_rtMaxBtn, m_pOwner->m_iMaxButtonState, fx, fy);
  DoMouseUp(3, m_pOwner->m_rtMinTrack, m_pOwner->m_iMinTrackState, fx, fy);
  DoMouseUp(4, m_pOwner->m_rtMaxTrack, m_pOwner->m_iMaxTrackState, fx, fy);
  m_pOwner->SetGrab(FALSE);
}
/*  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;
}
/*
==================
Sys_SendKeyEvents
==================
*/
void Sys_SendKeyEvents (void) {
	Boolean		   gotEvent;
	EventRecord	   event;
	
	if ( !glConfig.isFullscreen || sys_waitNextEvent->value ) {
		// this call involves 68k code and task switching.
		// do it on the desktop, or if they explicitly ask for
		// it when fullscreen
		gotEvent = WaitNextEvent(everyEvent, &event, 0, nil);
	} else {
		gotEvent = GetOSEvent( everyEvent, &event );
	}
	
	// generate faked events from modifer changes
	Sys_ModifierEvents( event.modifiers );

	sys_lastEventTic = event.when;

	if ( !gotEvent ) {
		return;
	}
	if ( Sys_ConsoleEvent(&event) ) {
		return;
	}
	switch(event.what)
	{
		case mouseDown:
			DoMouseDown(&event);
		break;
		case mouseUp:
			DoMouseUp(&event);
		break;
		case keyDown:
			DoKeyDown(&event);
		break;
		case keyUp:
			DoKeyUp(&event);
		break;
		case autoKey:
			DoKeyDown(&event);
		break;
		case updateEvt:
			DoUpdate((WindowPtr) event.message);
		break;
		case diskEvt:
			DoDiskEvent(&event);
		break;
		case activateEvt:
			DoActivate((WindowPtr) event.message, event.modifiers);
		break;
		case osEvt:
			DoOSEvent(&event);
		break;
		default:
		break;
	}
}
Exemple #4
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;
}