9 #define m_scrollWidth 1
10 #define SCROLL_BAR_WIDTH 10
28 void positionScrollBars()
31 m_horizontal->
setSize(m_width - SCROLL_BAR_WIDTH, 1);
32 m_vertical->
setSize(1, m_height - SCROLL_BAR_WIDTH);
34 m_horizontal->setPosition(
Vector2(m_x, m_y+m_height-SCROLL_BAR_WIDTH));
37 Vector2 sz = calculateContentSize();
38 m_horizontal->setRange(
Vector2(0, MAX(m_width - SCROLL_BAR_WIDTH, sz.
x)));
43 ScrollPane(
unsigned int x,
unsigned int y,
unsigned int width,
60 Vector2 calculateValue() {
return getPosition() -
Vector2(floor(m_horizontal->getValue()), floor(m_vertical->
getValue())); }
63 Vector2 getSize() {
return Vector2(m_width - SCROLL_BAR_WIDTH, m_height - SCROLL_BAR_WIDTH); }
float y
Definition: Vector2.h:36
float x
Definition: Vector2.h:35
A Container organizes multiple Widgets into one to provide layout functionality.
Definition: Container.h:20