本文整理汇总了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();
}
示例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();
}
示例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_);
}
}
示例4: mouseWheelMovedDown
void ListBox::mouseWheelMovedDown(gcn::MouseEvent& mouseEvent)
{
if (isFocused())
{
incrementSelected();
mouseEvent.consume();
}
}
示例5: mouseExited
void PlayControllerZone::mouseExited( gcn::MouseEvent& mouseEvent )
{
model().resetMouse();
view().resetMove();
mouseEvent.consume();
}
示例6: mouseWheelMovedDown
void GuiTable::mouseWheelMovedDown(gcn::MouseEvent& mouseEvent)
{
if (isFocused())
{
setSelectedRow(getSelectedRow() + 1);
mouseEvent.consume();
}
}
示例7: mouseWheelMovedDown
void PlayControllerZone::mouseWheelMovedDown( gcn::MouseEvent & mouseEvent )
{
model().setMouse( "Zone",
mouseEvent.getX(),
mouseEvent.getY() );
view().moveView( 0,
+10 );
mouseEvent.consume();
}
示例8: mouseEntered
void PlayControllerZone::mouseEntered( gcn::MouseEvent& mouseEvent )
{
model().setMouse( "Zone",
mouseEvent.getX(),
mouseEvent.getY() );
view().updateMoveView( mouseEvent.getX(),
mouseEvent.getY() );
mouseEvent.consume();
}
示例9: mouseWheelMovedUp
void GuiTable::mouseWheelMovedUp(gcn::MouseEvent& mouseEvent)
{
if (isFocused())
{
if (getSelectedRow() > 0 || (getSelectedRow() == 0 && mWrappingEnabled))
{
setSelectedRow(getSelectedRow() - 1);
}
mouseEvent.consume();
}
}
示例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();
}
}
示例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();
}
示例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();
}
示例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();
}
}
示例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();
}
示例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;
}