void KoReportDesignerItemLine::mousePressEvent(QGraphicsSceneMouseEvent * event)
{
    m_reportDesigner->changeSet(m_set);
    setSelected(true);
    QGraphicsLineItem::mousePressEvent(event);
}
Exemplo n.º 2
0
void nineButtonSelector::button4Clicked()
{
	setSelected( 4 );
}
Exemplo n.º 3
0
void nineButtonSelector::button6Clicked()
{
	setSelected( 6 );
}
Exemplo n.º 4
0
void nineButtonSelector::button0Clicked()
{
	setSelected( 0 );
}
Exemplo n.º 5
0
void nineButtonSelector::button2Clicked()
{
	setSelected( 2 );
}
Exemplo n.º 6
0
void VideoTrack::selectedChanged(VideoTrackPrivate* trackPrivate, bool selected)
{
    ASSERT_UNUSED(trackPrivate, trackPrivate == m_private);
    setSelected(selected);
}
Exemplo n.º 7
0
/**
 * Called when the undo state changed.
 *
 * @param undone true: entity has become invisible.
 *               false: entity has become visible.
 */
void RS_Entity::undoStateChanged(bool /*undone*/) {
        setSelected(false);
    update();
}
Exemplo n.º 8
0
bool ColorShades::onProcessMessage(ui::Message* msg)
{
  switch (msg->type()) {

    case ui::kOpenMessage:
      if (m_click == DragAndDropEntries) {
        // TODO This connection should be in the ContextBar
        m_conn = ColorBar::instance()->ChangeSelection.connect(
          base::Bind<void>(&ColorShades::onChangeColorBarSelection, this));
      }
      break;

    case ui::kSetCursorMessage:
      if (hasCapture()) {
        ui::set_mouse_cursor(ui::kMoveCursor);
        return true;
      }
      else if (m_click == ClickEntries &&
               m_hotIndex >= 0 &&
               m_hotIndex < int(m_shade.size())) {
        ui::set_mouse_cursor(ui::kHandCursor);
        return true;
      }
      break;

    case ui::kMouseEnterMessage:
    case ui::kMouseLeaveMessage:
      if (!hasCapture())
        m_hotIndex = -1;

      invalidate();
      break;

    case ui::kMouseDownMessage:
      if (m_hotIndex >= 0 &&
          m_hotIndex < int(m_shade.size())) {
        switch (m_click) {
          case ClickEntries:
            Click();
            m_hotIndex = -1;
            invalidate();
            break;
          case DragAndDropEntries:
            m_dragIndex = m_hotIndex;
            m_dropBefore = false;
            captureMouse();
            break;
        }
      }
      break;

    case ui::kMouseUpMessage: {
      if (m_click == ClickWholeShade) {
        setSelected(true);
        Click();
        closeWindow();
      }

      if (m_dragIndex >= 0) {
        ASSERT(m_dragIndex < int(m_shade.size()));

        auto color = m_shade[m_dragIndex];
        m_shade.erase(m_shade.begin()+m_dragIndex);
        if (m_hotIndex >= 0)
          m_shade.insert(m_shade.begin()+m_hotIndex, color);

        m_dragIndex = -1;
        invalidate();

        // Relayout the context bar if we have removed an entry.
        if (m_hotIndex < 0)
          parent()->parent()->layout();
      }

      if (hasCapture())
        releaseMouse();
      break;
    }

    case ui::kMouseMoveMessage: {
      ui::MouseMessage* mouseMsg = static_cast<ui::MouseMessage*>(msg);
      gfx::Point mousePos = mouseMsg->position() - bounds().origin();
      gfx::Rect bounds = clientBounds();
      int hot = -1;

      bounds.shrink(3*ui::guiscale());

      if (bounds.contains(mousePos)) {
        int count = size();
        hot = (mousePos.x - bounds.x) / (m_boxSize*ui::guiscale());
        hot = MID(0, hot, count-1);
      }

      if (m_hotIndex != hot) {
        m_hotIndex = hot;
        invalidate();
      }

      bool dropBefore =
        (hot >= 0 && mousePos.x < (bounds.x+m_boxSize*ui::guiscale()*hot)+m_boxSize*ui::guiscale()/2);
      if (m_dropBefore != dropBefore) {
        m_dropBefore = dropBefore;
        invalidate();
      }
      break;
    }
  }
  return Widget::onProcessMessage(msg);
}
Exemplo n.º 9
0
	void CMazeGameMenu::init(irr::gui::IGUIEnvironment * const in_guiEnv, const irr::core::recti & in_menuRect)
	{
		//TODO: Add cool images as buttons.
		LOG(DEBUG) << "Initializing menu";
		_mainMenuElements.clear();
		_gameSettingsElements.clear();
		_videoSettingsElements.clear();
		_guiEnv = in_guiEnv;
		auto backgroundImg = in_guiEnv->addImage(irr::core::recti(irr::core::vector2di(0, 0), in_guiEnv->getVideoDriver()->getScreenSize()));
		backgroundImg->setScaleImage(true);
		backgroundImg->setColor(irr::video::SColor(150, 255, 255, 255));
		backgroundImg->setImage(in_guiEnv->getVideoDriver()->getTexture("../media/p-of-eternity-maze-by-malcolm.jpg"));
		auto backImg = in_guiEnv->addImage(irr::core::recti(
			irr::core::vector2di(in_menuRect.UpperLeftCorner.X * (1.0f - ElementSeparationRatio), in_menuRect.UpperLeftCorner.Y * (1.0f - ElementSeparationRatio)), 
			irr::core::dimension2di(in_menuRect.getSize().Width *(1.0f + ElementSeparationRatio), in_menuRect.getSize().Height *(1.0f + ElementSeparationRatio + ElementHeightRatio))), backgroundImg);
		backImg->setScaleImage(true);
		backImg->setColor(irr::video::SColor(200, 255, 255, 255));
		backImg->setImage(in_guiEnv->getVideoDriver()->getTexture("../media/irrlicht2_up.jpg"));
		_menuBackground = backgroundImg;
		in_guiEnv->getSkin()->setFont(in_guiEnv->getFont("../media/fonthaettenschweiler.bmp"));
		//set the main menu.
		auto in_videoDriver = in_guiEnv->getVideoDriver();
		irr::core::dimension2di elementSize = in_menuRect.getSize(); 
		elementSize.Height *= ElementHeightRatio;
		int elementSeperation = in_menuRect.getHeight() * ElementSeparationRatio;
		irr::core::vector2di elementPosition(in_menuRect.UpperLeftCorner);
		auto button = in_guiEnv->addButton(irr::core::recti(elementPosition, elementSize), nullptr, MenuElement::BackToGameBtn,L"Back to Game");
		//button->setImage(in_videoDriver->getTexture("../media/backToGame.jpg"));
		_mainMenuElements.push_back(button);
		elementPosition.Y += elementSeperation + elementSize.Height;
		button = in_guiEnv->addButton(irr::core::recti(elementPosition, elementSize), nullptr, MenuElement::NewGameBtn, L"New Game");
		//button->setImage(in_videoDriver->getTexture("../media/newGame.jpg"));
		_mainMenuElements.push_back(button);
		elementPosition.Y += elementSeperation + elementSize.Height;
		button = in_guiEnv->addButton(irr::core::recti(elementPosition, elementSize), nullptr, MenuElement::GameSettingsBtn, L"Game Settings");
		//button->setImage(in_videoDriver->getTexture("../media/gameSettings.jpg"));
		_mainMenuElements.push_back(button);
		elementPosition.Y += elementSeperation + elementSize.Height;
		button = in_guiEnv->addButton(irr::core::recti(elementPosition, elementSize), nullptr, MenuElement::VideoSettingsBtn, L"Video Settings");
		//button->setImage(in_videoDriver->getTexture("../media/videoSettings.jpg"));
		_mainMenuElements.push_back(button);
		elementPosition.Y += elementSeperation + elementSize.Height;
		button = in_guiEnv->addButton(irr::core::recti(elementPosition, elementSize), nullptr, MenuElement::QuitBtn, L"Quit");
		//button->setImage(in_videoDriver->getTexture("../media/quitGame.jpg"));
		_mainMenuElements.push_back(button);
		//set the video settings menu
		elementPosition.Y = in_menuRect.UpperLeftCorner.Y;
		auto resImage = in_guiEnv->addImage(irr::core::recti(elementPosition, elementSize));
		resImage->setText(L"Select the desired resolution");
		//resImage->setImage(in_videoDriver->getTexture("../media/Resolution.jpg"));
		_videoSettingsElements.push_back(resImage);
		elementPosition.Y += elementSeperation + elementSize.Height;
		auto listBox = in_guiEnv->addListBox(irr::core::recti(elementPosition, irr::core::dimension2di(elementSize.Width,in_menuRect.getHeight()- (elementSize.Height + 2.0f * elementSeperation))), nullptr, MenuElement::ResolutionDropDown, true);
		listBox->addItem(L"800x600");
		listBox->addItem(L"1024x768");
		listBox->addItem(L"1200x1600");
		listBox->setSelected(0);
		_videoSettingsElements.push_back(listBox);
		//add buttons at the bottom to both game and setting menu
		elementPosition.Y = in_menuRect.UpperLeftCorner.Y + in_menuRect.getHeight();
		elementSize.Width = (elementSize.Width - elementSeperation) / 2.0f;
		button = in_guiEnv->addButton(irr::core::recti(elementPosition, elementSize), nullptr, MenuElement::BackToMainMenuBtn, L"Back to Main Menu");
		//button->setImage(in_videoDriver->getTexture("../media/backToMainMenu.jpg"));
		_videoSettingsElements.push_back(button);
		_gameSettingsElements.push_back(button);
		elementPosition.X += elementSize.Width + elementSeperation;
		button = in_guiEnv->addButton(irr::core::recti(elementPosition, elementSize), nullptr, MenuElement::SetVideoSettingsBtn, L"Apply (restart game)");
		//button->setImage(in_videoDriver->getTexture("../media/setVideoSettings.jpg"));
		_videoSettingsElements.push_back(button);
		button = in_guiEnv->addButton(irr::core::recti(elementPosition, elementSize), nullptr, MenuElement::SetGameSettingsBtn, L"Apply (restart game)");
		//button->setImage(in_videoDriver->getTexture("../media/setGameSettings.jpg"));
		_gameSettingsElements.push_back(button);
		//set the game settings menu
		elementPosition.Y = in_menuRect.UpperLeftCorner.Y;
		auto spinBox = in_guiEnv->addSpinBox(L"Number of AI players", irr::core::recti(elementPosition, elementSize),true,nullptr,MenuElement::MazeNumOfAI);
		spinBox->setDecimalPlaces(0);
		spinBox->setRange(0.0f, 10.0f);
		spinBox->setValue(3.0f);
		_gameSettingsElements.push_back(spinBox);
		elementPosition.Y += elementSeperation + elementSize.Height;
		spinBox = in_guiEnv->addSpinBox(L"AI level", irr::core::recti(elementPosition, elementSize), true, nullptr, MenuElement::MazeAIDifficultyLevel);
		spinBox->setDecimalPlaces(0);
		spinBox->setRange(1.0f, 10.0f);
		spinBox->setValue(3.0f);
		_gameSettingsElements.push_back(spinBox);
		elementPosition.Y += elementSeperation + elementSize.Height;
		spinBox = in_guiEnv->addSpinBox(L"Maze Width", irr::core::recti(elementPosition, elementSize), true, nullptr, MenuElement::MazeWidth);
		spinBox->setDecimalPlaces(0);
		spinBox->setRange(20.0f, 60.0f);
		spinBox->setStepSize(2.0f);
		spinBox->setValue(30.0f);
		_gameSettingsElements.push_back(spinBox);
		elementPosition.Y += elementSeperation + elementSize.Height;
		spinBox = in_guiEnv->addSpinBox(L"Maze Height", irr::core::recti(elementPosition, elementSize), true, nullptr, MenuElement::MazeHeight);
		spinBox->setDecimalPlaces(0);
		spinBox->setRange(20.0f, 60.0f);
		spinBox->setStepSize(2.0f);
		spinBox->setValue(30.0f);
		_gameSettingsElements.push_back(spinBox);
		elementPosition = in_menuRect.UpperLeftCorner;
		_gameSettingsElements.push_back( in_guiEnv->addStaticText(L"Number of AI players:", irr::core::recti(elementPosition, elementSize)));
		elementPosition.Y += elementSeperation + elementSize.Height;
		_gameSettingsElements.push_back(in_guiEnv->addStaticText(L"AI Level:", irr::core::recti(elementPosition, elementSize)));
		elementPosition.Y += elementSeperation + elementSize.Height;
		_gameSettingsElements.push_back(in_guiEnv->addStaticText(L"Maze Width:", irr::core::recti(elementPosition, elementSize)));
		elementPosition.Y += elementSeperation + elementSize.Height;
		_gameSettingsElements.push_back(in_guiEnv->addStaticText(L"Maze Length:", irr::core::recti(elementPosition, elementSize)));
		elementPosition.Y += elementSeperation + elementSize.Height;

		//hide all menu elements
		setMenuEnabled(false, _mainMenuElements);
		setMenuEnabled(false, _gameSettingsElements);
		setMenuEnabled(false, _videoSettingsElements);
		_menuBackground->setVisible(false);
		_currentMenu = CurrentMenu::None;

		LOG(DEBUG) << "Finished initializing menu";
	}
Exemplo n.º 10
0
void HeadedTable::selectAll()
{
    for (int r = 0; r < nrows; r++)
        setSelected(r, true);
    emit selectionChanged(); // notwork?
}
Exemplo n.º 11
0
void DiveHandler::selfRemove()
{
	setSelected(true);
	ProfileWidget2 *view = qobject_cast<ProfileWidget2 *>(scene()->views().first());
	view->keyDeleteAction();
}
Exemplo n.º 12
0
// BottleNeck ?
void HeadedTable::selectOnlyOne(int row)
{
    // this apply to the current list only!
    for (int r = 0; r < nrows; r++)
        setSelected(r, r == row);
}
Exemplo n.º 13
0
//! called if an event happened.
bool CGUITextureCacheBrowser::OnEvent(const SEvent &event)
{
	switch(event.EventType)
	{
	case EET_GUI_EVENT:
		if (event.GUIEvent.EventType == EGET_ELEMENT_FOCUS_LOST)
		{
			if (event.GUIEvent.Caller == (IGUIElement*)this)
				Dragging = false;
			return true;
		}
		else
		if (event.GUIEvent.EventType == EGET_BUTTON_CLICKED)
		{
			if (event.GUIEvent.Caller == CloseButton)
			{
				remove();
				return true;
			}
		}
		break;
	case EET_MOUSE_INPUT_EVENT:
		switch(event.MouseInput.Event)
		{
		case EMIE_LMOUSE_PRESSED_DOWN:
			DragStart.X = event.MouseInput.X;
			DragStart.Y = event.MouseInput.Y;

			if (getElementFromPoint(DragStart) == this)
			{
				if (!Environment->hasFocus(this))
				{
					Dragging = IsDraggable;
					//Environment->setFocus(this);
					if (Parent)
						Parent->bringToFront(this);
				}
				return true;
			}
			else
			{
				if (Panel->getAbsolutePosition().isPointInside(DragStart))
				{
					// select an image
					IGUIElement* el = Panel->getElementFromPoint(DragStart);
					if (el && el != Panel)
					{
						if (el->getType() == EGUIET_IMAGE)
						{
							setSelected(el->getID());
						}
					}
					else
					{
						setSelected();
					}
				}
			}
			break;
		case EMIE_LMOUSE_LEFT_UP:
			Dragging = false;
			//Environment->removeFocus(this);
			return true;
		case EMIE_MOUSE_MOVED:
			if (Dragging)
			{
				// gui window should not be dragged outside its parent
				if (Parent)
					if (event.MouseInput.X < Parent->getAbsolutePosition().UpperLeftCorner.X +1 ||
						event.MouseInput.Y < Parent->getAbsolutePosition().UpperLeftCorner.Y +1 ||
						event.MouseInput.X > Parent->getAbsolutePosition().LowerRightCorner.X -1 ||
						event.MouseInput.Y > Parent->getAbsolutePosition().LowerRightCorner.Y -1)

						return true;


				move(core::position2d<s32>(event.MouseInput.X - DragStart.X, event.MouseInput.Y - DragStart.Y));
				DragStart.X = event.MouseInput.X;
				DragStart.Y = event.MouseInput.Y;
				return true;
			}
			break;
		default:
			break;
		}
	default:
		break;
	}

	return Parent ? Parent->OnEvent(event) : false;
}
Exemplo n.º 14
0
void pTabFrame::constructor() {
  qtWidget = qtTabFrame = new QTabWidget;
  connect(qtTabFrame, SIGNAL(currentChanged(int)), SLOT(onChange(int)));

  setSelected(tabFrame.state.selection);
}
Exemplo n.º 15
0
 void Tuning::focusOutEvent(QFocusEvent* event)
 {
   setSelected(false);
   QWidget::focusOutEvent(event);
 }
Exemplo n.º 16
0
void OSListItem::toggleSelected()
{
  setSelected( ! isSelected() );
}
Exemplo n.º 17
0
void AppletWidget::setOdd(bool odd)
{
    m_odd = odd;
    setSelected(m_selected);
}
Exemplo n.º 18
0
int QtTableSelectionManager::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0:
            currentChanged((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< int(*)>(_a[3])),(*reinterpret_cast< int(*)>(_a[4])));
            break;
        case 1:
            anchorChanged((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< int(*)>(_a[3])),(*reinterpret_cast< int(*)>(_a[4])));
            break;
        case 2:
            selectionsChanged((*reinterpret_cast< const QList<QtTableSelectionRange>(*)>(_a[1])));
            break;
        case 3:
            setCurrentCell((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])));
            break;
        case 4:
            setAnchorCell((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])));
            break;
        case 5:
            setSelected((*reinterpret_cast< const QtTableSelectionRange(*)>(_a[1])),(*reinterpret_cast< SelectionMode(*)>(_a[2])));
            break;
        case 6:
            setSelected((*reinterpret_cast< const QtTableSelectionRange(*)>(_a[1])));
            break;
        case 7:
            clearSelections();
            break;
        case 8:
            d_func()->_q_modelDestroyed();
            break;
        case 9:
            d_func()->_q_rowsInserted((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])));
            break;
        case 10:
            d_func()->_q_rowsRemoved((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])));
            break;
        case 11:
            d_func()->_q_columnsInserted((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])));
            break;
        case 12:
            d_func()->_q_columnsRemoved((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])));
            break;
        default:
            ;
        }
        _id -= 13;
    }
#ifndef QT_NO_PROPERTIES
    else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0:
            *reinterpret_cast< QtCell*>(_v) = currentCell();
            break;
        case 1:
            *reinterpret_cast< QtCell*>(_v) = anchorCell();
            break;
        case 2:
            *reinterpret_cast< bool*>(_v) = isAnchorSelectionActive();
            break;
        case 3:
            *reinterpret_cast< SelectionMode*>(_v) = selectionMode();
            break;
        }
        _id -= 4;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0:
            setCurrentCell(*reinterpret_cast< QtCell*>(_v));
            break;
        case 1:
            setAnchorCell(*reinterpret_cast< QtCell*>(_v));
            break;
        }
        _id -= 4;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 4;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 4;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 4;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 4;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 4;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 4;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
Exemplo n.º 19
0
/**
 * Toggles select on this entity.
 */
bool RS_Entity::toggleSelected() {
    return setSelected(!isSelected());
    //toggleFlag(RS2::FlagSelected);
}
Exemplo n.º 20
0
 void select(int index) { setSelected(index, true); }
void MismatchingConnectorWidget::mousePressEvent(QMouseEvent * event) {
	if(!isSelected()) {
		setSelected(true);
	}
	QFrame::mousePressEvent(event);
}
Exemplo n.º 22
0
 void unselect(int index) { setSelected(index, false); }
Exemplo n.º 23
0
void nineButtonSelector::button1Clicked()
{
	setSelected( 1 );
}
Exemplo n.º 24
0
bool wyNode::touchesCancelled(wyMotionEvent& e) {
    setSelected(false);
    return m_interceptTouch;
}
Exemplo n.º 25
0
void nineButtonSelector::button3Clicked()
{
	setSelected( 3 );
}
Exemplo n.º 26
0
void ComboBox::dropDownOk(Button& /*activator*/, int new_entry)
{
  dropdown->close();

  setSelected(new_entry);
}
Exemplo n.º 27
0
void nineButtonSelector::button5Clicked()
{
	setSelected( 5 );
}
Exemplo n.º 28
0
 /// Focus event used by TuningList to set current tuning for session
 void Tuning::focusInEvent(QFocusEvent* event)
 {
   setSelected(true);
   QWidget::focusInEvent(event);
 }
Exemplo n.º 29
0
void nineButtonSelector::button7Clicked()
{
	setSelected( 7 );
}
Exemplo n.º 30
0
	//! Remove all selected constellations.
	void deselect() {setSelected(NULL);}