예제 #1
0
파일: Button.cpp 프로젝트: bramstein/ui
	void Button::mouseReleased(const event::MouseEvent& e)
	{
		if(e.getButton() == event::MouseEvent::MOUSE_BUTTON2)
		{
			setSelected(false);
		}
	}
예제 #2
0
파일: Frame.cpp 프로젝트: DamnCoder/YAOMEV
	void CFrame::emitMouseEvent(event::MouseEvent mouseEvent){
		TMLterator
			it(_mouseListeners.begin()),
			end(_mouseListeners.end());

		for(;it!=end; ++it){
			switch(mouseEvent.getEvent()){

			case event::MouseEvent::MOUSE_PRESSED:
				(*it)->mousePressed(mouseEvent);
				break;

			case event::MouseEvent::MOUSE_RELEASED:
				(*it)->mouseReleased(mouseEvent);
				break;

			case event::MouseEvent::MOUSE_ENTERED:
				(*it)->mouseEntered(mouseEvent);
				break;

			case event::MouseEvent::MOUSE_EXITED:
				(*it)->mouseExited(mouseEvent);
				break;

			default:
				break;

			}
		}
	}
예제 #3
0
파일: Button.cpp 프로젝트: bramstein/ui
	void Button::mousePressed(const event::MouseEvent& e)
	{
		if(e.getButton() == event::MouseEvent::MOUSE_BUTTON2)
		{
			setSelected(true);
		}
	}
예제 #4
0
			void SliderTheme::mouseMotion(const event::MouseEvent &e)
			{
				Slider *slider = static_cast<Slider*>(e.getSource());
				if(slider->isAdjusting())
				{
					int x = e.getX() - slider->getLocationOnScreen().x;
					float distance = static_cast<float>((static_cast<float>(x) / static_cast<float>(slider->getBounds().width) * static_cast<float>(slider->getMaximum()-slider->getMinimum()) + static_cast<float>(slider->getMinimum())));
					slider->setValue(distance);
				}
				else
				{
					int y = e.getY() - slider->getLocationOnScreen().y;
					float distance = static_cast<float>((static_cast<float>(y) / static_cast<float>(slider->getBounds().height) * static_cast<float>(slider->getMaximum()-slider->getMinimum()) + static_cast<float>(slider->getMinimum())));
					slider->setValue(distance);
				}
			}
예제 #5
0
파일: Component.cpp 프로젝트: bramstein/ui
	void Component::processMouseEvent(const event::MouseEvent& e)
	{
		if(!isEnabled())
		{
			return;
		}

		event::MouseListenerList::iterator iterator;
								
		for(iterator = mouseListeners.begin(); iterator != mouseListeners.end(); ++iterator)
		{
			switch(e.getID())
			{
				case event::MouseEvent::MOUSE_PRESSED:
				{
					(*iterator)->mousePressed(e);
					break;
				}
				case event::MouseEvent::MOUSE_RELEASED:
				{
					(*iterator)->mouseReleased(e);
					break;
				}
				case event::MouseEvent::MOUSE_ENTERED:
				{
					(*iterator)->mouseEntered(e);
					break;
				}
				case event::MouseEvent::MOUSE_EXITED:
				{
					(*iterator)->mouseExited(e);
					break;
				}
				case event::MouseEvent::MOUSE_CLICKED:
				{
					(*iterator)->mouseClicked(e);
					break;
				}
				case event::MouseEvent::MOUSE_DRAGGED:
				{
					(*iterator)->mouseDragged(e);
					break;
				}
				case event::MouseEvent::MOUSE_MOTION:
				{
					(*iterator)->mouseMotion(e);
					break;
				}
			}
		}
	}
예제 #6
0
파일: Button.cpp 프로젝트: DamnCoder/YAOMEV
	void CButton::mouseReleased(const event::MouseEvent& e){
		if(e.getSource() == this)
			emitReleasedButton();
	}
예제 #7
0
파일: Button.cpp 프로젝트: DamnCoder/YAOMEV
	void CButton::mouseEntered(const event::MouseEvent& e){
		if(e.getSource() == this)
			emitHighlightedButton();
	}