2022-08-01 11:18:03 -04:00
|
|
|
#pragma once
|
|
|
|
|
2022-08-02 06:17:26 -04:00
|
|
|
#include <Geode/Bindings.hpp>
|
2022-08-01 11:18:03 -04:00
|
|
|
|
|
|
|
namespace geode {
|
|
|
|
class GEODE_DLL Scrollbar :
|
|
|
|
public cocos2d::CCLayer
|
|
|
|
// public ExtMouseDelegate
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
CCScrollLayerExt* m_target = nullptr;
|
|
|
|
cocos2d::extension::CCScale9Sprite* m_track;
|
|
|
|
cocos2d::extension::CCScale9Sprite* m_thumb;
|
|
|
|
cocos2d::CCPoint m_clickOffset;
|
|
|
|
float m_width;
|
|
|
|
bool m_resizeThumb;
|
|
|
|
bool m_trackIsRotated;
|
|
|
|
bool m_hoverHighlight;
|
|
|
|
|
|
|
|
// bool mouseDownExt(MouseEvent, cocos2d::CCPoint const&) override;
|
|
|
|
// bool mouseUpExt(MouseEvent, cocos2d::CCPoint const&) override;
|
|
|
|
// void mouseMoveExt(cocos2d::CCPoint const&) override;
|
|
|
|
void scrollWheel(float y, float x) override;
|
|
|
|
|
|
|
|
void draw() override;
|
|
|
|
|
|
|
|
bool init(CCScrollLayerExt*);
|
|
|
|
|
|
|
|
public:
|
|
|
|
void setTarget(CCScrollLayerExt* list);
|
|
|
|
|
|
|
|
static Scrollbar* create(CCScrollLayerExt* list);
|
|
|
|
};
|
|
|
|
}
|