• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ setMouseCursor函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getWidth

void HoaMapComponent::mouseMove(const MouseEvent &event)
{
    Point<float> point;
    Point<float> mouse = event.getPosition().toFloat();
    mouse.applyTransform(AffineTransform::fromTargetPoints(0, 0, -1, 1, getWidth(), 0, 1, 1, getWidth(), getWidth(), 1, -1));
    
    m_source_selected   = -1;
    for (int i = 0; i < m_sources->getNumberOfSources(); i++)
    {
        if(m_sources->sourceGetExistence(i))
        {
            point.setXY(m_sources->sourceGetAbscissa(i) * m_sources->getZoom(), m_sources->sourceGetOrdinate(i) * m_sources->getZoom());
            if(mouse.getDistanceFrom(point) < m_sources_size * 0.002)
            {
                m_source_selected = i;
                setMouseCursor(MouseCursor::PointingHandCursor);
                repaint();
                return;
            }
        }
    }
    m_drag_mode = 0;
    repaint();
    setMouseCursor(MouseCursor::NormalCursor);
}
开发者ID:CICM,项目名称:HoaLibrary,代码行数:25,代码来源:HoaMapComponent.cpp


示例2: getMousePos

// **********************************************
void CToolPick::updateAfterRender()
{
	//H_AUTO(R2_CToolPick_updateAfterRender)
	// See if the mouse is over a valid position
	_ValidPos = false;
	sint32 mouseX,  mouseY;
	getMousePos(mouseX,  mouseY);
	if (!isInScreen(mouseX,  mouseY))
	{
		getEditor().setFocusedInstance(NULL);
		setMouseCursor(_CursCannotPickPos);
		return;
	}
	_CandidateInstance = NULL;
	CInstance *instanceUnder = checkInstanceUnderMouse();
	bool ignoreInstanceUnder = false;
	if(instanceUnder && _IgnoreInstances.size()>0)
	{
		for(uint i=0; i<_IgnoreInstances.size(); i++)
		{
			if(instanceUnder->isKindOf(_IgnoreInstances[i]))
			{
				ignoreInstanceUnder = true;
				break;
			}
		}
	}
	if (!instanceUnder || ignoreInstanceUnder)
	{
		if (isMouseOnUI() && !isMouseOnContainer())
		{
			setMouseCursor(DEFAULT_CURSOR);
		}
		else
		{
			CTool::CWorldViewRay worldViewRay;
			computeWorldViewRay(mouseX,  mouseY,  worldViewRay);
			CVector inter;
			_ValidPos = (ValidPacsPos == computeLandscapeRayIntersection(worldViewRay,  _Intersection));
			setMouseCursor(_ValidPos ? _CursCanPickPos : _CursCannotPickPos);
			getEditor().setFocusedInstance(NULL);
		}
		return;
	}
	getEditor().setFocusedInstance(instanceUnder);
	if (canPick(*instanceUnder))
	{
		_CandidateInstance = instanceUnder;
		setMouseCursor(_CursCanPickInstance);
	}
	else
	{
		setMouseCursor(_CursCannotPickInstance);
	}
}
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:56,代码来源:tool_pick.cpp


示例3: setMouseCursor

//==============================================================================
void PianoGridNote::mouseMove (const MouseEvent& e)
{
    if (e.x >= getWidth() - 2)
    {
        setMouseCursor (MouseCursor (MouseCursor::LeftRightResizeCursor));
    }
    else
    {
        setMouseCursor (MouseCursor (MouseCursor::NormalCursor));
    }
}
开发者ID:christianscheuer,项目名称:jivemodular,代码行数:12,代码来源:jucetice_PianoGridNote.cpp


示例4: setMouseCursor

void stepQuickEdit::mouseMove (const MouseEvent &e)
{
	if (e.x > 4 && e.x < 124 && e.y > 2 && e.y < 16)
	{
		setMouseCursor (MouseCursor::DraggingHandCursor);
	}
	else
	{
		setMouseCursor (MouseCursor::NormalCursor);
	}
}
开发者ID:Knochenschall,项目名称:sklepseq,代码行数:11,代码来源:stepQuickEdit.cpp


示例5: setMouseCursor

//--------------------------------------------------------------------
void SidebarPanel::mouseEnter(const MouseEvent& event)
{
    const int xPos = event.getPosition().getX();

    if(!event.mods.isLeftButtonDown() && xPos>getWidth()-10)
    {
        setMouseCursor (MouseCursor::LeftRightResizeCursor);
        canResize=true;
    }
    else
        setMouseCursor (MouseCursor::NormalCursor);
}
开发者ID:gsenna,项目名称:cabbage,代码行数:13,代码来源:SidebarPanel.cpp


示例6: clickable

void HoaplugAudioProcessorEditor::mouseMove (const MouseEvent &event)
{
    Point<int> mouse = event.getPosition();
    Rectangle<int> clickable(70, 40, 20, 20);
    //Rectangle<int> clickable(0, 0, 20, 20);
    cicm_link_over = false;
    setMouseCursor(MouseCursor::NormalCursor);
    if (clickable.contains(mouse)) {
        cicm_link_over = true;
        setMouseCursor(MouseCursor::PointingHandCursor);
    }
    //repaint();
}
开发者ID:dimibil,项目名称:HoaLibrary,代码行数:13,代码来源:PluginEditor.cpp


示例7: getUI

//***************************************************************
void CToolCreateEntity::updateInvalidCursorOnUI()
{
	//H_AUTO(R2_CToolCreateEntity_updateInvalidCursorOnUI)
	// set the default cursor unless the mouse is on the palette
	const std::vector<CInterfaceGroup *> &groups = getUI().getGroupsUnderPointer();
	for(uint k = 0; k < groups.size(); ++k)
	{
		if (groups[k]->getId() == "ui:interface:r2ed_palette") // hardcoded for now ...
		{
			setMouseCursor(_CursValid);
			return;
		}
	}
	setMouseCursor(DEFAULT_CURSOR);
}
开发者ID:mixxit,项目名称:solinia,代码行数:16,代码来源:tool_create_entity.cpp


示例8: setMouseCursor

void
WorldInputCmdProcessor::evaluateMouseEvents()
{
    iXY world_pos;
    iXY mouse_pos;

    MouseInterface::getMousePosition( &mouse_pos.x, &mouse_pos.y );
    WorldViewInterface::getViewWindow( &world_win );

    WorldViewInterface::clientXYtoWorldXY( world_win, mouse_pos, &world_pos );
    setMouseCursor(getCursorStatus(world_pos));

    if(selection_box_active) {
        box_release = world_pos;
        if(abs(box_release.x - box_press.x) > 3
                    && abs(box_release.y - box_press.y) > 3) {
            selectBoundBoxUnits();
        }
    }

    while( !MouseInterface::event_queue.empty() ) {
        MouseEvent event = MouseInterface::event_queue.front();
        MouseInterface::event_queue.pop_front();

        if( event.button == MouseInterface::left_button )
            evalLeftMButtonEvents(event);

        if( event.button == MouseInterface::right_button )
            evalRightMButtonEvents(event);
    }
}
开发者ID:BackupTheBerlios,项目名称:netpanzer-svn,代码行数:31,代码来源:WorldInputCmdProcessor.cpp


示例9: if

void GraphComponent::mouseUp (const MouseEvent& e)
{
    if (e.mods.isLeftButtonDown())
    {
        lassoComponent->endLasso ();
    }
    else if (e.mods.isMiddleButtonDown ())
    {
    }
    else if (e.mods.isRightButtonDown ())
    {
        // try to open internal plugins
        BasePlugin* newPlugin = PluginLoader::handlePopupMenu (false, 0, owner->getFilter());

        // now open plugin
        if (host && newPlugin)
        {
            host->openPlugin (newPlugin);
            host->addPlugin (newPlugin);

            newPlugin->setValue (PROP_GRAPHXPOS, e.x);
            newPlugin->setValue (PROP_GRAPHYPOS, e.y);

            createPluginNode (newPlugin);
        }
    }
    
    lassoComponent->endLasso ();
    setMouseCursor (MouseCursor::NormalCursor);
}
开发者ID:alessandropetrolati,项目名称:juced,代码行数:30,代码来源:GraphComponent.cpp


示例10: minNumHandles

EnvelopeComponent::EnvelopeComponent()
:	minNumHandles(0),
	maxNumHandles(0xffffff),
	domainMin(0.0),
	domainMax(1.0),
	valueMin(0.0),
	valueMax(1.0),
	valueGrid((valueMax-valueMin) / 10),
	domainGrid((domainMax-domainMin) / 16),
	gridDisplayMode(GridNone),
	gridQuantiseMode(GridNone),
	draggingHandle(0),
	curvePoints(64),
	releaseNode(-1),
	loopNode(-1),
	allowCurveEditing(true),
	allowNodeEditing(true)
{
	setMouseCursor(MouseCursor::NormalCursor);
	setBounds(0, 0, 200, 200); // non-zero size to start with
		
	colours[Node]				= 0xFF69B4FF;
	colours[ReleaseNode]		= 0xB469FFFF;
	colours[LoopNode]			= 0x69FFB4FF;
	colours[Line]				= 0xFFFFFFFF;
	colours[LoopLine]			= 0xB469FFFF;
	colours[Background]			= 0x555555FF;
	colours[GridLine]			= 0x888888FF;
	colours[LegendText]			= 0x000000FF;
	colours[LegendBackground]	= 0x696969FF;
}
开发者ID:alessandrostone,项目名称:ugen,代码行数:31,代码来源:ugen_JuceEnvelopeComponent.cpp


示例11: getPadWidth

void HoaMap::mouseDrag (const MouseEvent &event)
{
    Point<float> mouse = event.getPosition().toFloat();
    Point<float> newPos;
    ModifierKeys modifierKey = event.mods;
    // conversion en cartesien :
    //mouse.applyTransform(AffineTransform::translation(m_padding, m_padding));
    mouse.applyTransform(AffineTransform::fromTargetPoints(0, 0, -1, 1,
                                                           getPadWidth(), 0, 1, 1,
                                                           getPadWidth(), getPadWidth(), 1, -1));
    
    newPos = mouse;
    
    if (m_sourcePointed >= 0 && m_sourcePointed < m_nbSources) {
        setMouseCursor(MouseCursor::DraggingHandCursor);
        m_sources_dragState[m_sourcePointed] = -1; // reset dragging state
        m_sources_ValueChanged[m_sourcePointed] = 1;
        if (modifierKey.isShiftDown()) { // constrain move to distance
            setPolarCoordinates(m_sourcePointed, Tools::radius(newPos.x, newPos.y), m_sources[m_sourcePointed].getAzimuth());
        }
        else if (modifierKey.isCtrlDown()) { // constrain move to angle
            setPolarCoordinates(m_sourcePointed, m_sources[m_sourcePointed].getRadius(), Tools::angle(newPos.x, newPos.y));
        }
        else {
            setCartesianCoordinates(m_sourcePointed, newPos.x, newPos.y, sendNotificationSync);
        }
    }
}
开发者ID:dimibil,项目名称:HoaLibrary,代码行数:28,代码来源:HoaMap.cpp


示例12: ItemDragAndDropOverlayComponent

 ItemDragAndDropOverlayComponent()
     : isDragging (false)
 {
     setAlwaysOnTop (true);
     setRepaintsOnMouseActivity (true);
     setMouseCursor (MouseCursor::DraggingHandCursor);
 }
开发者ID:Theadd,项目名称:juced,代码行数:7,代码来源:juce_ToolbarItemComponent.cpp


示例13: newTransaction

//==============================================================================
void CodeEditorComponent::mouseDown (const MouseEvent& e)
{
    newTransaction();
    dragType = notDragging;

    if (e.mods.isPopupMenu())
    {
        setMouseCursor (MouseCursor::NormalCursor);

        if (getHighlightedRegion().isEmpty())
        {
            CodeDocument::Position start, end;
            document.findTokenContaining (getPositionAt (e.x, e.y), start, end);

            if (start.getPosition() < end.getPosition())
                selectRegion (start, end);
        }

        PopupMenu m;
        m.setLookAndFeel (&getLookAndFeel());
        addPopupMenuItems (m, &e);

        m.showMenuAsync (PopupMenu::Options(),
                         ModalCallbackFunction::forComponent (codeEditorMenuCallback, this));
    }
    else
    {
        beginDragAutoRepeat (100);
        moveCaretTo (getPositionAt (e.x, e.y), e.mods.isShiftDown());
    }
}
开发者ID:grimtraveller,项目名称:mlrVST,代码行数:32,代码来源:juce_CodeEditorComponent.cpp


示例14: setMouseCursor

void QWidgetResizeHandler::doResize()
{
    if (!activeForResize)
        return;

    moveResizeMode = true;
    moveOffset = widget->mapFromGlobal(QCursor::pos());
    if (moveOffset.x() < widget->width()/2) {
        if (moveOffset.y() < widget->height()/2)
            mode = TopLeft;
        else
            mode = BottomLeft;
    } else {
        if (moveOffset.y() < widget->height()/2)
            mode = TopRight;
        else
            mode = BottomRight;
    }
    invertedMoveOffset = widget->rect().bottomRight() - moveOffset;
#ifndef QT_NO_CURSOR
    setMouseCursor(mode);
    widget->grabMouse(widget->cursor() );
#else
    widget->grabMouse();
#endif
    widget->grabKeyboard();
    resizeHorizontalDirectionFixed = false;
    resizeVerticalDirectionFixed = false;
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:29,代码来源:qwidgetresizehandler.cpp


示例15: setMouseCursor

void DraggableWaveDisplay::mouseDown (const MouseEvent &e)
{
	mouseX.setBoth (e.x);
	isMouseDown = true;
	
	if (isDraggable)
	{
		if (mouseShouldTogglePlay)
		{
			if (filePlayer.getAudioTransportSource()->isPlaying())
			{
				shouldBePlaying = true;
				filePlayer.getAudioTransportSource()->stop();
			}
			else
            {
				shouldBePlaying = false;
            }
		}
        
		setMouseCursor (MouseCursor::DraggingHandCursor);
		
		startTimer (waveformMoved, 40);
	}
}
开发者ID:DISTRHO,项目名称:DISTRHO-Ports,代码行数:25,代码来源:dRowAudio_DraggableWaveDisplay.cpp


示例16: getParentComponent

void EnvelopeHandleComponent::mouseUp(const MouseEvent& e)
{
	(void)e;
    EnvelopeComponent *env = getParentComponent();

#ifdef MYDEBUG
	printf("MyEnvelopeHandleComponent::mouseUp\n");
#endif
	
	if(ignoreDrag == true)
	{
		ignoreDrag = false;
		goto exit;
	}
		
//	if(e.mods.isCtrlDown() == false)
//	{
		env->quantiseHandle(this);
//	}
	
	setMouseCursor(MouseCursor::CrosshairCursor);
	setMousePositionToThisHandle();
	
	offsetX = 0;
	offsetY = 0;
    
exit:
    getParentComponent()->sendEndDrag();
}
开发者ID:alessandrostone,项目名称:ugen,代码行数:29,代码来源:ugen_JuceEnvelopeComponent.cpp


示例17: switch

void QVistaHelper::mouseMoveEvent(QMouseEvent *event)
{
    if (wizard->windowState() & Qt::WindowMaximized) {
        event->ignore();
        return;
    }

    QRect rect = wizard->geometry();
    if (pressed) {
        switch (change) {
        case resizeTop:
            {
                const int dy = event->pos().y() - pressedPos.y();
                if ((dy > 0 && rect.height() > wizard->minimumHeight())
                    || (dy < 0 && rect.height() < wizard->maximumHeight()))
                    rect.setTop(rect.top() + dy);
            }
            break;
        case movePosition: {
            QPoint newPos = event->pos() - pressedPos;
            rect.moveLeft(rect.left() + newPos.x());
            rect.moveTop(rect.top() + newPos.y());
            break; }
        default:
            break;
        }
        wizard->setGeometry(rect);

    } else if (vistaState() == VistaAero) {
        setMouseCursor(event->pos());
    }
    event->ignore();
}
开发者ID:2gis,项目名称:2gisqt5android,代码行数:33,代码来源:qwizard_win.cpp


示例18: Button

HyperlinkButton::HyperlinkButton ()
   : Button (String::empty),
     font (14.0f, Font::underlined),
     resizeFont (true),
     justification (Justification::centred)
{
    setMouseCursor (MouseCursor::PointingHandCursor);
}
开发者ID:AGenews,项目名称:GUI,代码行数:8,代码来源:juce_HyperlinkButton.cpp


示例19: setMouseCursor

void TimelineCursor::mouseUp(const MouseEvent &e)
{
    if(_showCursor)
    {
        setMouseCursor(MouseCursor::NormalCursor);
        startTimerIfCursorIsVisible();
    }
}
开发者ID:danlismore,项目名称:TimelineDemo,代码行数:8,代码来源:TimelineCursor.cpp


示例20: component

ResizableCornerComponent::ResizableCornerComponent (Component* const componentToResize,
                                                    ComponentBoundsConstrainer* const constrainer_)
   : component (componentToResize),
     constrainer (constrainer_)
{
    setRepaintsOnMouseActivity (true);
    setMouseCursor (MouseCursor::BottomRightCornerResizeCursor);
}
开发者ID:imekon,项目名称:SampleBrowser2,代码行数:8,代码来源:juce_ResizableCornerComponent.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setMouseOpaque函数代码示例发布时间:2022-05-30
下一篇:
C++ setMouseCapture函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap