mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	move to EventReceiver
This commit is contained in:
		| @@ -258,16 +258,6 @@ void CIntObject::redraw() | ||||
| 	} | ||||
| } | ||||
|  | ||||
| void CIntObject::clickPressed(const Point & cursorPosition, bool lastActivated) | ||||
| { | ||||
| 	AEventsReceiver::clickPressed(cursorPosition); | ||||
| } | ||||
|  | ||||
| void CIntObject::clickReleased(const Point & cursorPosition, bool lastActivated) | ||||
| { | ||||
| 	AEventsReceiver::clickReleased(cursorPosition); | ||||
| } | ||||
|  | ||||
| bool CIntObject::receiveEvent(const Point & position, int eventType) const | ||||
| { | ||||
| 	return pos.isInside(position); | ||||
|   | ||||
| @@ -98,11 +98,6 @@ public: | ||||
| 	void showAll(Canvas & to) override; | ||||
| 	//request complete redraw of this object | ||||
| 	void redraw() override; | ||||
|  | ||||
| 	// events are overloaded | ||||
| 	void clickPressed(const Point & cursorPosition, bool lastActivated) override; | ||||
| 	void clickReleased(const Point & cursorPosition, bool lastActivated) override; | ||||
|  | ||||
| 	/// returns true if this element is a popup window | ||||
| 	/// called only for windows | ||||
| 	bool isPopupWindow() const override; | ||||
|   | ||||
| @@ -68,3 +68,13 @@ void AEventsReceiver::deactivateEvents(ui16 what) | ||||
| //	if (!(activeState & HOVER)) | ||||
| //		hoveredState = false; | ||||
| } | ||||
|  | ||||
| void AEventsReceiver::clickPressed(const Point & cursorPosition, bool lastActivated) | ||||
| { | ||||
| 	clickPressed(cursorPosition); | ||||
| } | ||||
|  | ||||
| void AEventsReceiver::clickReleased(const Point & cursorPosition, bool lastActivated) | ||||
| { | ||||
| 	clickReleased(cursorPosition); | ||||
| } | ||||
|   | ||||
| @@ -45,8 +45,8 @@ protected: | ||||
| public: | ||||
| 	virtual void clickPressed(const Point & cursorPosition) {} | ||||
| 	virtual void clickReleased(const Point & cursorPosition) {} | ||||
| 	virtual void clickPressed(const Point & cursorPosition, bool lastActivated) {} | ||||
| 	virtual void clickReleased(const Point & cursorPosition, bool lastActivated) {} | ||||
| 	virtual void clickPressed(const Point & cursorPosition, bool lastActivated); | ||||
| 	virtual void clickReleased(const Point & cursorPosition, bool lastActivated); | ||||
| 	virtual void clickCancel(const Point & cursorPosition) {} | ||||
| 	virtual void showPopupWindow(const Point & cursorPosition) {} | ||||
| 	virtual void clickDouble(const Point & cursorPosition) {} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user