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


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

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


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

示例1: mouseEntered

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

示例2: 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

示例3: mouseClicked

void ItemMakerBox::mouseClicked(gcn::MouseEvent& mouseEvent){
    if( mouseEvent.isConsumed() ){ return; };

    //  Save Button
    if( mouseEvent.getSource() == saveBtn ){
        mouseEvent.consume();
        save( filenameFld->getText() );
    } else
    //  Load Button
    if( mouseEvent.getSource() == loadBtn ){
        mouseEvent.consume();
        load( filenameFld->getText() );
    } else {
        setCaption(caption_);
    }
}
开发者ID:hoodwolf,项目名称:Infraelly,代码行数:16,代码来源:ItemMakerBox.cpp

示例4: mouseWheelMovedDown

void ListBox::mouseWheelMovedDown(gcn::MouseEvent& mouseEvent)
{
    if (isFocused())
    {
        incrementSelected();
        mouseEvent.consume();
    }
}
开发者ID:Aethyra,项目名称:Client,代码行数:8,代码来源:listbox.cpp

示例5: mouseExited

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

  model().resetMouse();
  view().resetMove();
  mouseEvent.consume();

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

示例6: mouseWheelMovedDown

void GuiTable::mouseWheelMovedDown(gcn::MouseEvent& mouseEvent)
{
    if (isFocused())
    {
        setSelectedRow(getSelectedRow() + 1);

        mouseEvent.consume();
    }
}
开发者ID:Ablu,项目名称:invertika,代码行数:9,代码来源:table.cpp

示例7: mouseWheelMovedDown

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

  model().setMouse( "Zone",
                    mouseEvent.getX(),
                    mouseEvent.getY() );
  view().moveView( 0,
                   +10 );
  mouseEvent.consume();
}
开发者ID:jorgejcabrera,项目名称:gamemvc,代码行数:10,代码来源:playcontrollerzone.cpp

示例8: 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

示例9: mouseWheelMovedUp

void GuiTable::mouseWheelMovedUp(gcn::MouseEvent& mouseEvent)
{
    if (isFocused())
    {
        if (getSelectedRow() > 0 || (getSelectedRow() == 0 && mWrappingEnabled))
        {
            setSelectedRow(getSelectedRow() - 1);
        }

        mouseEvent.consume();
    }
}
开发者ID:Ablu,项目名称:invertika,代码行数:12,代码来源:table.cpp

示例10: mouseWheelMovedUp

void ChatInput::mouseWheelMovedUp(gcn::MouseEvent& mouseEvent)
{
    TextField::mouseWheelMovedUp(mouseEvent);

    if (isFocused() && mCurHist != mHistory.begin() && mHistory.size() > 0)
    {
        // Move backward through the history
        mCurHist--;
        setText(*mCurHist);
        setCaretPosition(getText().length());
        mouseEvent.consume();
    }
}
开发者ID:Tametomo,项目名称:Aethyra,代码行数:13,代码来源:chatinput.cpp

示例11: 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

示例12: mousePressed

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

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

  m_firstselect.x = mouseEvent.getX();
  m_firstselect.y = mouseEvent.getY();

  m_selectarea.x = m_firstselect.x;
  m_selectarea.y = m_firstselect.y;
  m_selectarea.width = 0;
  m_selectarea.height = 0;

  mouseEvent.consume();

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

示例13: mouseWheelMovedDown

void ChatInput::mouseWheelMovedDown(gcn::MouseEvent& mouseEvent)
{
    TextField::mouseWheelMovedDown(mouseEvent);

    if (isFocused() && mCurHist != mHistory.end())
    {
        // Move forward through the history
        HistoryIterator prevHist = mCurHist++;

        if (mCurHist != mHistory.end())
        {
            setText(*mCurHist);
            setCaretPosition(getText().length());
        }
        else
            mCurHist = prevHist;

        mouseEvent.consume();
    }
}
开发者ID:Tametomo,项目名称:Aethyra,代码行数:20,代码来源:chatinput.cpp

示例14: mouseClicked

void PlayControlPanel::mouseClicked(gcn::MouseEvent &mouseEvent)
{
  if (mouseEvent.isConsumed()) {
    return;
  }

  gcn::Widget* sourceWidget = mouseEvent.getSource();
  if (sourceWidget == dynamic_cast<gcn::Widget*>(playButton)) {
    std::cout << "Click on PLAY button" << std::endl;
    changeState(PLAYING);
  } else if (sourceWidget == dynamic_cast<gcn::Widget*>(pauseButton)) {
    std::cout << "Click on PAUSE button" << std::endl;
    changeState(PAUSED);
  } else if (sourceWidget == dynamic_cast<gcn::Widget*>(stopButton)) {
    std::cout << "Click on STOP button" << std::endl;
    changeState(STOPPED);
  }

  mouseEvent.consume();
}
开发者ID:igneus,项目名称:particled,代码行数:20,代码来源:playcontrolpanel.cpp

示例15: mouseClicked

void MouseSelectionMenu::mouseClicked(gcn::MouseEvent &mouseEvent)
{
    WidgetListIterator iter;
    for (iter = mWidgets.begin(); iter != mWidgets.end(); iter++) {
        gcn::Rectangle rec = (*iter)->getDimension();
        if( (*iter)->getY() <= mouseEvent.getY() && (*iter)->getY() + (*iter)->getHeight() >= mouseEvent.getY() &&
            (*iter)->getX() <= mouseEvent.getX() && (*iter)->getX() + (*iter)->getWidth()  >= mouseEvent.getX() ) {
            SDL_Event event;

            Gui::current().removeWidget(this);

            event.type = SDL_USEREVENT;
            event.user.code = EVENT_DELETE_WIDGET;
            event.user.data1 = this;

            SDL_PushEvent(&event);
            break;
        }
    }

    mouseEvent.consume();
    return;
}
开发者ID:weimingtom,项目名称:mmomm,代码行数:23,代码来源:mouseSelectionMenu.cpp


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