Pyrogenesis
13997
|
The GUI Scroll-bar, used everywhere there is a scroll-bar in the game. More...
#include <IGUIScrollBar.h>
Public Member Functions | |
IGUIScrollBar () | |
virtual | ~IGUIScrollBar () |
virtual void | Draw ()=0 |
Draw the scroll-bar. More... | |
virtual void | HandleMessage (SGUIMessage &Message)=0 |
If an object that contains a scrollbar has got messages, send them to the scroll-bar and it will see if the message regarded itself. More... | |
virtual void | SetPosFromMousePos (const CPos &mouse)=0 |
Set m_Pos with g_mouse_x/y input, i.e. More... | |
virtual bool | HoveringButtonMinus (const CPos &mouse) |
Hovering the scroll minus button. More... | |
virtual bool | HoveringButtonPlus (const CPos &mouse) |
Hovering the scroll plus button. More... | |
float | GetPos () const |
Get scroll-position. More... | |
virtual void | SetPos (float f) |
Set scroll-position by hand. More... | |
float | GetMaxPos () const |
Get the value of m_Pos that corresponds to the bottom of the scrollable region. More... | |
virtual void | ScrollPlus () |
Increase scroll one step. More... | |
virtual void | ScrollMinus () |
Decrease scroll one step. More... | |
virtual void | ScrollPlusPlenty () |
Increase scroll three steps. More... | |
virtual void | ScrollMinusPlenty () |
Decrease scroll three steps. More... | |
void | SetHostObject (IGUIScrollBarOwner *pOwner) |
Set host object, must be done almost at creation of scroll bar. More... | |
CGUI * | GetGUI () const |
Get GUI pointer. More... | |
void | SetGUI (CGUI *pGUI) |
Set GUI pointer. More... | |
void | SetWidth (float width) |
Set Width. More... | |
void | SetX (float x) |
Set X Position. More... | |
void | SetY (float y) |
Set Y Position. More... | |
void | SetZ (float z) |
Set Z Position. More... | |
void | SetLength (float length) |
Set Length of scroll bar. More... | |
void | SetScrollRange (float range) |
Set content length. More... | |
void | SetScrollSpace (float space) |
Set space that is visible in the scrollable control. More... | |
void | SetBarPressed (bool b) |
Set bar pressed. More... | |
void | SetUseEdgeButtons (bool b) |
Set use edge buttons. More... | |
void | SetScrollBarStyle (const CStr &style) |
Set Scroll bar style string. More... | |
const SGUIScrollBarStyle * | GetStyle () const |
Get style used by the scrollbar. More... | |
virtual CRect | GetBarRect () const =0 |
Get the rectangle of the actual BAR. More... | |
virtual CRect | GetOuterRect () const =0 |
Get the rectangle of the outline of the scrollbar, every component of the scroll-bar should be inside this area. More... | |
Protected Member Functions | |
void | SetupBarSize () |
Sets up bar size. More... | |
void | UpdatePosBoundaries () |
Call every time m_Pos has been updated. More... | |
Protected Attributes | |
Settings | |
bool | m_UseEdgeButtons |
True if you want edge buttons, i.e. More... | |
float | m_Width |
Width of the scroll bar. More... | |
float | m_X |
Absolute X Position. More... | |
float | m_Y |
Absolute Y Position. More... | |
float | m_Z |
Absolute Z Position. More... | |
float | m_Length |
Total length of scrollbar, including edge buttons. More... | |
float | m_ScrollRange |
Content that can be scrolled, in pixels. More... | |
float | m_ScrollSpace |
Content that can be viewed at a time, in pixels. More... | |
float | m_BarSize |
Use input from the scroll-wheel? True or false. More... | |
CStr | m_ScrollBarStyle |
Scroll bar style reference name. More... | |
SGUIScrollBarStyle * | m_pStyle |
Pointer to scroll bar style used. More... | |
IGUIScrollBarOwner * | m_pHostObject |
Host object, prerequisite! More... | |
CGUI * | m_pGUI |
Reference to CGUI object, these cannot work stand-alone. More... | |
CPos | m_BarPressedAtPos |
Mouse position when bar was pressed. More... | |
States | |
bool | m_BarPressed |
If the bar is currently being pressed and dragged. More... | |
bool | m_BarHovered |
Bar being hovered or not. More... | |
bool | m_ButtonMinusHovered |
Scroll buttons hovered. More... | |
bool | m_ButtonPlusHovered |
bool | m_ButtonMinusPressed |
Scroll buttons pressed. More... | |
bool | m_ButtonPlusPressed |
float | m_Pos |
Position of scroll bar, 0 means scrolled all the way to one side. More... | |
float | m_PosWhenPressed |
Position from 0.f to 1.f it had when the bar was pressed. More... | |
The GUI Scroll-bar, used everywhere there is a scroll-bar in the game.
To include a scroll-bar to an object, inherent the object from IGUIScrollBarOwner and call AddScrollBar() to add the scroll-bars.
It's also important that the scrollbar is located within the parent object's mouse over area. Otherwise the input won't be sent to the scroll-bar.
The class does not provide all functionality to the scroll-bar, many things the parent of the scroll-bar, must provide. Like a combo-box.
Definition at line 156 of file IGUIScrollBar.h.
IGUIScrollBar::IGUIScrollBar | ( | ) |
Definition at line 30 of file IGUIScrollBar.cpp.
|
virtual |
Definition at line 45 of file IGUIScrollBar.cpp.
|
pure virtual |
Draw the scroll-bar.
Implemented in CGUIScrollBarVertical.
|
pure virtual |
Get the rectangle of the actual BAR.
not the whole scroll-bar.
Implemented in CGUIScrollBarVertical.
CGUI * IGUIScrollBar::GetGUI | ( | ) | const |
|
inline |
Get the value of m_Pos that corresponds to the bottom of the scrollable region.
Definition at line 211 of file IGUIScrollBar.h.
|
pure virtual |
Get the rectangle of the outline of the scrollbar, every component of the scroll-bar should be inside this area.
Implemented in CGUIScrollBarVertical.
|
inline |
Get scroll-position.
Definition at line 201 of file IGUIScrollBar.h.
const SGUIScrollBarStyle * IGUIScrollBar::GetStyle | ( | ) | const |
Get style used by the scrollbar.
Definition at line 72 of file IGUIScrollBar.cpp.
|
pure virtual |
If an object that contains a scrollbar has got messages, send them to the scroll-bar and it will see if the message regarded itself.
Implemented in CGUIScrollBarVertical.
Definition at line 98 of file IGUIScrollBar.cpp.
|
inlinevirtual |
Hovering the scroll minus button.
mouse | current mouse position |
Reimplemented in CGUIScrollBarVertical.
Definition at line 188 of file IGUIScrollBar.h.
|
inlinevirtual |
Hovering the scroll plus button.
mouse | current mouse position |
Reimplemented in CGUIScrollBarVertical.
Definition at line 196 of file IGUIScrollBar.h.
|
inlinevirtual |
Decrease scroll one step.
Definition at line 221 of file IGUIScrollBar.h.
|
inlinevirtual |
Decrease scroll three steps.
Definition at line 231 of file IGUIScrollBar.h.
|
inlinevirtual |
Increase scroll one step.
Definition at line 216 of file IGUIScrollBar.h.
|
inlinevirtual |
Increase scroll three steps.
Definition at line 226 of file IGUIScrollBar.h.
|
inline |
|
inline |
Set GUI pointer.
pGUI | pointer to CGUI object. |
Definition at line 249 of file IGUIScrollBar.h.
|
inline |
Set host object, must be done almost at creation of scroll bar.
pOwner | Pointer to host object. |
Definition at line 237 of file IGUIScrollBar.h.
|
inline |
|
inlinevirtual |
Set scroll-position by hand.
Definition at line 206 of file IGUIScrollBar.h.
|
pure virtual |
|
inline |
Set Scroll bar style string.
style | String with scroll bar style reference name |
Definition at line 309 of file IGUIScrollBar.h.
|
inline |
Set content length.
range | Maximum scrollable range |
Definition at line 285 of file IGUIScrollBar.h.
|
inline |
Set space that is visible in the scrollable control.
space | Visible area in the scrollable control. |
Definition at line 291 of file IGUIScrollBar.h.
|
protected |
Sets up bar size.
Definition at line 49 of file IGUIScrollBar.cpp.
|
inline |
Set use edge buttons.
b | True if edge buttons should be used |
Definition at line 303 of file IGUIScrollBar.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
protected |
Call every time m_Pos has been updated.
Definition at line 88 of file IGUIScrollBar.cpp.
|
protected |
Bar being hovered or not.
Definition at line 433 of file IGUIScrollBar.h.
|
protected |
If the bar is currently being pressed and dragged.
Definition at line 428 of file IGUIScrollBar.h.
|
protected |
Mouse position when bar was pressed.
Definition at line 417 of file IGUIScrollBar.h.
|
protected |
Use input from the scroll-wheel? True or false.
Definition at line 392 of file IGUIScrollBar.h.
|
protected |
Scroll buttons hovered.
Definition at line 438 of file IGUIScrollBar.h.
|
protected |
Scroll buttons pressed.
Definition at line 443 of file IGUIScrollBar.h.
|
protected |
Definition at line 438 of file IGUIScrollBar.h.
|
protected |
Definition at line 443 of file IGUIScrollBar.h.
|
protected |
Total length of scrollbar, including edge buttons.
Definition at line 377 of file IGUIScrollBar.h.
|
protected |
Reference to CGUI object, these cannot work stand-alone.
Definition at line 412 of file IGUIScrollBar.h.
|
protected |
Host object, prerequisite!
Definition at line 407 of file IGUIScrollBar.h.
|
protected |
Position of scroll bar, 0 means scrolled all the way to one side.
It is measured in pixels, it is up to the host to make it actually apply in pixels.
Definition at line 450 of file IGUIScrollBar.h.
|
protected |
Position from 0.f to 1.f it had when the bar was pressed.
Definition at line 455 of file IGUIScrollBar.h.
|
protected |
Pointer to scroll bar style used.
Definition at line 402 of file IGUIScrollBar.h.
|
protected |
Scroll bar style reference name.
Definition at line 397 of file IGUIScrollBar.h.
|
protected |
Content that can be scrolled, in pixels.
Definition at line 382 of file IGUIScrollBar.h.
|
protected |
Content that can be viewed at a time, in pixels.
Definition at line 387 of file IGUIScrollBar.h.
|
protected |
True if you want edge buttons, i.e.
buttons that can be pressed in order to scroll.
Definition at line 352 of file IGUIScrollBar.h.
|
protected |
Width of the scroll bar.
Definition at line 357 of file IGUIScrollBar.h.
|
protected |
Absolute X Position.
Definition at line 362 of file IGUIScrollBar.h.
|
protected |
Absolute Y Position.
Definition at line 367 of file IGUIScrollBar.h.
|
protected |
Absolute Z Position.
Definition at line 372 of file IGUIScrollBar.h.