1 #ifndef PANELSCROLLED_HPP 2 #define PANELSCROLLED_HPP 11 virtual bool update(sf::Vector2f mp,
bool pressLeft,
bool pressRight,
bool aboveHover);
12 virtual void draw(sf::RenderTarget& target, sf::RenderStates states);
13 virtual void updateArea();
15 bool addScroll(
float delta, Orientation type);
16 void centerScroll(sf::Vector2f position);
18 void setVerticalScrollVelocityMultiplier(
float value);
19 void setHorizontalScrollVelocityMultiplier(
float value);
20 void setVerticalScrollBrakeMultiplier(
float value);
21 void setHorizontalScrollBrakeMultiplier(
float value);
22 static bool notifyScroll(
float delta, Orientation type);
23 const float scrollVisibleTime = 2.f;
24 void setScrollType(ScrollType value);
25 void setScrollEnable(ScrollEnable value);
26 void setScrollButtonThick(
float value);
27 void setScrollButtonSize(
float value);
28 std::pair<float, float> getVerticalScrollLimits()
const;
29 std::pair<float, float> getHorizontalScrollLimits()
const;
30 sf::Vector2f getScrollSize()
const;
32 const Button& getVerticalScrollButton()
const;
33 const Button& getHorizontalScrollButton()
const;
34 const Panel& getVerticalScrollPanel()
const;
35 const Panel& getHorizontalScrollPanel()
const;
38 Button verticalScrollButton;
39 Button horizontalScrollButton;
40 Panel verticalScrollPanel;
41 Panel horizontalScrollPanel;
43 sf::Vector2f scrollSize;
44 sf::Vector2f scrollVelocity;
45 sf::FloatRect insideRelativeArea;
46 std::pair<float, float> verticalLimits;
47 std::pair<float, float> horizontalLimits;
48 float scrollVisibleTimer;
49 float verticalScrollWakeTimer;
50 float horizontalScrollWakeTimer;
51 float verticalScrollVelocityMultiplier;
52 float horizontalScrollVelocityMultiplier;
53 float verticalScrollBrakeMultiplier;
54 float horizontalScrollBrakeMultiplier;
57 ScrollType scrollType;
58 ScrollEnable scrollEnable;
61 const float scrollSizeThreshold = 1.5f;
64 void updateVerticalLimits();
65 bool updateAreaInternal();
68 typedef std::shared_ptr<PanelScrolled> PanelScrolledPtr;
70 #endif // PANELSCROLLED_HPP