From f11c54b5e92f277ca0f9bdc27b45f3b496629ac0 Mon Sep 17 00:00:00 2001 From: AlexVinS Date: Sun, 27 Nov 2016 16:07:03 +0300 Subject: [PATCH] Wipe unused ClickableArea --- client/widgets/Buttons.cpp | 33 --------------------------------- client/widgets/Buttons.h | 25 ------------------------- 2 files changed, 58 deletions(-) diff --git a/client/widgets/Buttons.cpp b/client/widgets/Buttons.cpp index d53561b5b..8784e0d1a 100644 --- a/client/widgets/Buttons.cpp +++ b/client/widgets/Buttons.cpp @@ -24,39 +24,6 @@ * */ -ClickableArea::ClickableArea(CIntObject * object, CFunctionList callback): - callback(callback), - area(nullptr) -{ - if (object) - pos = object->pos; - setArea(object); -} - -void ClickableArea::addCallback(std::function 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() { diff --git a/client/widgets/Buttons.h b/client/widgets/Buttons.h index f35bb0b9c..afe35bb35 100644 --- a/client/widgets/Buttons.h +++ b/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 callback; - - CIntObject * area; - -protected: - void onClick(); - -public: - ClickableArea(CIntObject * object, CFunctionList callback); - - void addCallback(std::function 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 callback); }; -class ClickableToggle : public ClickableArea, public CToggleBase -{ -public: - ClickableToggle(CIntObject * object, CFunctionList selectFun, CFunctionList deselectFun); - void clickLeft(tribool down, bool previousState) override; -}; - /// A button which can be selected/deselected, checkbox class CToggleButton : public CButton, public CToggleBase {