Exemplo n.º 1
0
//==============================
//  ResumeMovieComponent::OnEvent_Impl
eMsgStatus ResumeMovieComponent::OnEvent_Impl( OvrGuiSys & guiSys, VrFrame const & vrFrame,
        VRMenuObject * self, VRMenuEvent const & event )
{
    switch( event.EventType )
    {
        case VRMENU_EVENT_FRAME_UPDATE:
            return Frame( guiSys, vrFrame, self, event );
        case VRMENU_EVENT_FOCUS_GAINED:
            return FocusGained( guiSys, vrFrame, self, event );
        case VRMENU_EVENT_FOCUS_LOST:
            return FocusLost( guiSys, vrFrame, self, event );
        case VRMENU_EVENT_TOUCH_DOWN:
        	if ( CallbackView != NULL )
        	{
        		Sound.PlaySound( guiSys.GetApp(), "touch_down", 0.1 );
        		return MSG_STATUS_CONSUMED;
        	}
        	return MSG_STATUS_ALIVE;
        case VRMENU_EVENT_TOUCH_UP:
        	if ( !( vrFrame.Input.buttonState & BUTTON_TOUCH_WAS_SWIPE ) && ( CallbackView != NULL ) )
        	{
                Sound.PlaySound( guiSys.GetApp(), "touch_up", 0.1 );
               	CallbackView->ResumeChoice( ItemNum );
        		return MSG_STATUS_CONSUMED;
        	}
            return MSG_STATUS_ALIVE;
        default:
            OVR_ASSERT( !"Event flags mismatch!" );
            return MSG_STATUS_ALIVE;
    }
}
//==============================
//  MovieSelectionComponent::OnEvent_Impl
eMsgStatus MovieSelectionComponent::OnEvent_Impl( App * app, VrFrame const & vrFrame, OvrVRMenuMgr & menuMgr,
        VRMenuObject * self, VRMenuEvent const & event )
{
    switch( event.EventType )
    {
		case VRMENU_EVENT_FRAME_UPDATE:
			return Frame( app, vrFrame, menuMgr, self, event );
        case VRMENU_EVENT_FOCUS_GAINED:
            return FocusGained( app, vrFrame, menuMgr, self, event );
        case VRMENU_EVENT_FOCUS_LOST:
            return FocusLost( app, vrFrame, menuMgr, self, event );
        case VRMENU_EVENT_TOUCH_DOWN:
       		Sound.PlaySound( app, "touch_down", 0.1 );
       		return MSG_STATUS_CONSUMED;
        case VRMENU_EVENT_TOUCH_UP:
        	if ( !( vrFrame.Input.buttonState & BUTTON_TOUCH_WAS_SWIPE ) )
			{
        		Sound.PlaySound( app, "touch_up", 0.1 );
        		CallbackView->SelectMovie();
        		return MSG_STATUS_CONSUMED;
        	}
            return MSG_STATUS_ALIVE;
        default:
            OVR_ASSERT( !"Event flags mismatch!" );
            return MSG_STATUS_ALIVE;
    }
}
Exemplo n.º 3
0
ezEditorInput ezConeAngleGizmo::DoMouseReleaseEvent(QMouseEvent* e)
{
  if (!IsActiveInputContext())
    return ezEditorInput::MayBeHandledByOthers;

  if (e->button() != Qt::MouseButton::LeftButton)
    return ezEditorInput::WasExclusivelyHandled;

  FocusLost(false);

  SetActiveInputContext(nullptr);
  return ezEditorInput::WasExclusivelyHandled;
}
Exemplo n.º 4
0
void CComponent::ChangeFocus(bool gained, CComponent *pComp)
{
	if(gained)
	{
//		s_pFocusComp = this;
		m_bFocus = true;
		FocusGained(pComp);
	}
	else
	{
//		s_pFocusComp = 0;
		m_bFocus = false;
		FocusLost(pComp);
	}
}
Exemplo n.º 5
0
//==============================
// OvrTextFade_Component::OnEvent_Impl
eMsgStatus OvrTextFade_Component::OnEvent_Impl( App * app, VrFrame const & vrFrame, OvrVRMenuMgr & menuMgr,
												VRMenuObject * self, VRMenuEvent const & event )
{
	OVR_ASSERT( HandlesEvent( VRMenuEventFlags_t( event.EventType ) ) );
	switch ( event.EventType )
	{
		case VRMENU_EVENT_FRAME_UPDATE:
		return Frame( app, vrFrame, menuMgr, self, event );
		case VRMENU_EVENT_FOCUS_GAINED:
		return FocusGained( app, vrFrame, menuMgr, self, event );
		case VRMENU_EVENT_FOCUS_LOST:
		return FocusLost( app, vrFrame, menuMgr, self, event );
		default:
		OVR_ASSERT( !"Event flags mismatch!" ); // the constructor is specifying a flag that's not handled
		return MSG_STATUS_ALIVE;
	}
}
Exemplo n.º 6
0
//==============================
//  OvrDefaultComponent::OnEvent_Impl
eMsgStatus OvrDefaultComponent::OnEvent_Impl( App * app, VrFrame const & vrFrame, OvrVRMenuMgr & menuMgr, 
        VRMenuObject * self, VRMenuEvent const & event )
{
    switch( event.EventType )
    {
        case VRMENU_EVENT_FRAME_UPDATE:
            return Frame( app, vrFrame, menuMgr, self, event );
        case VRMENU_EVENT_FOCUS_GAINED:
            return FocusGained( app, vrFrame, menuMgr, self, event );
        case VRMENU_EVENT_FOCUS_LOST:
            return FocusLost( app, vrFrame, menuMgr, self, event );
        case VRMENU_EVENT_TOUCH_DOWN:
            DownSoundLimiter.PlaySound( app, "sv_panel_touch_down", 0.1 );
            return MSG_STATUS_ALIVE;
        case VRMENU_EVENT_TOUCH_UP:
            UpSoundLimiter.PlaySound( app, "sv_panel_touch_up", 0.1 );
            return MSG_STATUS_ALIVE;
        default:
            OVR_ASSERT( !"Event flags mismatch!" );
            return MSG_STATUS_ALIVE;
    }
}
Exemplo n.º 7
0
LRESULT CALLBACK PopupProc(HWND hWnd, UINT uMsg,
			   WPARAM wParam, LPARAM lParam)
{
    switch (uMsg)
    {
    case WM_CREATE:

	// Get the window and client dimensions

	GetClientRect(hWnd, &popup.rect);

	int width = popup.rect.right - popup.rect.left;
	int height = popup.rect.bottom - popup.rect.top;

	// Create level control

	level.hwnd =
	    CreateWindow(TRACKBAR_CLASS, NULL,
			 WS_VISIBLE | WS_CHILD |
			 TBS_VERT | TBS_NOTICKS,
			 0, 0,
			 width, height, hWnd,
			 (HMENU)LEVEL_ID, hInst, NULL);

	// Set the slider range

	SendMessage(level.hwnd, TBM_SETRANGE, TRUE,
		    MAKELONG(MIN_VOL, MAX_VOL));
	SendMessage(level.hwnd, TBM_SETPAGESIZE, 0, STEP_VOL);

	// Add level to tooltip

	tooltip.info.uId = (UINT_PTR)level.hwnd;
	tooltip.info.lpszText = "Input level";

	SendMessage(tooltip.hwnd, TTM_ADDTOOL, 0,
		    (LPARAM) &tooltip.info);

	if (mixer.pmxcd != NULL)
	{
	    // Get the value

	    mixerGetControlDetails((HMIXEROBJ)mixer.hmx, mixer.pmxcd,
				   MIXER_GETCONTROLDETAILSF_VALUE);

	    // Set the slider

	    int value = MAX_VOL - (mixer.pmxcdu->dwValue * (MAX_VOL - MIN_VOL) /
				   (mixer.pmxc->Bounds.dwMaximum -
				    mixer.pmxc->Bounds.dwMinimum));

	    SendMessage(level.hwnd, TBM_SETPOS, TRUE, value);
	}

	else
	    EnableWindow(level.hwnd, FALSE);

	break;

	// Level control

    case WM_VSCROLL:
	ChangeLevel(wParam, lParam);

	// Set the focus back to the window

	SetFocus(hWnd);
	break;

	// Focus lost

    case WM_KILLFOCUS:
	FocusLost(hWnd, wParam, lParam);
	break;

	// Everything else

    default:
	return DefWindowProc(hWnd, uMsg, wParam, lParam);
    }

    return 0;
}