Jelajahi Sumber

Wipe unused ClickableArea

AlexVinS 9 tahun lalu
induk
melakukan
f11c54b5e9
2 mengubah file dengan 0 tambahan dan 58 penghapusan
  1. 0 33
      client/widgets/Buttons.cpp
  2. 0 25
      client/widgets/Buttons.h

+ 0 - 33
client/widgets/Buttons.cpp

@@ -24,39 +24,6 @@
  *
  */
 
-ClickableArea::ClickableArea(CIntObject * object, CFunctionList<void()> callback):
-	callback(callback),
-	area(nullptr)
-{
-	if (object)
-		pos = object->pos;
-	setArea(object);
-}
-
-void ClickableArea::addCallback(std::function<void()> callback)
-{
-	this->callback += callback;
-}
-
-void ClickableArea::setArea(CIntObject * object)
-{
-	delete area;
-	area = object;
-	addChild(area);
-	pos.w = object->pos.w;
-	pos.h = object->pos.h;
-}
-
-void ClickableArea::onClick()
-{
-	callback();
-}
-
-void ClickableArea::clickLeft(tribool down, bool previousState)
-{
-	if (down)
-		onClick();
-}
 
 void CButton::update()
 {

+ 0 - 25
client/widgets/Buttons.h

@@ -26,24 +26,6 @@ namespace config
  *
  */
 
-class ClickableArea : public CIntObject //TODO: derive from LRCLickableArea? Or somehow use its right-click/hover data?
-{
-	CFunctionList<void()> callback;
-
-	CIntObject * area;
-
-protected:
-	void onClick();
-
-public:
-	ClickableArea(CIntObject * object, CFunctionList<void()> callback);
-
-	void addCallback(std::function<void()> callback);
-	void setArea(CIntObject * object);
-
-	void clickLeft(tribool down, bool previousState) override;
-};
-
 /// Typical Heroes 3 button which can be inactive or active and can
 /// hold further information if you right-click it
 class CButton : public CKeyShortcut
@@ -151,13 +133,6 @@ public:
 	void addCallback(std::function<void(bool)> callback);
 };
 
-class ClickableToggle : public ClickableArea, public CToggleBase
-{
-public:
-	ClickableToggle(CIntObject * object, CFunctionList<void()> selectFun, CFunctionList<void()> deselectFun);
-	void clickLeft(tribool down, bool previousState) override;
-};
-
 /// A button which can be selected/deselected, checkbox
 class CToggleButton : public CButton, public CToggleBase
 {