Rocket::Core::ElementScroll Class Reference

#include <ElementScroll.h>

Inheritance diagram for Rocket::Core::ElementScroll:
Collaboration diagram for Rocket::Core::ElementScroll:

Public Types

enum  Orientation { VERTICAL = 0, HORIZONTAL = 1 }

Public Member Functions

 ElementScroll (Element *element)
void Update ()
 Updates the increment / decrement arrows.
void EnableScrollbar (Orientation orientation, float element_width)
void DisableScrollbar (Orientation orientation)
void UpdateScrollbar (Orientation orientation)
ElementGetScrollbar (Orientation orientation)
float GetScrollbarSize (Orientation orientation)
void FormatScrollbars ()
 Formats the enabled scrollbars based on the current size of the host element.

Protected Member Functions

void ProcessEvent (Event &event)
 Handles the 'onchange' events for the scrollbars.

Data Structures

struct  Scrollbar

Detailed Description

Manages an element's scrollbars and scrolling state.

Author:
Peter Curry

Member Function Documentation

void Rocket::Core::ElementScroll::EnableScrollbar ( Orientation  orientation,
float  element_width 
)

Enables and sizes one of the scrollbars.

Parameters:
[in] orientation Which scrollbar (vertical or horizontal) to enable.
[in] element_width The current computed width of the element, used only to resolve percentage properties.

void Rocket::Core::ElementScroll::DisableScrollbar ( Orientation  orientation  ) 

Disables and hides one of the scrollbars.

Parameters:
[in] orientation Which scrollbar (vertical or horizontal) to disable.

void Rocket::Core::ElementScroll::UpdateScrollbar ( Orientation  orientation  ) 

Updates the position of the scrollbar.

Parameters:
[in] orientation Which scrollbar (vertical or horizontal) to update).

Element * Rocket::Core::ElementScroll::GetScrollbar ( Orientation  orientation  ) 

Returns one of the scrollbar elements.

Parameters:
[in] orientation Which scrollbar to return.
Returns:
The requested scrollbar, or NULL if it does not exist.

float Rocket::Core::ElementScroll::GetScrollbarSize ( Orientation  orientation  ) 

Returns the size, in pixels, of one of the scrollbars; for a vertical scrollbar, this is width, for a horizontal scrollbar, this is height.

Parameters:
[in] orientation Which scrollbar (vertical or horizontal) to query.
Returns:
The size of the scrollbar, or 0 if the scrollbar is disabled.


The documentation for this class was generated from the following files: