本文整理汇总了C++中setMouseCursor函数的典型用法代码示例。如果您正苦于以下问题:C++ setMouseCursor函数的具体用法?C++ setMouseCursor怎么用?C++ setMouseCursor使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setMouseCursor函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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);
}
}
示例3: setMouseCursor
//==============================================================================
void PianoGridNote::mouseMove (const MouseEvent& e)
{
if (e.x >= getWidth() - 2)
{
setMouseCursor (MouseCursor (MouseCursor::LeftRightResizeCursor));
}
else
{
setMouseCursor (MouseCursor (MouseCursor::NormalCursor));
}
}
示例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);
}
}
示例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);
}
示例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();
}
示例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);
}
示例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);
}
}
示例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);
}
示例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;
}
示例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);
}
}
}
示例12: ItemDragAndDropOverlayComponent
ItemDragAndDropOverlayComponent()
: isDragging (false)
{
setAlwaysOnTop (true);
setRepaintsOnMouseActivity (true);
setMouseCursor (MouseCursor::DraggingHandCursor);
}
示例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());
}
}
示例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;
}
示例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);
}
}