コード例 #1
0
ファイル: WndNeuz.cpp プロジェクト: careysky/FlyFF
BOOL CWndNeuz::OnSetCursor( CWndBase* pWndBase, UINT nHitTest, UINT message )
{
	if( IsWndStyle( WBS_THICKFRAME ) && ( IsFullMax() == FALSE || m_nWinSize != WSIZE_MAX ) )
	{
		if( m_bLButtonDown == FALSE )
		{
			CPoint point = GetMousePoint();
			ClientToScreen( &point );
			CRect rectWindow = GetWindowRect( TRUE );
			point -= rectWindow.TopLeft();
			int nResizeDir = GetResizeDir( point );
			if( nResizeDir )
			{
				// 1 = top
				// 2 = bottom
				// 3 = left
				// 4 = right
				// 5 = topLeft
				// 6 = topRight
				// 7 = bottomLeft
				// 8 = bottomRigh;
				switch( nResizeDir )
				{
				case 1:
				case 2:
					SetMouseCursor( CUR_RESIZE_VERT );
					break;
				case 3:
				case 4:
					SetMouseCursor( CUR_RESIZE_HORI );
					break;
				case 5:
				case 8:
					SetMouseCursor( CUR_RESIZE_HV1 );
					break;
				case 6:
				case 7:
					SetMouseCursor( CUR_RESIZE_HV2 );
					break;
						
				}
			}
			else
				CWndBase::OnSetCursor( pWndBase, nHitTest, message );
		}
	}
	else
		CWndBase::OnSetCursor( pWndBase, nHitTest, message );

	return TRUE;
}
コード例 #2
0
int FilterMouseMotionEvents(const Event *event)
{
  MotionEvent *motion;

  /* non-motion events are directly passed to event handler functions */
  if (event->type != EVENT_MOTIONNOTIFY)
    return 1;

  motion = (MotionEvent *)event;
  cursor_inside_playfield = (motion->x >= SX && motion->x < SX + SXSIZE &&
			     motion->y >= SY && motion->y < SY + SYSIZE);

  if (game_status == GAME_MODE_PLAYING && playfield_cursor_set)
  {
    SetMouseCursor(CURSOR_DEFAULT);
    playfield_cursor_set = FALSE;
    DelayReached(&playfield_cursor_delay, 0);
  }

  /* skip mouse motion events without pressed button outside level editor */
  if (button_status == MB_RELEASED &&
      game_status != GAME_MODE_EDITOR && game_status != GAME_MODE_PLAYING)
    return 0;
  else
    return 1;
}
コード例 #3
0
ファイル: LayerManager.cpp プロジェクト: John-He-928/krkrz
//---------------------------------------------------------------------------
void tTVPLayerManager::NotifyMouseCursorChange(
	tTJSNI_BaseLayer *layer, tjs_int cursor)
{
	if(InNotifyingHintOrCursorChange) return;

	InNotifyingHintOrCursorChange = true;
	try
	{

		tTJSNI_BaseLayer *l;

		if(CaptureOwner)
			l = CaptureOwner;
		else
			l = GetMostFrontChildAt(LastMouseMoveX, LastMouseMoveY);

		if(l == layer) SetMouseCursor(cursor);
	}
	catch(...)
	{
		InNotifyingHintOrCursorChange = false;
		throw;
	}

	InNotifyingHintOrCursorChange = false;
}
コード例 #4
0
ファイル: util.c プロジェクト: gaorlov/DAAS
void utilG_Init (void (*DiscardPanels)(void))
{
    int p, control, top, height, width;
	int grw, chw, asw, acw;
    

    utilG.acq.pt = 0;
    utilG.acq.nPts = 0;
    utilG.acq.status = ACQ_NONE;

    utilG.p = LoadPanel (0, "utilu.uir", BG);
    
    utilG.DiscardPanels = DiscardPanels;

	SetPanelAttribute (utilG.p, ATTR_WINDOW_ZOOM, VAL_MAXIMIZE);
    DisplayPanel (utilG.p);
	
	GetCtrlAttribute(utilG.p, BG_GRAPHS, ATTR_WIDTH, &grw);
	GetCtrlAttribute(utilG.p, BG_CHANNELS, ATTR_WIDTH, &chw);
	GetCtrlAttribute(utilG.p, BG_ACQSETUP, ATTR_WIDTH, &asw);
	GetCtrlAttribute(utilG.p, BG_ACQCHANNELS, ATTR_WIDTH, &acw);
	GetPanelAttribute(utilG.p, ATTR_WIDTH, &width);
	
	SetCtrlAttribute(utilG.p, BG_GRAPHS, ATTR_LEFT,			(3*width/20) - grw);
	SetCtrlAttribute(utilG.p, BG_CHANNELS, ATTR_LEFT, 		(7*width/20) - chw);
	SetCtrlAttribute(utilG.p, BG_ACQSETUP, ATTR_LEFT, 		(9*width/15) - asw);
	SetCtrlAttribute(utilG.p, BG_ACQCHANNELS, ATTR_LEFT, 	(9*width/10) - acw);
	
	initP = LoadPanel (utilG.p, "utilu.uir", INIT);
    
    SetPanelPos (initP, VAL_AUTO_CENTER, VAL_AUTO_CENTER);

    SetCtrlAttribute (initP, INIT_TEXT, ATTR_VISIBLE, FALSE);
    DisplayPanel (initP);

    GetUserEvent (1, &p, &control);
    switch (control) {
        case INIT_CONTROL: utilG.acq.status = ACQ_DONE; break;
        case INIT_ANALYSIS: utilG.acq.status = ACQ_NONE; break;
        case INIT_EXIT:
            utilG_Exit();
            QuitUserInterface(0);
            exit (EXIT_SUCCESS);
            break;
    }
    SetMouseCursor (VAL_HOUR_GLASS_CURSOR);

    SetCtrlAttribute (initP, INIT_TEXT, ATTR_VISIBLE, TRUE);
    SetCtrlAttribute (initP, INIT_TEXT_10, ATTR_VISIBLE, FALSE);
    SetCtrlAttribute (initP, INIT_CONTROL, ATTR_VISIBLE, FALSE);
    SetCtrlAttribute (initP, INIT_ANALYSIS, ATTR_VISIBLE, FALSE);
    SetCtrlAttribute (initP, INIT_EXIT, ATTR_VISIBLE, FALSE);

    GetCtrlAttribute (initP, INIT_TEXT, ATTR_TOP, &top);
    GetCtrlAttribute (initP, INIT_TEXT, ATTR_HEIGHT, &height);
    SetPanelAttribute (initP, ATTR_HEIGHT, top+height+6);
    util_ChangeInitMessage ("DAAS Utilities...");
}
コード例 #5
0
ファイル: MouseCursor.cpp プロジェクト: harada3/krkrz
void MouseCursor::SetCursor() {
	if( hCursor_ != INVALID_HANDLE_VALUE ) {
		::SetCursor( hCursor_ );
		if( is_cursor_hide_ ) {
			::ShowCursor( TRUE );
			is_cursor_hide_ = false;
		}
	} else if( cursor_index_ != INVALID_CURSOR_INDEX ) {
		SetMouseCursor( cursor_index_ );
	}
}
コード例 #6
0
ファイル: genworld.cpp プロジェクト: a7omic/OpenTTD
/**
 * Clean up the 'mess' of generation. That is, show windows again, reset
 * thread variables, and delete the progress window.
 */
static void CleanupGeneration()
{
	_generating_world = false;

	if (_cursor.sprite == SPR_CURSOR_ZZZ) SetMouseCursor(SPR_CURSOR_MOUSE, PAL_NONE);
	/* Show all vital windows again, because we have hidden them */
	if (_gw.threaded && _game_mode != GM_MENU) ShowVitalWindows();
	_gw.active   = false;
	_gw.proc     = NULL;
	_gw.abortp   = NULL;
	_gw.threaded = false;

	DeleteWindowById(WC_GENERATE_PROGRESS_WINDOW, 0);
	MarkWholeScreenDirty();
}
コード例 #7
0
void ControlPointsWidget::mouseReleaseEvent( QMouseEvent * evnt )
{
    if ( evnt->button() == Qt::LeftButton )
    {
	if ( m_bDragging )
	{
	    QRect rcBounds = m_rcChartPlotArea.adjusted(0,0,1,1);
	    QPoint pt = ClipPoint( rcBounds, evnt->pos() );

	    // Convert screen coordinates back to CPOINT coordinates.
	    m_Points[m_nFocusPoint].lP = SnapX(UnscaleX(pt.x()));
	    m_Points[m_nFocusPoint].dwLog = SnapY(UnscaleY(pt.y()));
	    m_bChanged = true;

	    CalculateWorkingData();
	    update();
	    m_bDragging = false;
	    SetMouseCursor( evnt->pos() );
	    //ReleaseCapture();
	}
    }
}
コード例 #8
0
void MouseCursor::SetCursor() {
	if( cursor_index_ != INVALID_CURSOR_INDEX ) {
		SetMouseCursor( cursor_index_ );
	}
}
コード例 #9
0
ファイル: nuiZoomBar.cpp プロジェクト: JamesLinus/nui3
void nuiZoomBar::ChangeZoomCursor(nuiSize coord, nuiSize DownLimit, nuiSize UpLimit)
{
  if (coord > DownLimit + mThumbSideSize && coord < UpLimit - mThumbSideSize) // Hover Center
  {
    SetMouseCursor(eCursorHand);
  }
  
  else if (coord >= DownLimit && coord < DownLimit + mThumbSideSize ) //Hover Left Handler
  {
    if (mpRange->GetPageSize() == mPageSizeMin)
    {
      if (mOrientation == nuiHorizontal)
        SetMouseCursor(eCursorResizeW);
      else if (mOrientation == nuiVertical)
        SetMouseCursor(eCursorResizeS);
    }
    else if (mpRange->GetValue() == mpRange->GetMinimum() && mpRange->GetPageSize() == mpRange->GetRange())
    {
      if (mOrientation == nuiHorizontal)
        SetMouseCursor(eCursorResizeE);
      else if (mOrientation == nuiVertical)
        SetMouseCursor(eCursorResizeN);
    }
    else if (mpRange->GetValue() == mpRange->GetMinimum() && !IsUnZoomAfterBoundEnabled())
    {
      if (mOrientation == nuiHorizontal)
        SetMouseCursor(eCursorResizeE);
      else if (mOrientation == nuiVertical)
        SetMouseCursor(eCursorResizeN);
    }
    else
    {
      if (mOrientation == nuiHorizontal)
        SetMouseCursor(eCursorResizeWE);
      else if (mOrientation == nuiVertical)
        SetMouseCursor(eCursorResizeNS);
    }
  
  }
  else if (coord <= UpLimit && coord > UpLimit - mThumbSideSize) //Hover Right Handler
  {
    if (mpRange->GetPageSize() == mPageSizeMin)
    {
      if (mOrientation == nuiHorizontal)
        SetMouseCursor(eCursorResizeE);
      else if (mOrientation == nuiVertical)
        SetMouseCursor(eCursorResizeN);
    }
    else if (mpRange->GetValue() == mpRange->GetMinimum() && mpRange->GetPageSize() == mpRange->GetRange())
    {
      if (mOrientation == nuiHorizontal)
        SetMouseCursor(eCursorResizeW);
      else if (mOrientation == nuiVertical)
        SetMouseCursor(eCursorResizeS);
    }
    else if (mpRange->GetValue() + mpRange->GetPageSize() == mpRange->GetMaximum() && !IsUnZoomAfterBoundEnabled())
    {
      if (mOrientation == nuiHorizontal)
        SetMouseCursor(eCursorResizeW);
      else if (mOrientation == nuiVertical)
        SetMouseCursor(eCursorResizeS);
    }
    else
    {
      if (mOrientation == nuiHorizontal)
        SetMouseCursor(eCursorResizeWE);
      else if (mOrientation == nuiVertical)
        SetMouseCursor(eCursorResizeNS);
    }
  }
    else
    {
      SetMouseCursor(eCursorArrow);
    }
  
}
コード例 #10
0
void ControlPointsWidget::mouseMoveEvent ( QMouseEvent * evnt )
{
    QPoint pt = evnt->pos();

    if ( !m_bDragging )
    {
	SetMouseCursor( pt );
    }
    else
    {
	QRect rcBounds = m_rcChartPlotArea.adjusted(0,0,1,1);
	if ( !rcBounds.contains(pt) )
	{
	    // Cursor trying to move out of area
	    pt = ClipPoint( rcBounds, pt );
	}

	// Invalidate the rectangle that bounds the old point and joining line segments.
	//int x = ScaleX(m_Points[m_nFocusPoint].lP);
	//int y = ScaleY(m_Points[m_nFocusPoint].dwLog);
	//x += m_ptDragOffset.x;
	//y += m_ptDragOffset.y;
	//x = SnapScreenX(x);
	//y = SnapY(y);
	int x = ScaleX(m_ptDragCPoint.x());
	int y = ScaleY(m_ptDragCPoint.y());

	QRect rcInvalid;
	if ( m_nFocusPoint == 0 )
	{
	    int x1 = ScaleX(m_Points[1].lP);
	    int y1 = ScaleY(m_Points[1].dwLog);
	    QRect rc1(x-3,y-3,x+3,y+3 );
	    QRect rc2(x1-3,y1-3,x1+3,y1+3 );

	    rc1 = rc1.normalized();
	    rc2 = rc2.normalized();

	    rc1.adjust(-1,-1,1,1);
	    rc2.adjust(-1,-1,1,1);
	    rcInvalid = rc1.united( rc2 );
	}
	else if ( m_nFocusPoint == (int)m_Points.size()-1 )
	{
	    int x1 = ScaleX(m_Points[m_nFocusPoint-1].lP);
	    int y1 = ScaleY(m_Points[m_nFocusPoint-1].dwLog);

	    QRect rc1(x-3,y-3,x+3,y+3 );
	    QRect rc2(x1-3,y1-3,x1+3,y1+3 );

	    rc1 = rc1.normalized();
	    rc2 = rc2.normalized();

	    rc1.adjust(-1,-1,1,1);
	    rc2.adjust(-1,-1,1,1);
	    rcInvalid = rc1.united( rc2 );
	}
	else
	{
	    QRect rc1(x-3,y-3,x+3,y+3 );
	    rc1 = rc1.normalized();
	    rc1.adjust(-1,-1,1,1);

	    int x1 = ScaleX(m_Points[m_nFocusPoint-1].lP);
	    int y1 = ScaleY(m_Points[m_nFocusPoint-1].dwLog);
	    QRect rc2(x1-3,y1-3,x1+3,y1+3 );
	    rc2 = rc2.normalized();
	    rc2.adjust(-1,-1,1,1);

	    x1 = ScaleX(m_Points[m_nFocusPoint+1].lP);
	    y1 = ScaleY(m_Points[m_nFocusPoint+1].dwLog);
	    QRect rc3(x1-3,y1-3,x1+3,y1+3 );
	    rc3 = rc3.normalized();
	    rc3.adjust(-1,-1,1,1);

	    QRect temp;
	    temp = rc1.united(rc2);
	    rcInvalid = temp.united( rc3 );
	}

	// Update the drag offset.  This will be repainted in the paint routine.
	//m_ptDragOffset = pt - m_ptDragPickup;
	m_ptDragCPoint.setX( SnapX(UnscaleX(pt.x())) );
	m_ptDragCPoint.setY( SnapY(UnscaleY(pt.y())) );
	update( rcInvalid );
    }

    //CRect rcBounds(m_rcChartPlotArea.left, m_rcChartPlotArea.top, m_rcChartPlotArea.right+1, m_rcChartPlotArea.bottom + 1 );
    //if ( rcBounds.PtInRect(pt) )
    //{
    //	int x = UnscaleX( SnapScreenX(pt.x ));
    //	int y = UnscaleY( SnapY(pt.y ));
    //	TRACE("%d, %d\n", x, y );
    //}


    if ( m_rcChartPlotArea.contains( pt ) )
	emit mousePositionChanged( SnapX(UnscaleX(pt.x())), SnapX(UnscaleY(pt.y())) );
}
コード例 #11
0
void EventLoop(void)
{
  while (1)
  {
    if (PendingEvent())		/* got event */
    {
      Event event;

      while (NextValidEvent(&event))
      {
  	switch (event.type)
  	{
  	  case EVENT_BUTTONPRESS:
  	  case EVENT_BUTTONRELEASE:
  	    HandleButtonEvent((ButtonEvent *) &event);
  	    break;
  
  	  case EVENT_MOTIONNOTIFY:
  	    HandleMotionEvent((MotionEvent *) &event);
  	    break;
  
  	  case EVENT_KEYPRESS:
  	  case EVENT_KEYRELEASE:
  	    HandleKeyEvent((KeyEvent *) &event);
  	    break;
  
  	  default:
  	    HandleOtherEvents(&event);
  	    break;
  	}
      }
    }
    else
    {
      /* when playing, display a special mouse pointer inside the playfield */
      if (game_status == GAME_MODE_PLAYING && !tape.pausing)
      {
	if (!playfield_cursor_set && cursor_inside_playfield &&
	    DelayReached(&playfield_cursor_delay, 1000))
	{
	  SetMouseCursor(CURSOR_PLAYFIELD);
	  playfield_cursor_set = TRUE;
	}
      }
      else if (playfield_cursor_set)
      {
	SetMouseCursor(CURSOR_DEFAULT);
	playfield_cursor_set = FALSE;
      }

      HandleNoEvent();
    }

    /* don't use all CPU time when idle; the main loop while playing
       has its own synchronization and is CPU friendly, too */

    if (game_status == GAME_MODE_PLAYING)
    {
      HandleGameActions();
    }
    else
    {
      SyncDisplay();
      if (!PendingEvent())	/* delay only if no pending events */
	Delay(10);
    }

    /* refresh window contents from drawing buffer, if needed */
    BackToFront();

    if (game_status == GAME_MODE_QUIT)
      return;
  }
}
コード例 #12
0
ファイル: WndDialog.cpp プロジェクト: iceberry/flyffsf
void CWndDialog::OnMouseWndSurface( CPoint point )
{
	int i; for( i = 0; i < m_nWordButtonNum; i++ )
		m_aWordButton[ i ].bStatus = FALSE;
	for( i = 0; i < m_nKeyButtonNum; i++ )
		m_aKeyButton[ i ].bStatus = FALSE;
	for( i = 0; i < m_nContextButtonNum; i++ )
		m_aContextButton[ i ].bStatus = FALSE;
	if( m_bWordButtonEnable )
	{
		for( i = 0; i < m_nWordButtonNum; i++ )
		{
			if( m_aWordButton[ i ].rect.PtInRect( point ) )
			{
				SetMouseCursor( CUR_SELECT );
			 	m_aWordButton[ i ].bStatus = TRUE;
				return;
			}
		}
	}
	for( i = 0; i < m_nKeyButtonNum; i++ )
	{
		WORDBUTTON* pKeyButton = &m_aKeyButton[ i ];
		if( pKeyButton->rect.PtInRect( point ) )
		{
			SetMouseCursor( CUR_SELECT );
			pKeyButton->bStatus = TRUE;
			CString string;// = prj.GetWordToolTip( pKeyButton->text );
			string.Format( prj.GetText(TID_GAME_ABOUTQUESTION), pKeyButton->szWord );
			if( string.IsEmpty() == FALSE )
			{
				CRect rect = pKeyButton->rect;
				ClientToScreen( &rect );

				CPoint point2 = point;
				ClientToScreen( &point2 );
				rect.InflateRect( 2, 2);
				int nLang	= GetLanguage();
				switch( nLang )
				{
					case LANG_GER:
					case LANG_FRE:
						break;
					default:
						g_toolTip.PutToolTip( (DWORD)pKeyButton, string, &rect, point2 );
						break;
				}
			}
			return;
		}
	}
	CString strWord, strOriginal;
	for( i = 0; i < m_nContextButtonNum; i++ )
	{
		DWORD dwColor = 0xff101010;
		WORDBUTTON* pKeyButton = &m_aContextButton[ i ];
		if( pKeyButton->rect.PtInRect( point ) )
		{
			SetMouseCursor( CUR_HELP );
			pKeyButton->bStatus = TRUE;
			CRect rect = pKeyButton->rect;
			ClientToScreen( &rect );

			CPoint point2 = point;
			ClientToScreen( &point2 );
			rect.InflateRect( 2, 2);

			return;
		}
	}
	SetMouseCursor( CUR_BASE );
}
コード例 #13
0
ファイル: nuiWindow.cpp プロジェクト: JamesLinus/nui3
bool nuiWindow::MouseMoved(nuiSize X, nuiSize Y)
{
  nuiSize dx, dy;

  LocalToLocal(GetParent(), X, Y);
  dx = X - mClickX;
  dy = Y - mClickY;

  if (mMoving == ePreMove)
  {
    if (abs((int)dx) > WINDOW_MINIMOVE || abs((int)dy) > WINDOW_MINIMOVE)
    {
      mMoving = eMove;
      SetAlpha(0.5f);
    }
    else
      return true;
  }

  mClickX = X;
  mClickY = Y;

  if (mMoving == eMove)
  {
    nuiRect wRect = GetIdealRect();
    wRect.RoundToNearest();
    nuiRect woriginal = wRect;

    switch (mClickPos)
    {
    case nuiCenter:
      {
        wRect.Move(dx, dy);
      }
      break;
    case nuiTopLeft:
      {
        wRect.mTop += dy;
        wRect.mLeft += dx;
        if (wRect.GetHeight() < mMinimumHeight)
          wRect.mTop += wRect.GetHeight() - mMinimumHeight;
        if (wRect.GetWidth() < mMinimumWidth)
          wRect.mLeft += wRect.GetWidth() - mMinimumWidth;
      }
      break;
    case nuiBottomLeft:
      {
        wRect.mBottom += dy;
        wRect.mLeft += dx;
        if (wRect.GetHeight() < mMinimumHeight)
          wRect.SetSize(wRect.GetWidth(), mMinimumHeight);
        if (wRect.GetWidth() < mMinimumWidth)
          wRect.mLeft += wRect.GetWidth() - mMinimumWidth;
      }
      break;
    case nuiLeft:
      {
        wRect.mLeft += dx;
        if (wRect.GetWidth() < mMinimumWidth)
          wRect.mLeft += wRect.GetWidth() - mMinimumWidth;
      }
      break;
    case nuiTopRight:
      {
        wRect.mTop += dy;
        wRect.mRight += dx;
        if (wRect.GetHeight() < mMinimumHeight)
          wRect.mTop += wRect.GetHeight() - mMinimumHeight;
        if (wRect.GetWidth() < mMinimumWidth)
          wRect.SetSize(mMinimumWidth, wRect.GetHeight());
      }
      break;
    case nuiBottomRight:
      {
        wRect.mBottom += dy;
        wRect.mRight += dx;
        if (wRect.GetWidth() < mMinimumWidth)
          wRect.SetSize(mMinimumWidth, wRect.GetHeight());
        if (wRect.GetHeight() < mMinimumHeight)
          wRect.SetSize(wRect.GetWidth(), mMinimumHeight);
      }
      break;
    case nuiRight:
      {
        wRect.mRight += dx;
        if (wRect.GetWidth() < mMinimumWidth)
          wRect.SetSize(mMinimumWidth, wRect.GetHeight());
      }
      break;
    case nuiTop:
      {
        wRect.mTop += dy;
        if (wRect.GetHeight() < mMinimumHeight)
          wRect.mTop += wRect.GetHeight() - mMinimumHeight;
      }
      break;
    case nuiBottom:
      {
        wRect.mBottom += dy;
        if (wRect.GetHeight() < mMinimumHeight)
          wRect.SetSize(wRect.GetWidth(), mMinimumHeight);
      }
      break;
    default:
      return true;
      break;
    }

    wRect.RoundToNearest();
    if (mpManager)
      mpManager->ValidateWindowRect(wRect);
    
    if (GetRect().GetWidth() == wRect.GetWidth() && GetRect().GetHeight() == wRect.GetHeight())
      SetUserPos(wRect.mLeft, wRect.mTop);
    else
      SetUserRect(wRect);

   return true;
  }
  else
  {
    if (IsInsideFromParent(X,Y))
    {
      nuiRect _Rect = GetRect();
      _Rect.Transform(GetMatrix());
      nuiTheme* pTheme = GetTheme();
      NGL_ASSERT(pTheme);
      mClickPos= pTheme->GetWindowPart(_Rect, X, Y, GetFlags(), false);
      pTheme->Release();

      SetMouseCursor(eCursorDoNotSet);

      switch (mClickPos)
      {
      case nuiCenter:
        if (!mNoMove)
          SetMouseCursor(eCursorHand);
        break;
      case nuiTopLeft:
        if (!mNoResize)
          SetMouseCursor(eCursorResizeNW);
        break;
      case nuiBottomLeft:
        if (!mNoResize)
          SetMouseCursor(eCursorResizeSW);
        break;
      case nuiLeft:
        if (!mNoResize)
          SetMouseCursor(eCursorResizeW);
        break;
      case nuiTopRight:
        if (!mNoResize)
          SetMouseCursor(eCursorResizeNE);
        break;
      case nuiBottomRight:
        if (!mNoResize)
          SetMouseCursor(eCursorResizeSE);
        break;
      case nuiRight:
        if (!mNoResize)
          SetMouseCursor(eCursorResizeE);
        break;
      case nuiTop:
        if (!mNoResize)
          SetMouseCursor(eCursorResizeN);
        break;
      case nuiBottom:
        if (!mNoResize)
          SetMouseCursor(eCursorResizeS);
        break;
      default:
        break;
      }
    }
  }

  return true; // Always block mouse event that are not from this window
}
コード例 #14
0
ファイル: LayerManager.cpp プロジェクト: John-He-928/krkrz
//---------------------------------------------------------------------------
void tTVPLayerManager::PrimaryMouseMove(tjs_int x, tjs_int y, tjs_uint32 flags)
{
	bool poschanged = (LastMouseMoveX != x || LastMouseMoveY != y);
	LastMouseMoveX = x;
	LastMouseMoveY = y;

	tTJSNI_BaseLayer *l;

	if(CaptureOwner)
		l = CaptureOwner;
	else
		l = GetMostFrontChildAt(x, y);

	// enter/leave event
	if(LastMouseMoveSent != l)
	{
		if(LastMouseMoveSent) LastMouseMoveSent->FireMouseLeave();

		// recheck l because the layer may become invalid during
		// FireMouseLeave call.
		if(CaptureOwner)
			l = CaptureOwner;
		else
			l = GetMostFrontChildAt(x, y);

		if(l)
		{
			InNotifyingHintOrCursorChange = true;
			try
			{
				tTJSNI_BaseLayer *ll;

				l->FireMouseEnter();

				// recheck l because the layer may become invalid during
				// FireMouseEnter call.
				if(CaptureOwner)
					ll = CaptureOwner;
				else
					ll = GetMostFrontChildAt(x, y);

				if(l != ll)
				{
					l->FireMouseLeave();
					l = ll;
					if(l) l->FireMouseEnter();
				}

				// note: rechecking is done only once to avoid infinite loop

				if(l) l->SetCurrentCursorToWindow();
				if(l) l->SetCurrentHintToWindow();
			}
			catch(...)
			{
				InNotifyingHintOrCursorChange = false;
				throw;
			}
			InNotifyingHintOrCursorChange = false;
		}

		if(!l)
		{
			SetMouseCursor(0);
			SetHint(NULL,ttstr());
		}
	}

	if(LastMouseMoveSent != l)
	{
		if(LastMouseMoveSent)
		{
			tTJSNI_BaseLayer *lay = LastMouseMoveSent;
			LastMouseMoveSent = NULL;
			if(lay->Owner) lay->Owner->Release();
		}

		LastMouseMoveSent = l;


		if(LastMouseMoveSent)
		{
			if(LastMouseMoveSent->Owner) LastMouseMoveSent->Owner->AddRef();
		}
	}

	if(l)
	{
		if(poschanged)
		{
			l->FromPrimaryCoordinates(x, y);
			l->FireMouseMove(x, y, flags);
		}
	}
	else
	{
		// no layer to send the event
	}
}
コード例 #15
0
ファイル: WndCredit.cpp プロジェクト: iceberry/flyffsf
void CWndCredit::OnInitialUpdate() 
{ 
	CWndNeuz::OnInitialUpdate(); 
	
	// 모래시계로 커서 변경
	SetMouseCursor( CUR_DELAY );
	// 여기에 코딩하세요
	{
		CResFile file; 

		CString strfile;
#ifdef __FOR_PROLOGUE_UPDATE
		if( ::GetLanguage() != LANG_KOR )
			strfile = MakePath( "Theme\\", ::GetLanguage(), _T( "Openning.inc" ) );
#else //__FOR_PROLOGUE_UPDATE		
		if( ::GetLanguage() == LANG_JAP )
			strfile = "Theme\\Japanese\\Openning.inc";
#endif //__FOR_PROLOGUE_UPDATE
		else
			strfile = "credit.txt";
		
		if( file.Open( strfile.GetBuffer(0), "rb" ) )
		{
			int nLength = file.GetLength();
			TCHAR* pChar = new TCHAR[ nLength + 1];
			file.Read( pChar, nLength );
			pChar[ nLength ] = 0;
			TCHAR* prog = pChar;
			m_strArray.RemoveAll();
		//	while( ( *prog > 0 && *prog <= 0x20 ) && *prog ) 
		//		prog++;
			while( *prog != '\0' )
			{
				TCHAR szString[ 256 ];
				TCHAR* temp = szString;
				while( *prog && ( *prog > 0 && *prog <= 0x20 ) && *prog != '\r' && *prog != '\0' ) 
					prog++;
				while( *prog!='\r' && *prog!='\0' ) 
					*temp++ = *prog++;
				if( *prog == '\r')
					prog++; // skim comma
				// white space를 스킵
				if( temp != szString )
				{
					temp--;
					while( ( *temp > 0 && *temp <= 0x20 ) && *temp ) 
						temp--;
					temp++;
				}
				*temp = '\0';

				m_strArray.Add( szString );

			}
			safe_delete( pChar );
		}
	}
	m_timerScreenShot.Set( SEC( 10 ) );

	if( ::GetLanguage() == LANG_JAP )
	{
		int i; for( i = 0; i < MAX_SCREENSHOT_JAP; i++ )
		{
			CString string;
			string.Format( "shotCredit%02d.dds", i );
			//string = "shotCredit20.dds";
			
			m_aTexScreenShot[ i ].LoadTexture( m_pApp->m_pd3dDevice, MakePath( "Theme\\Japanese\\", string ), 0xffff00ff );
			
			m_aTexScreenShot[ i ].m_size = CSize( 598 + 76, 337 );
		}
	}
	else
	{
		int i; for( i = 0; i < MAX_SCREENSHOT; i++ )
		{
			CString string;
			string.Format( "shotCredit%02d.dds", i );
			//string = "shotCredit20.dds";
			
			m_aTexScreenShot[ i ].LoadTexture( m_pApp->m_pd3dDevice, MakePath( "Theme\\", string ), 0xffff00ff );
			
			m_aTexScreenShot[ i ].m_size = CSize( 598 + 76, 337 );
		}
	}
		
	//LoadScreenShot();

	//m_pFont->RestoreDeviceObjects();//>InvalidateDeviceObjects();
	//m_mapFont.SetAt( _T( "Arial Black9"), pFont );
	// 윈도를 중앙으로 옮기는 부분.
	CRect rectRoot = m_pWndRoot->GetLayoutRect();
	CRect rectWindow = GetWindowRect();
	CPoint point( rectRoot.right - rectWindow.Width(), 110 );
	Move( point );
	MoveParentCenter();

	if( ::GetLanguage() == LANG_JAP )
	{
		CString filename = MakePath( DIR_SOUND, "VocThePrologue.WAV" );
		g_SoundMng.Play( filename.GetBuffer(0), NULL, NULL, FALSE );
		m_pSound = g_SoundMng.GetSound( filename.GetBuffer(0) );
		m_fOldMusicVolume = GetVolume();
		
		if(m_fOldMusicVolume && m_fOldMusicVolume >= 0.04f)
			SetVolume(0.04f);

		m_Starttimer.Set( SEC( 9 ) );
		m_bPlayVoice = FALSE;
	}
} 
コード例 #16
0
ファイル: util.c プロジェクト: gaorlov/DAAS
void util_RemoveInitMessage (void)
{
    SetMouseCursor (VAL_DEFAULT_CURSOR);
    
    DiscardPanel (initP);
}