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


C++ MouseEvent::getY方法代码示例

本文整理汇总了C++中gcn::MouseEvent::getY方法的典型用法代码示例。如果您正苦于以下问题:C++ MouseEvent::getY方法的具体用法?C++ MouseEvent::getY怎么用?C++ MouseEvent::getY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gcn::MouseEvent的用法示例。


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

示例1: mouseReleased

void PlayControllerZone::mouseReleased( gcn::MouseEvent& mouseEvent )
{

  model().setMouse( "ZoneO",
                    mouseEvent.getX(),
                    mouseEvent.getY() );

  //
  // Tenemos un area para seleccionar.
  adjustSelectedArea( mouseEvent.getX(),
                      mouseEvent.getY() );

  switch ( mouseEvent.getButton() )
  {
    case gcn::MouseEvent::LEFT:
      view().setSelectedArea( m_selectarea );
      break;
    case gcn::MouseEvent::RIGHT:
      view().setDestination( m_selectarea );
      break;
    default:
      break;
  }

  mouseEvent.consume();
}
开发者ID:jorgejcabrera,项目名称:gamemvc,代码行数:26,代码来源:playcontrollerzone.cpp

示例2: getTitleBarHeight

void
Wellcome::mousePressed(gcn::MouseEvent &event)
{
    gcn::Rectangle d1, d2, d3, d4;
    d1.setAll(mNext->getDimension().x,
              mNext->getDimension().y + getTitleBarHeight(),
              mNext->getDimension().x + mNext->getDimension().width,
              mNext->getDimension().y + mNext->getDimension().height + getTitleBarHeight());
    d2.setAll(mPrev->getDimension().x,
              mPrev->getDimension().y + getTitleBarHeight(),
              mPrev->getDimension().x + mPrev->getDimension().width,
              mPrev->getDimension().y + mPrev->getDimension().height + getTitleBarHeight());
    d3.setAll(mFinish->getDimension().x,
              mFinish->getDimension().y + getTitleBarHeight(),
              mFinish->getDimension().x + mFinish->getDimension().width,
              mFinish->getDimension().y + mFinish->getDimension().height + getTitleBarHeight());
    d4.setAll(mAgain->getDimension().x,
              mAgain->getDimension().y + getTitleBarHeight(),
              mAgain->getDimension().x + mAgain->getDimension().width,
              mAgain->getDimension().y + mAgain->getDimension().height + getTitleBarHeight());

    if(d1.isPointInRect(event.getX(), event.getY()) ||
       d2.isPointInRect(event.getX(), event.getY()) ||
       d3.isPointInRect(event.getX(), event.getY()) ||
       d4.isPointInRect(event.getX(), event.getY()) ||
       event.getY()<getTitleBarHeight())
    {
        Window::mousePressed(event);
        return;
    }
    setActionEventId("next");
    distributeActionEvent();

}
开发者ID:mekolat,项目名称:elektrogamesvn,代码行数:34,代码来源:wellcome.cpp

示例3: mouseDragged

void ItemShortcutContainer::mouseDragged(gcn::MouseEvent &event)
{
    if (event.getButton() == gcn::MouseEvent::LEFT)
    {
        if (!mItemMoved && mItemClicked)
        {
            const int index = getIndexFromGrid(event.getX(), event.getY());
            const int itemId = itemShortcut->getItem(index);

            if (index == -1 || itemId < 0)
                return;

            Item *item = player_node->getInventory()->findItem(itemId);

            if (item)
            {
                mItemMoved = item;
                itemShortcut->removeItem(index);
            }
        }
        if (mItemMoved)
        {
            mCursorPosX = event.getX();
            mCursorPosY = event.getY();
        }
    }
}
开发者ID:weimingtom,项目名称:guichan-input,代码行数:27,代码来源:itemshortcutcontainer.cpp

示例4: mouseDragged

void EmoteShortcutContainer::mouseDragged(gcn::MouseEvent &event)
{
    if (event.getButton() == gcn::MouseEvent::LEFT)
    {
        if (!mEmoteMoved && mEmoteClicked)
        {
            const int index = getIndexFromGrid(event.getX(), event.getY());

            if (index == -1)
                return;

            const int emoteId = emoteShortcut->getEmote(index);

            if (emoteId)
            {
                mEmoteMoved = emoteId;
                emoteShortcut->removeEmote(index);
            }
        }
        if (mEmoteMoved)
        {
            mCursorPosX = event.getX();
            mCursorPosY = event.getY();
        }
    }
}
开发者ID:TonyRice,项目名称:mana,代码行数:26,代码来源:emoteshortcutcontainer.cpp

示例5: mouseDragged

void OutfitWindow::mouseDragged(gcn::MouseEvent &event)
{
    Window::mouseDragged(event);
    if (event.getButton() == gcn::MouseEvent::LEFT)
    {
        if (!mItemMoved && mItemClicked)
        {
            const int index = getIndexFromGrid(event.getX(), event.getY());
            if (index == -1)
                return;
            const int itemId = mItems[mCurrentOutfit][index];
            if (itemId < 0)
                return;
            Item *item = PlayerInfo::getInventory()->findItem(itemId);
            if (item)
            {
                mItemMoved = item;
                mItems[mCurrentOutfit][index] = -1;
            }
        }
        if (mItemMoved)
        {
            mCursorPosX = event.getX();
            mCursorPosY = event.getY();
        }
    }
}
开发者ID:mobilehub,项目名称:mana,代码行数:27,代码来源:outfitwindow.cpp

示例6: mousePressed

 void TileSelector::mousePressed(gcn::MouseEvent& mouseEvent)
 {
    if (mouseEvent.getX() <= mTileSetBitmap->w
         && mouseEvent.getY() <= mTileSetBitmap->h)
     {
         mSelectedTile = mouseEvent.getX() / 16
                       + (mouseEvent.getY() / 16) * mTileSetBitmap->w / 16;
         generateAction();
     }
 }
开发者ID:olofn,项目名称:db_public,代码行数:10,代码来源:tileselector.cpp

示例7: mouseEntered

void PlayControllerZone::mouseEntered( gcn::MouseEvent& mouseEvent )
{

  model().setMouse( "Zone",
                    mouseEvent.getX(),
                    mouseEvent.getY() );
  view().updateMoveView( mouseEvent.getX(),
                         mouseEvent.getY() );
  mouseEvent.consume();

}
开发者ID:jorgejcabrera,项目名称:gamemvc,代码行数:11,代码来源:playcontrollerzone.cpp

示例8: mouseDragged

void PlayControllerZone::mouseDragged( gcn::MouseEvent& mouseEvent )
{

  model().setMouse( "ZoneE",
                    mouseEvent.getX(),
                    mouseEvent.getY() );

  adjustSelectedArea( mouseEvent.getX(),
                      mouseEvent.getY() );

  view().paintSelectedArea( m_selectarea );
  mouseEvent.consume();
}
开发者ID:jorgejcabrera,项目名称:gamemvc,代码行数:13,代码来源:playcontrollerzone.cpp

示例9: mouseMoved

void MouseSelectionMenu::mouseMoved(gcn::MouseEvent &mouseEvent)
{
    WidgetListIterator iter;
    for( iter = mWidgets.begin(); iter != mWidgets.end(); iter++ ) {
        if( mouseEvent.getY() > (*iter)->getY() && mouseEvent.getY() < (*iter)->getY() + (*iter)->getHeight() ) {
            drawRect.x      = (*iter)->getX()       - 1;
            drawRect.y      = (*iter)->getY()       - 1;
            drawRect.width  = (*iter)->getWidth()   + 1;
            drawRect.height = (*iter)->getHeight()  + 1;
            return;
        }
    }
}
开发者ID:weimingtom,项目名称:mmomm,代码行数:13,代码来源:mouseSelectionMenu.cpp

示例10: mouseMoved

 void TileSelector::mouseMoved(gcn::MouseEvent& mouseEvent)
 {
     if (mouseEvent.getX() <= mTileSetBitmap->w
         && mouseEvent.getY() <= mTileSetBitmap->h)
     {
         mCurrentMouseX = mouseEvent.getX();
         mCurrentMouseY = mouseEvent.getY();
         mDrawMouseHoverTile = true;
     }
     else
     {
         mDrawMouseHoverTile = false;
     }
 }
开发者ID:olofn,项目名称:db_public,代码行数:14,代码来源:tileselector.cpp

示例11: mousePressed

void Windowiki::mousePressed(gcn::MouseEvent &event)
{
    // Let Guichan move window to top and figure out title bar drag
    gcn::Window::mousePressed(event);

    const int x = event.getX();
    const int y = event.getY();
    mMouseResize = 0;

    // Activate resizing handles as appropriate
    if (event.getSource() == this && isResizable() &&
            event.getButton() == gcn::MouseEvent::LEFT &&
            !getChildrenArea().isPointInRect(x, y))
    {
        mMouseResize |= (x > getWidth() - resizeBorderWidthiki) ? RIGHT :
                        (x < resizeBorderWidthiki) ? LEFT : 0;
        mMouseResize |= (y > getHeight() - resizeBorderWidthiki) ? BOTTOM :
                        (y < resizeBorderWidthiki) ? TOP : 0;
    }
    else if (event.getSource() == mGrip)
    {
        mDragOffsetX = x + mGrip->getX();
        mDragOffsetY = y + mGrip->getY();
        mMouseResize |= BOTTOM | RIGHT;
        mIsMoving = false;
    }

    if (event.getButton() == gcn::MouseEvent::LEFT)
    {
        const int x = event.getX();
        const int y = event.getY();

        // Handle close button
        if (mCloseButton)
        {
            gcn::Rectangle closeButtonRect(
                getWidth() - closeImage->getWidth() - getPadding(),
                getPadding(),
                closeImage->getWidth(),
                closeImage->getHeight());

            if (closeButtonRect.isPointInRect(x, y))
            {
                setVisible(false);
            }
        }

        // Handle window resizing
    }
}
开发者ID:mekolat,项目名称:elektrogamesvn,代码行数:50,代码来源:window_iki.cpp

示例12: mousePressed

void DropDown::mousePressed(gcn::MouseEvent& mouseEvent)
{
    gcn::DropDown::mousePressed(mouseEvent);

    if (0 <= mouseEvent.getY() && mouseEvent.getY() < getHeight() &&
        mouseEvent.getX() >= 0 && mouseEvent.getX() < getWidth() &&
        mouseEvent.getButton() == gcn::MouseEvent::LEFT && mDroppedDown &&
        mouseEvent.getSource() == mListBox)
    {
        mPushed = false;
        foldUp();
        releaseModalMouseInputFocus();
        distributeActionEvent();
    }
}
开发者ID:Ablu,项目名称:mana,代码行数:15,代码来源:dropdown.cpp

示例13: mouseEntered

void PlayControllerMsgCenter::mouseEntered( gcn::MouseEvent& mouseEvent )
{
  model().setMouse( "MsgCenter",
                    mouseEvent.getX(),
                    mouseEvent.getY() );
  mouseEvent.consume();
}
开发者ID:jorgejcabrera,项目名称:gamemvc,代码行数:7,代码来源:playcontrollermsgcenter.cpp

示例14: mouseMoved

void MiniStatusWindow::mouseMoved(gcn::MouseEvent &event)
{
    Popup::mouseMoved(event);

    const int x = event.getX();
    const int y = event.getY();

    if (event.getSource() == mXpBar)
    {
        mTextPopup->show(x + getX(), y + getY(),
                         strprintf("%u/%u", PlayerInfo::getAttribute(EXP),
                                   PlayerInfo::getAttribute(EXP_NEEDED)),
                         strprintf("%s: %u", _("Need"),
                                   PlayerInfo::getAttribute(EXP_NEEDED)
                                   - PlayerInfo::getAttribute(EXP)));
    }
    else if (event.getSource() == mHpBar)
    {
        mTextPopup->show(x + getX(), y + getY(),
                         strprintf("%u/%u", PlayerInfo::getAttribute(HP),
                                   PlayerInfo::getAttribute(MAX_HP)));
    }
    else if (event.getSource() == mMpBar)
    {
        mTextPopup->show(x + getX(), y + getY(),
                         strprintf("%u/%u", PlayerInfo::getAttribute(MP),
                                   PlayerInfo::getAttribute(MAX_MP)));
    }
    else
    {
        mTextPopup->setVisible(false);
    }
}
开发者ID:B-Rich,项目名称:mana,代码行数:33,代码来源:ministatus.cpp

示例15: mouseReleased

void ItemContainer::mouseReleased(gcn::MouseEvent &event)
{
    if (mClicks == 2)
        return;

    switch (mSelectionStatus)
    {
        case SEL_SELECTING:
            mSelectionStatus = SEL_SELECTED;
            return;
        case SEL_DESELECTING:
            selectNone();
            return;
        case SEL_DRAGGING:
            mSelectionStatus = SEL_SELECTED;
            break;
        case SEL_NONE:
        case SEL_SELECTED:
        default:
            return;
    };

    int index = getSlotIndex(event.getX(), event.getY());
    if (index == Inventory::NO_SLOT_INDEX)
        return;
    if (index == mSelectedIndex || mSelectedIndex == -1)
        return;
    Net::getInventoryHandler()->moveItem(mSelectedIndex, index);
    selectNone();
}
开发者ID:Evonline,项目名称:ManaPlus,代码行数:30,代码来源:itemcontainer.cpp


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