Ejemplo n.º 1
0
bool
FlarmTrafficControl::OnMouseGesture(const TCHAR* gesture)
{
  if (StringIsEqual(gesture, _T("U"))) {
    ZoomIn();
    return true;
  }
  if (StringIsEqual(gesture, _T("D"))) {
    ZoomOut();
    return true;
  }
  if (StringIsEqual(gesture, _T("UD"))) {
    SetAutoZoom(true);
    return true;
  }
  if (StringIsEqual(gesture, _T("DR"))) {
    OpenDetails();
    return true;
  }
  if (StringIsEqual(gesture, _T("RL"))) {
    SwitchData();
    return true;
  }

  return InputEvents::processGesture(gesture);
}
Ejemplo n.º 2
0
void CFFTDisp::OnLButtonUp(UINT nFlags, CPoint point) 
{
	// TODO: Add your message handler code here and/or call default

	// 保存当前坐标
	CPoint ptTemp;
	ptTemp = point;
	//ScreenToClient( &ptTemp );
	m_ptRightClick = ptTemp;

	// 找到主框架
	CMainFrame* pFrame = NULL;
	pFrame = (CMainFrame*)(AfxGetApp()->m_pMainWnd);
	if ( pFrame != NULL )
	{
		if ( pFrame->m_bZoomOut )
		{
			ZoomOut();
		}
		else if ( pFrame->m_bZoomIn )
		{
			ZoomIn();
		}		
	}

	CWnd::OnLButtonUp(nFlags, point);
}
Ejemplo n.º 3
0
bool
FlarmTrafficControl::OnKeyDown(unsigned key_code)
{
  switch (key_code) {
  case KEY_UP:
    if (!HasPointer())
      break;

    ZoomIn();
    return true;

  case KEY_DOWN:
    if (!HasPointer())
      break;

    ZoomOut();
    return true;

#ifdef GNAV
  case '6':
    PrevTarget();
    return true;

  case '7':
    NextTarget();
    return true;
#endif
  }

  return FlarmTrafficWindow::OnKeyDown(key_code) ||
    InputEvents::processKey(key_code);
}
Ejemplo n.º 4
0
void
TrafficWidget::OnAction(int id)
{
  switch ((Action)id) {
  case CLOSE:
    PageActions::Restore();
    break;

  case DETAILS:
    OpenDetails();
    break;

  case PREVIOUS_ITEM:
    PreviousTarget();
    break;

  case NEXT_ITEM:
    NextTarget();
    break;

  case ZOOM_IN:
    ZoomIn();
    break;

  case ZOOM_OUT:
    ZoomOut();
    break;
  }
}
Ejemplo n.º 5
0
bool
FlarmTrafficControl::on_mouse_gesture(const TCHAR* gesture)
{
  if (StringIsEqual(gesture, _T("U"))) {
    ZoomIn();
    return true;
  }
  if (StringIsEqual(gesture, _T("D"))) {
    ZoomOut();
    return true;
  }
  if (StringIsEqual(gesture, _T("L"))) {
    PrevTarget();
    return true;
  }
  if (StringIsEqual(gesture, _T("R"))) {
    NextTarget();
    return true;
  }
  if (StringIsEqual(gesture, _T("UD"))) {
    SetAutoZoom(true);
    return true;
  }
  if (StringIsEqual(gesture, _T("DR"))) {
    OpenDetails();
    return true;
  }
  if (StringIsEqual(gesture, _T("RL"))) {
    SwitchData();
    return true;
  }

  return false;
}
Ejemplo n.º 6
0
/*----------------------------------------------------------------------
 * FrameMouseWheelCallback (generic callback)
 * is called when the mouse wheel is activated
 * params:
 *   + int frame :
 *   + int thot_mod_mask : what key is currently pressed
 *   [THOT_MOD_CTRL || THOT_MOD_ALT || THOT_MOD_SHIFT]
 *   + int x,y : the mouse position in the frame
 *   + int direction : >0 if wheel up <0 if wheel down
 *   + int delta : wheel delta, normally 120.
 * return:
 *   + TRUE : if the event must be forwarded to other widgets
 *   + FALSE : if the event is cought
 ----------------------------------------------------------------------*/
ThotBool FrameMouseWheelCallback( int frame, int thot_mod_mask,
                                 int direction, int delta,
                                 int x, int y )
{
  Document   document;
  View       view;

  if (direction > 0)
    {
      /* wheel mice up*/
      FrameToView (frame, &document, &view);
      if (thot_mod_mask & THOT_MOD_CTRL)
        /* if CTRL is down then zoom */
        ZoomOut (document, view);	   
      else if (thot_mod_mask & THOT_MOD_SHIFT)
        HorizontalScroll (frame, -39, 1);
      else
        VerticalScroll (frame, -39, 1);
    }
  else
    {
      /* wheel mice down */
      FrameToView (frame, &document, &view); 
      if (thot_mod_mask & THOT_MOD_CTRL)
        /* if CTRL is down then zoom */
        ZoomIn (document, view);
      else if (thot_mod_mask & THOT_MOD_SHIFT)
        HorizontalScroll (frame, 39, 1);          
      else
        VerticalScroll (frame, 39, 1);
    }
  return TRUE;
}
CompositingWidget::CompositingWidget(QWidget* parent) : QWidget(parent), 
                                                        scale_(1.0),
                                                        offset_(0, 0),
                                                        selected_image_idx_(-1) {
  setMinimumSize(WIDGET_SIZE, WIDGET_SIZE);
  setMaximumSize(WIDGET_SIZE, WIDGET_SIZE);
  resize(WIDGET_SIZE, WIDGET_SIZE);
  QPalette pal = palette();
  pal.setColor(backgroundRole(), Qt::black);
  setPalette(pal);
  setAutoFillBackground(true);
  
  setAcceptDrops(true);
  
  QPushButton* zoom_in = new QPushButton("+", this);
  QPushButton* zoom_out = new QPushButton("-", this);
  
  zoom_in->show();
  zoom_out->show();

  zoom_out->setGeometry(10, height() - 15 - zoom_out->height() * 2,
                        zoom_out->width(), zoom_out->height());   
  zoom_in->setGeometry(10, height() - 10 - zoom_in->height(), zoom_in->width(), zoom_in->height());
  
  connect(zoom_in, SIGNAL(clicked()), this, SLOT(ZoomIn()));
  connect(zoom_out, SIGNAL(clicked()), this, SLOT(ZoomOut()));
}
Ejemplo n.º 8
0
//--------------------------------------------------------------------
void InterView::MouseDown(BPoint point)
{
	BMenuItem *selected;
	BPoint cursor;
	uint32 buttons;

	GetMouse(&cursor, &buttons, false);

	if (buttons & B_PRIMARY_MOUSE_BUTTON)
	{
		mouseDown = true;
		mouseCoord = point;
		SetMouseEventMask(B_POINTER_EVENTS,B_LOCK_WINDOW_FOCUS);
//		be_app->SetCursor(B_I_BEAM_CURSOR);
	}

	if (buttons & B_SECONDARY_MOUSE_BUTTON)
	{
		ConvertToScreen(&point);
		selected = menu->Go(point);
		if ( selected && (selected->Message() != NULL))
			if (selected->Message()->what == MSG_ZOOM_IN)
				ZoomIn();
			else if (selected->Message()->what == MSG_ZOOM_OUT)
				ZoomOut();
			else
				msgDest->PostMessage(selected->Message());
 	}

	if (buttons & B_TERTIARY_MOUSE_BUTTON)
	{
		((InterApp*)be_app)->theWin->SwapFullScreenNoMenu();
	}
}
Ejemplo n.º 9
0
void BaseEditor::OnMouseWheelEvt(wxMouseEvent& event)
{
	int lines = -event.GetWheelRotation() / event.GetWheelDelta();

	if (event.ShiftDown())
	{
		int nPos = GetScrollPos(wxHORIZONTAL);
		SetScrollPos(wxHORIZONTAL, nPos + lines * event.GetLinesPerAction() * SCROLL_LINE_DISTANCE);
		UpdateScrollPosition(GetScrollPos(wxHORIZONTAL), GetScrollPos(wxVERTICAL));
	}
	else if (event.ControlDown())
	{
		if (lines < 0)
		{
			ZoomIn();
		}
		else
		{
			ZoomOut();
		}
	}
	else
	{
		int nPos = GetScrollPos(wxVERTICAL);
		SetScrollPos(wxVERTICAL, nPos + lines * event.GetLinesPerAction() * SCROLL_LINE_DISTANCE);
		UpdateScrollPosition(GetScrollPos(wxHORIZONTAL), GetScrollPos(wxVERTICAL));
	}
}
Ejemplo n.º 10
0
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CTFHunterRifle::HandleZooms( void )
{
	// Get the owning player.
	CTFPlayer *pPlayer = ToTFPlayer( GetOwner() );
	if ( !pPlayer )
		return;

	// Handle the zoom when taunting.
	if ( pPlayer->m_Shared.InCond( TF_COND_TAUNTING ) )
	{
		if ( pPlayer->m_Shared.InCond( TF_COND_AIMING ) )
		{
			ToggleZoom();
		}

		//Don't rezoom in the middle of a taunt.
		ResetTimers();
	}

	if ( m_flUnzoomTime > 0 && gpGlobals->curtime > m_flUnzoomTime )
	{
		if ( m_bRezoomAfterShot )
		{
			ZoomOutIn();
			m_bRezoomAfterShot = false;
		}
		else
		{
			ZoomOut();
		}

		m_flUnzoomTime = -1;
	}

	if ( m_flRezoomTime > 0 )
	{
		if ( gpGlobals->curtime > m_flRezoomTime )
		{
            ZoomIn();
			m_flRezoomTime = -1;
		}
	}

	if ( ( pPlayer->m_nButtons & IN_ATTACK2 ) && ( m_flNextSecondaryAttack <= gpGlobals->curtime ) )
	{
		// If we're in the process of rezooming, just cancel it
		if ( m_flRezoomTime > 0 || m_flUnzoomTime > 0 )
		{
			// Prevent them from rezooming in less time than they would have
			m_flNextSecondaryAttack = m_flRezoomTime + TF_WEAPON_HUNTERRIFLE_ZOOM_TIME;
			m_flRezoomTime = -1;
		}
		else
		{
			Zoom();
		}
	}
}
void MazeGraphicsView::wheelEvent(QWheelEvent* event)
{
    if (event->delta() > 0)
        ZoomIn();
    else
        ZoomOut();

    SetupMatrix();
}
Ejemplo n.º 12
0
void BlackHole::Update(float dt){
    if (!updateEn) return;
    
    if (!isZooming){
        BaseCircle::Update(dt);
    }else if (isZooming == ZOOM_OUT){
        ZoomOut(dt);
    }else {
        ZoomIn(dt);
    }
}
Ejemplo n.º 13
0
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
bool CTFWeaponBaseGun::Holster( CBaseCombatWeapon *pSwitchingTo )
{
// Server specific.
#if !defined( CLIENT_DLL )

	// Make sure to zoom out before we holster the weapon.
	ZoomOut();
	SetContextThink( NULL, 0, ZOOM_CONTEXT );

#endif

	return BaseClass::Holster( pSwitchingTo );
}
Ejemplo n.º 14
0
void ZoomablePageView::wheelEvent(QWheelEvent *event)
{
   if(event->modifiers() == Qt::CTRL) {
      if(event->angleDelta().y() > 0) {
         emit ZoomIn();
      } else {
         emit ZoomOut();
      }
      event->accept();
   } else {
      QTableView::wheelEvent(event);
   }
}
Ejemplo n.º 15
0
bool C2DView::OnKeyDown( char *s ){
	if ( ViewState == View_Idle ) {
		if ( !strcmp( s,"Insert" ) ) {
			ZoomOut();
			return true;
		}
		if ( !strcmp( s,"Delete" ) ) {
			ZoomIn();
			return true;
		}
	}
	return false;
}
Ejemplo n.º 16
0
void CIronSight::TurnOff(bool enable, bool smooth, bool anim)
{
	if(!enable && (m_savedFoVScale > 0.0f))
	{
		OnEnterZoom();

		float oFoV = GetZoomFoVScale(0);
		float tFoV = m_savedFoVScale;

		SetActorSpeedScale(0.35f);

		ZoomIn(m_pShared->zoomParams.zoom_out_time, oFoV, tFoV, smooth);

		if(anim)
		{
			if(UseAlternativeIronSight())
				m_pWeapon->SetActionSuffix(m_pShared->zoomParams.suffix_FC.c_str());
			else
				m_pWeapon->SetActionSuffix(m_pShared->zoomParams.suffix.c_str());

			m_pWeapon->PlayAction(m_pShared->actions.zoom_in);
		}

		m_pWeapon->GetScheduler()->TimerAction((uint32)(m_pShared->zoomParams.zoom_out_time*1000), CSchedulerAction<DisableTurnOffAction>::Create(this), false);
		m_savedFoVScale = 0.0f;
	}
	else if(m_zoomed && enable)
	{
		m_pWeapon->SetBusy(true);
		m_savedFoVScale = GetActorFoVScale();

		OnLeaveZoom();

		float oFoV = GetZoomFoVScale(0);
		float tFoV = m_savedFoVScale;

		SetActorSpeedScale(1);
		ZoomOut(m_pShared->zoomParams.zoom_out_time, tFoV, oFoV, smooth);

		m_pWeapon->StopLayer(m_pShared->zoomParams.layer, CItem::eIPAF_Default|CItem::eIPAF_NoBlend);
		m_pWeapon->SetDefaultIdleAnimation(eIGS_FirstPerson, g_pItemStrings->idle);

		if(anim)
		{
			m_pWeapon->PlayAction(m_pShared->actions.zoom_out);
			m_pWeapon->SetActionSuffix("");
		}

		m_pWeapon->GetScheduler()->TimerAction((uint32)(m_pShared->zoomParams.zoom_out_time*1000), CSchedulerAction<EnableTurnOffAction>::Create(this), false);
	}
}
Ejemplo n.º 17
0
LRESULT CDataView::OnKeyDown(TCHAR vk, UINT cRepeat, UINT flags)
{
	switch (vk) {
	case VK_ADD:
	case VK_OEM_PLUS:
		ZoomIn();
		break;
	case VK_SUBTRACT:
	case VK_OEM_MINUS:
		ZoomOut();
		break;
	}
	return 0;
}
Ejemplo n.º 18
0
void CScalableLayout::Notify( TNotifyUI& msg )
{
	if (msg.sType == _T("click"))
	{
		if (msg.pSender == m_pZoomout)
		{
			ZoomOut();
		}
		else
		{
			ZoomIn(msg.pSender->GetName());
		}
	}
}
Ejemplo n.º 19
0
//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CTFHunterRifle::ZoomOutIn( void )
{
	ZoomOut();

	CTFPlayer *pPlayer = GetTFPlayerOwner();
	if ( pPlayer && pPlayer->ShouldAutoRezoom() )
	{
		m_flRezoomTime = gpGlobals->curtime + 0.9;
	}
	else
	{
		m_flNextSecondaryAttack = gpGlobals->curtime + 1.0f;
	}
}
Ejemplo n.º 20
0
void ZoomablePageView::keyPressEvent(QKeyEvent *event)
{
   if(event->modifiers().testFlag(Qt::ControlModifier)) {
      if(event->key() == Qt::Key_Plus) {
         emit ZoomIn();
         event->accept();
      } else if(event->key() == Qt::Key_Minus) {
         emit ZoomOut();
         event->accept();
      }
   }
   if(!event->isAccepted()) {
      QTableView::keyPressEvent(event);
   }
}
Ejemplo n.º 21
0
//-----------------------------------------------------------------------------
// Purpose: 
// Output : Returns true on success, false on failure.
//-----------------------------------------------------------------------------
bool CTFHunterRifle::Reload(void)
{
	if ( BaseClass::Reload() == true )
	{
		if ( IsZoomed() )
			ZoomOut();

		if ( Clip1() > 0 )
			m_iClip1 = 0;

		return true;
	}

	return false;
}
Ejemplo n.º 22
0
LRESULT CScalableLayout::MessageHandler( UINT uMsg, WPARAM wParam, LPARAM lParam, bool& bHandled )
{
	if (uMsg == WM_MOUSEWHEEL)
	{
		WORD fwKeys = LOWORD(wParam);    // key flags
		if (fwKeys != 0)
		{
			return 0;
		}

		short zDelta = (short) HIWORD(wParam);    // wheel rotation

		POINT pt;
		pt.x = (short) LOWORD(lParam);    // horizontal position of pointer
		pt.y = (short) HIWORD(lParam);    // vertical position of pointer

		::ScreenToClient(m_hParentWnd,&pt);

		if (zDelta > 0)
		{
			// zoom in
			CControlUI *pHit = GetManager()->FindControl(pt);

			CButtonUI *pHitButton = dynamic_cast<CButtonUI*>(pHit);
			if (pHitButton == 0)
			{
				return 0;
			}

			ZoomIn(pHitButton->GetName());
		}
		else
		{
			RECT rc = m_pContainer->GetPos();
			if (!::PtInRect(&rc,pt))
			{
				return 0;
			}

			ZoomOut();
		}

		bHandled = TRUE;
		return 0;
	}

	return 0;
}
Ejemplo n.º 23
0
int CRoWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: ZoomIn(); break;
        case 1: ZoomOut(); break;
        case 2: RotateUp(); break;
        case 3: RotateDown(); break;
        default: ;
        }
        _id -= 4;
    }
    return _id;
}
Ejemplo n.º 24
0
  bool HandleMouseEvent(const Lum::OS::MouseEvent& event)
  {
    if (!visible) {
      return false;
    }

    if (event.type==Lum::OS::MouseEvent::down &&
        PointIsIn(event) &&
        event.button==Lum::OS::MouseEvent::button1) {
      requestNewMap=false;
      startLon=lon;
      startLat=lat;
      startX=event.x;
      startY=event.y;
      return true;
    }
    else if (event.IsGrabEnd() &&
             event.button==Lum::OS::MouseEvent::button1) {
      HandleMouseMove(event);
      requestNewMap=true;
      Redraw();
    }
    else if (event.type==Lum::OS::MouseEvent::move &&
             event.IsGrabed() &&
             event.button==Lum::OS::MouseEvent::none &&
             event.qualifier==Lum::OS::qualifierButton1) {
      HandleMouseMove(event);
      Redraw();
      return true;
    }
    else if (event.type==Lum::OS::MouseEvent::down &&
             event.button==Lum::OS::MouseEvent::button4) {
      ZoomIn(1.35);

      return true;
    }
    else if (event.type==Lum::OS::MouseEvent::down &&
             event.button==Lum::OS::MouseEvent::button5) {
      ZoomOut(1.35);

      return true;
    }

    return false;
  }
Ejemplo n.º 25
0
TKeyResponse CAafAppCameraView::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType)
{
	if(aType == EEventKey)
	{
		switch(aKeyEvent.iCode) 
		{
		case EKeyOK:
			{
				if (iContainer)
				{
					if (iContainer->IsImageCaptured())
					{
						iContainer->StartViewFinderL();
					}
					else
					{
						iContainer->CaptureL();
					}
				}
			}
			break;
		case EStdKeyUpArrow:
			{				
				ZoomIn();			

				return EKeyWasConsumed;
			}				
		case EStdKeyDownArrow:
			{
				ZoomOut();

				return EKeyWasConsumed;
			}

			// If not arrow up or arrow down key has been pressed
		default:
			{
				
			}
			break;
		}
	}

	return EKeyWasNotConsumed;
}
Ejemplo n.º 26
0
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
bool CTFSniperRifle::Holster( CBaseCombatWeapon *pSwitchingTo )
{
// Server specific.
#ifdef GAME_DLL
	// Destroy the sniper dot.
	DestroySniperDot();
#endif

	CTFPlayer *pPlayer = ToTFPlayer( GetPlayerOwner() );
	if ( pPlayer && pPlayer->m_Shared.InCond( TF_COND_ZOOMED ) )
	{
		ZoomOut();
	}

	m_flChargedDamage = 0.0f;
	ResetTimers();

	return BaseClass::Holster( pSwitchingTo );
}
Ejemplo n.º 27
0
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
bool CTFHunterRifle::Holster( CBaseCombatWeapon *pSwitchingTo )
{
// Server specific.
#ifdef GAME_DLL
	// Destroy the Hunter dot.

#endif

	CTFPlayer *pPlayer = ToTFPlayer( GetPlayerOwner() );
	if ( pPlayer && pPlayer->m_Shared.InCond( TF_COND_ZOOMED ) )
	{
		ZoomOut();
	}

	m_flChargedSpread = TF_WEAPON_HUNTERRIFLE_SPREAD_MAX;
	ResetTimers();

	return BaseClass::Holster( pSwitchingTo );
}
Ejemplo n.º 28
0
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CTFWeaponBaseGun::ToggleZoom( void )
{
	// Toggle the zoom.
	CBasePlayer *pPlayer = GetPlayerOwner();
	if ( pPlayer )
	{
		if( pPlayer->GetFOV() >= 75 )
		{
			ZoomIn();
		}
		else
		{
			ZoomOut();
		}
	}

	// Get the zoom animation time.
	m_flNextSecondaryAttack = gpGlobals->curtime + 1.2;
}
/**
 * 画像ビューアを開いた状態でマウスホイールを動かした場合のイベント
 */
void JaneCloneImageViewer::OnMouseWheel(wxMouseEvent& event) 
{     
     if (event.m_wheelRotation == 0) return;
     
     if (event.m_controlDown) 
     {
	  // コントロールキーが押されている => 画像の拡大縮小
	  if (event.m_wheelRotation > 0) 
	  {
	       // プラス値 ←
	       ZoomIn();
	       
	  } 
	  else 
	  {
	       // マイナス値 →
	       ZoomOut();
	  }	  
	  
     } 
     else 
     {
	  const int current = thumbnailNoteBook->GetSelection();		    
	  const int max     = thumbnailNoteBook->GetPageCount();

	  // 画像の切り替え
	  if (event.m_wheelRotation > 0) 
	  {
	       // プラス値 ←
	       if (current != 0) thumbnailNoteBook->SetSelection(current - 1);
	  } 
	  else 
	  {
	       // マイナス値 →
	       if (current != max) thumbnailNoteBook->SetSelection(current + 1);
	  }	  
     }

     event.Skip();
}
Ejemplo n.º 30
0
bool
FlarmTrafficControl::on_mouse_gesture(const char* gesture)
{
  if (!XCSoarInterface::SettingsComputer().EnableGestures)
    return false;

  if (strcmp(gesture, "U") == 0) {
    ZoomIn();
    return true;
  }
  if (strcmp(gesture, "D") == 0) {
    ZoomOut();
    return true;
  }
  if (strcmp(gesture, "L") == 0) {
    PrevTarget();
    return true;
  }
  if (strcmp(gesture, "R") == 0) {
    NextTarget();
    return true;
  }
  if (strcmp(gesture, "UD") == 0) {
    SetAutoZoom(true);
    return true;
  }
  if (strcmp(gesture, "DR") == 0) {
    OpenDetails();
    return true;
  }
  if (strcmp(gesture, "RL") == 0) {
    SwitchData();
    return true;
  }

  return false;
}