当前位置: 首页>>代码示例>>C++>>正文


C++ UpdateCursor函数代码示例

本文整理汇总了C++中UpdateCursor函数的典型用法代码示例。如果您正苦于以下问题:C++ UpdateCursor函数的具体用法?C++ UpdateCursor怎么用?C++ UpdateCursor使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了UpdateCursor函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: UpdateCursor

bool Interactor2DMeasure::ProcessMouseMoveEvent( QMouseEvent* event, RenderView* renderview )
{
  RenderView2D* view = ( RenderView2D* )renderview;

  if ( m_bDrawing )
  {
    UpdateCursor( event, view );
    int posX = event->x();
    int posY = event->y();

//    LayerCollection* lc = MainWindow::GetMainWindowPointer()->GetLayerCollection( m_strLayerTypeName.c_str() );
//    LayerVolumeBase* mri = ( LayerVolumeBase* )lc->GetActiveLayer();

    if ( m_region )
    {
      if ( m_nAction == MM_Line )
      {
        ((Region2DLine*)m_region)->SetPoint2( posX, posY );
      }
      else if ( m_nAction == MM_Spline || m_nAction == MM_Polyline )
      {
        ((Region2DPolyline*)m_region)->UpdatePoint( -1, posX, posY );
      }
      else if ( m_nAction == MM_Rectangle )
      {
        ((Region2DRectangle*)m_region)->SetBottomRight( posX, posY );
      }
      view->RequestRedraw();
    }

    return false;
  }
  else if ( m_bEditing )
  {
    UpdateCursor( event, view );
    int offsetX = event->x() - m_nMousePosX;
    int offsetY = event->y() - m_nMousePosY;
    if ( m_region )
    {
      m_nMousePosX = event->x();
      m_nMousePosY = event->y();
      if ( m_nPointIndex >= 0 )
      {
        m_region->UpdatePoint( m_nPointIndex, m_nMousePosX, m_nMousePosY );
      }
      else
      {
        m_region->Offset( offsetX, offsetY );
      }
      view->RequestRedraw();
    }

    return false;
  }
  else
  {
    return Interactor2D::ProcessMouseMoveEvent( event, renderview );
  }
}
开发者ID:CBoensel,项目名称:freesurfer,代码行数:59,代码来源:Interactor2DMeasure.cpp

示例2: _SetTransformBox

// _SetMode
void
PathManipulator::_SetMode(uint32 mode)
{
	if (fMode != mode) {
//printf("switching mode: %s -> %s\n", string_for_mode(fMode), string_for_mode(mode));
		fMode = mode;

		if (fMode == TRANSFORM_POINTS) {
			_SetTransformBox(new TransformPointsBox(fCanvasView,
													this,
													fPath,
													fSelection->Items(),
													fSelection->CountItems()));
//			fCanvasView->Perform(new EnterTransformPointsCommand(this,
//														  fSelection->Items(),
//														  fSelection->CountItems()));
		} else {
			if (fTransformBox)
				_SetTransformBox(NULL);
		}

		if (BWindow* window = fCanvasView->Window()) {
			window->PostMessage(MSG_UPDATE_SHAPE_UI);
		}
		UpdateCursor();
	}
}
开发者ID:mariuz,项目名称:haiku,代码行数:28,代码来源:PathManipulator.cpp

示例3: UpdateCursor

void CChildView::OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags) 
{
  if (theApp.m_map.IsEmpty()) goto mend;
  UpdateCursor();
mend:	
	CWnd ::OnKeyUp(nChar, nRepCnt, nFlags);
}
开发者ID:cosmicflame,项目名称:tmviewer,代码行数:7,代码来源:ChildView.cpp

示例4: UpdateCursor

void NEO::Screen::ColocarCursor(uint8_t x, uint8_t y)
{
	cursor_x=x;
	cursor_y=y;
	
	UpdateCursor();
}
开发者ID:maldad,项目名称:NEOOS_KERNEL,代码行数:7,代码来源:NEO_Screen.cpp

示例5: UpdateCursor

bool Interactor2DVolumeEdit::ProcessKeyDownEvent( QKeyEvent* event, RenderView* renderview )
{
  UpdateCursor( event, renderview );

  RenderView2D* view = ( RenderView2D* )renderview;
  if ( event->modifiers() & Qt::AltModifier && event->key() == Qt::Key_H )
  {
    Contour2D* c2d = view->GetContour2D();
    c2d->SetVisible( !c2d->IsVisible() );
    view->RequestRedraw();
    return false;
  }
  else if (event->modifiers() & Qt::ShiftModifier && event->key() == Qt::Key_C)
  {
    m_bColorPicking = true;
    return false;
  }
  else if (event->key() == Qt::Key_Escape)
  {
    m_bColorPicking = false;
    return false;
  }

  if ( !m_bEditing )
  {
    return Interactor2D::ProcessKeyDownEvent( event, renderview );
  }
  else
  {
    return false;
  }
}
开发者ID:ewong718,项目名称:freesurfer,代码行数:32,代码来源:Interactor2DVolumeEdit.cpp

示例6: XGrabPointer

int
XGrabPointer(
    Display *display,
    Window grab_window,
    Bool owner_events,
    unsigned int event_mask,
    int pointer_mode,
    int keyboard_mode,
    Window confine_to,
    Cursor cursor,
    Time time)
{
    ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
	    Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));

    display->request++;
    tsdPtr->grabWinPtr = (TkWindow *) Tk_IdToWindow(display, grab_window);
    tsdPtr->restrictWinPtr = NULL;
    TkpSetCapture(tsdPtr->grabWinPtr);
    if (TkPositionInTree(tsdPtr->lastWinPtr, tsdPtr->grabWinPtr)
	    != TK_GRAB_IN_TREE) {
	UpdateCursor(tsdPtr->grabWinPtr);
    }
    return GrabSuccess;
}
开发者ID:aosm,项目名称:tcl,代码行数:25,代码来源:tkPointer.c

示例7: UpdateCursor

/**
 * @brief Sets the cursor via software
 * @param x The position of X
 * @param y The position of y
 * */
void ND::Screen::SetCursor(uint8_t x, uint8_t y)
{
	cursor_x=x;
	cursor_y=y;
	
	UpdateCursor();
}
开发者ID:gitter-badger,项目名称:next-divel,代码行数:12,代码来源:ND_Screen.cpp

示例8: GetAttr

/// @todo Implement
void
Console::Erase(EraseDirection d, bool line)
{
	const uint16_t attr = GetAttr(0);
	if (line) {
		switch(d) {
			case FORWARD:
				break;
			case BACKWARD:
				break;
			case BOTH:
				break;
		}
	} else {
		switch(d) {
			case FORWARD:
				break;
			case BACKWARD:
				break;
			case BOTH: {
				_canvas.Fill(attr);
				_cursor = _canvas.Buffer();
				UpdateCursor();

				Invalidate();
				break;
			}
		}
	}
}
开发者ID:vshymanskyy,项目名称:TurtlOS,代码行数:31,代码来源:Console.cpp

示例9: UpdateCursor

void
Console::PrintChar (char c)
{
	if (AnsiEscFilter(c)) {
		UpdateCursor();
		return;
	}
	switch(c) {
		case '\n': PutNewLine(); break;
		case '\t': PutTab(); break;
		case '\r': PutReturn(); break;
		case '\b': PutBackspace(); break;
		default: PutChar(c); break;
	}
	UpdateCursor();
}
开发者ID:vshymanskyy,项目名称:TurtlOS,代码行数:16,代码来源:Console.cpp

示例10: UpdateCursor

bool Interactor2DVolumeEdit::ProcessMouseUpEvent( QMouseEvent* event, RenderView* renderview )
{
// RenderView2D* view = ( RenderView2D* )renderview;
  UpdateCursor( event, renderview );

  if ( m_bEditing )
  {
    m_nMousePosX = event->x();
    m_nMousePosY = event->y();

    if ( event->button() != Qt::LeftButton ||
         (m_nAction != EM_Polyline && m_nAction != EM_Livewire ) ||
         m_dPolylinePoints.size() == 0 )
    {
      m_bEditing = false;
    }

    LayerCollection* lc = MainWindow::GetMainWindow()->GetLayerCollection( m_strLayerTypeName );
    LayerVolumeBase* mri = ( LayerVolumeBase* )lc->GetActiveLayer();
//   mri->SendBroadcast( "LayerEdited", mri );

    return false;
  }
  else
  {
    return Interactor2D::ProcessMouseUpEvent( event, renderview );
  }
}
开发者ID:CBoensel,项目名称:freesurfer,代码行数:28,代码来源:Interactor2DVolumeEdit.cpp

示例11: HostMain

//*****************************************************************************
//
// This is the main loop that runs the application.
//
//*****************************************************************************
void
HostMain(void)
{
    switch(iUSBState)
    {
        //
        // This state is entered when the mouse is first detected.
        //
        case eStateMouseInit:
        {
            //
            // Initialize the newly connected mouse.
            //
            USBHMouseInit(g_psMouseInstance);

            //
            // Proceed to the mouse connected state.
            //
            iUSBState = eStateMouseConnected;

            //
            // Update the status on the screen.
            //
            UpdateStatus(0, 0, true);

            //
            // Update the cursor on the screen.
            //
            UpdateCursor(GrContextDpyWidthGet(&g_sContext) / 2,
                         GrContextDpyHeightGet(&g_sContext)/ 2);

            break;
        }
        case eStateMouseConnected:
        {
            //
            // Nothing is currently done in the main loop when the mouse
            // is connected.
            //
            break;
        }
        case eStateNoDevice:
        {
            //
            // The mouse is not connected so nothing needs to be done here.
            //
            break;
        }
        default:
        {
            break;
        }
    }

    //
    // Periodically call the main loop for the Host controller driver.
    //
    USBHCDMain();
}
开发者ID:AlexGeControl,项目名称:tiva-c,代码行数:64,代码来源:usb_host_mouse.c

示例12: UpdateCursor

bool Interactor2DNavigate::ProcessMouseUpEvent( QMouseEvent* event, RenderView* renderview )
{
  UpdateCursor( event, renderview );

  m_bEditing = false;

  return Interactor2D::ProcessMouseUpEvent( event, renderview );
}
开发者ID:CBoensel,项目名称:freesurfer,代码行数:8,代码来源:Interactor2DNavigate.cpp

示例13: MoveCursor

  void MoveCursor() {
    if (cursor >= _tcslen(buffer))
      buffer[cursor + 1] = 0;

    lettercursor = FindEntryLetter(ToUpperASCII(buffer[cursor]));

    UpdateCursor();
  }
开发者ID:Exadios,项目名称:xcsoar-exp,代码行数:8,代码来源:KnobTextEntry.cpp

示例14: UpdateCursor

void CDragVirtualListCtrl::OnMouseMove(UINT nFlags, CPoint point) 
{
	if (m_Dragging) {
		UpdateCursor(point);
		AutoScroll(point);
	}
	CListCtrl::OnMouseMove(nFlags, point);
}
开发者ID:victimofleisure,项目名称:FFRend,代码行数:8,代码来源:DragVirtualListCtrl.cpp

示例15: UpdateCursor

void EditFrame::SetGeomMode(EnumGeomMode geomMode)
{
	if(m_GeomMode != geomMode)
	{
		m_GeomMode = geomMode;
		UpdateCursor();
	}
}
开发者ID:zoombapup,项目名称:OSCWidgets,代码行数:8,代码来源:ToyWindow.cpp


注:本文中的UpdateCursor函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。