Entire Class Index | Main Class Index | Cross Index | Global Index

# Class CL_ScrollBar

ScrollBar component
Contained in: global
Derived from: CL_Component
Derived by: none
Group: GUI (Controls)

#include <ClanLib/gui.h>

### public function member index:

### Construction:

`` | `CL_ScrollBar` | `(`CL_Component`* `parent`, `CL_StyleManager`* `style` = NULL)`;
`` | `CL_ScrollBar` | `(`int` `min`, `int` `max`, `bool` `orientation`, `CL_Component`* `parent`, `CL_StyleManager`* `style` = NULL)`;
`` | `CL_ScrollBar` | `(`bool` `orientation`, `CL_Component`* `parent`, `CL_StyleManager`* `style` = NULL)`;
`` | `CL_ScrollBar` | `(`const` `CL_Rect`& `pos`, `int` `min`, `int` `max`, `bool` `orientation`, `CL_Component`* `parent`, `CL_StyleManager`* `style` = NULL)`;
`` | `CL_ScrollBar` | `(`const` `CL_Rect`& `pos`, `bool` `orientation`, `CL_Component`* `parent`, `CL_StyleManager`* `style` = NULL)`;
``virtual`` | `~CL_ScrollBar` | `()`;

### Attributes:

``CL_Component`*` | `get_client_area` | `() `const``;
``bool`` | `is_vertical` | `() `const``;
``bool`` | `is_tracking` | `() `const``;
``int`` | `get_min_value` | `() `const``;
``int`` | `get_max_value` | `() `const``;
``int`` | `get_range` | `() `const``;
``int`` | `get_value` | `() `const``;
``bool`` | `is_dragging_slider` | `() `const``;
``bool`` | `is_fixed_length_slider` | `() `const``;
``CL_Rect`&` | `get_slider_rect` | `() `const``;
``int`` | `get_min_slider_length` | `() `const``;

### Operations:

``void`` | `set_fixed_length_mode` | `(`bool` `enabel` = true)`;
``void`` | `set_slider_length` | `(`int` `length`)`;
``void`` | `set_min_slider_length` | `(`int` `length`)`;
``void`` | `set_vertical` | `(`bool` `enable` = true)`;
``void`` | `set_tracking` | `(`bool` `enable` = true)`;
``void`` | `set_range` | `(`int` `min_value`, `int` `max_value`)`;
``void`` | `set_min_value` | `(`int` `value`)`;
``void`` | `set_max_value` | `(`int` `value`)`;
``void`` | `set_value` | `(`int` `value`)`;
``void`` | `increase` | `(`int` `step` = 1)`;
``void`` | `decrease` | `(`int` `step` = 1)`;

### Signals:

``CL_Signal_v1`<`int`>&` | `sig_value_changed` | `()`;
``CL_Signal_v0`&` | `sig_slider_pressed` | `()`;
``CL_Signal_v1`<`int`>&` | `sig_slider_moved` | `()`;
``CL_Signal_v0`&` | `sig_slider_released` | `()`;

### private function member index:

### Implementation:

`` | `CL_ScrollBar` | `(`const` `CL_ScrollBar`& `copy`)`;

## Description:

## Function Member Descriptions:

CL_ScrollBar::CL_ScrollBar - ScrollBar Constructor
`` `CL_ScrollBar` `(`CL_Component`* `parent`, `CL_StyleManager`* `style` = NULL)`;

CL_ScrollBar::CL_ScrollBar - ScrollBar Constructor
`` `CL_ScrollBar` `(`int` `min`, `int` `max`, `bool` `orientation`, `CL_Component`* `parent`, `CL_StyleManager`* `style` = NULL)`;

> Orientation = false: Vertical scrollbar
> Orientation = true: Hortizonal scrollbar

CL_ScrollBar::CL_ScrollBar - ScrollBar Constructor
`` `CL_ScrollBar` `(`bool` `orientation`, `CL_Component`* `parent`, `CL_StyleManager`* `style` = NULL)`;

> Orientation = false: Vertical scrollbar
> Orientation = true: Hortizonal scrollbar

CL_ScrollBar::CL_ScrollBar - ScrollBar Constructor
`` `CL_ScrollBar` `(`const` `CL_Rect`& `pos`, `int` `min`, `int` `max`, `bool` `orientation`, `CL_Component`* `parent`, `CL_StyleManager`* `style` = NULL)`;

> Orientation = false: Vertical scrollbar
> Orientation = true: Hortizonal scrollbar

CL_ScrollBar::CL_ScrollBar - ScrollBar Constructor
`` `CL_ScrollBar` `(`const` `CL_Rect`& `pos`, `bool` `orientation`, `CL_Component`* `parent`, `CL_StyleManager`* `style` = NULL)`;

> Orientation = false: Vertical scrollbar
> Orientation = true: Hortizonal scrollbar

CL_ScrollBar::decrease - Decreases current value with step.
``void`` `decrease` `(`int` `step` = 1)`;

CL_ScrollBar::get_client_area - Returns the client area of the component.
``CL_Component`*` `get_client_area` `() `const``;

CL_ScrollBar::get_max_value - Returns the current max value.
``int`` `get_max_value` `() `const``;

CL_ScrollBar::get_min_slider_length - Returns the minimum size of the slider.
Only usable in variable-length sliders.
``int`` `get_min_slider_length` `() `const``;

CL_ScrollBar::get_min_value - Returns the current min value.
``int`` `get_min_value` `() `const``;

CL_ScrollBar::get_range - Returns the range (delta max-min).
``int`` `get_range` `() `const``;

CL_ScrollBar::get_slider_rect - Returns the scroll bar slider rectangle.
``CL_Rect`&` `get_slider_rect` `() `const``;

CL_ScrollBar::get_value - Returns the current range control value.
``int`` `get_value` `() `const``;

CL_ScrollBar::increase - Increases current value with step.
``void`` `increase` `(`int` `step` = 1)`;

CL_ScrollBar::is_dragging_slider - Returns true if the user has clicked the mouse on the slider and is currently dragging it, or false if not.
``bool`` `is_dragging_slider` `() `const``;

CL_ScrollBar::is_fixed_length_slider - Returns true if this is a fixed length slider, false otherwise.
``bool`` `is_fixed_length_slider` `() `const``;

CL_ScrollBar::is_tracking - Returns true if tracking is enabled, or false if tracking is disabled.
Tracking is initially enabled. See set_tracking for more info on tracking.
``bool`` `is_tracking` `() `const``;

CL_ScrollBar::is_vertical - Returns the orientation of the scroll bar.
``bool`` `is_vertical` `() `const``;

> Return true if scrollbar is vertical, false otherwise.

CL_ScrollBar::set_fixed_length_mode - Sets the length-mode of the slider.
``void`` `set_fixed_length_mode` `(`bool` `enabel` = true)`;

> If enable is true, the slider is constant in size. (See set_slider_length()).
> If enable is false, the slider is resized automatically based on the range.

CL_ScrollBar::set_max_value - Sets the range to end at value.
If current maximum value is less than the minvalue, maxvalue is set to minvalue.
``void`` `set_max_value` `(`int` `value`)`;

CL_ScrollBar::set_min_slider_length - Sets the minimum size of the slider.
Only usable in variable-length sliders.
``void`` `set_min_slider_length` `(`int` `length`)`;

CL_ScrollBar::set_min_value - Sets the range to start from value.
If current maximum value is less than the minvalue, maxvalue is set to minvalue.
``void`` `set_min_value` `(`int` `value`)`;

CL_ScrollBar::set_range - Sets the range between min_value and max_value.
If max_value is smaller than min_value, max_value is set to min_value.
``void`` `set_range` `(`int` `min_value`, `int` `max_value`)`;

CL_ScrollBar::set_slider_length - Sets the current size of the slider.
Only usable in fixed-length sliders.
``void`` `set_slider_length` `(`int` `length`)`;

CL_ScrollBar::set_tracking - Enables scroll bar tracking if enable is true, or disables tracking if enable is false.
If tracking is enabled (the default), the scroll bar emits the sig_value_changed() signal while the slider is being dragged. If tracking is disabled, the scroll bar emits the sig_value_changed() only when the user releases the mouse button after moving the slider.
``void`` `set_tracking` `(`bool` `enable` = true)`;

CL_ScrollBar::set_value - Sets the range controls value to value and forces it to be within the legal range.
``void`` `set_value` `(`int` `value`)`;

CL_ScrollBar::set_vertical - Sets the scroll bar orientation to vertical if enable is true, horizontal otherwise.
``void`` `set_vertical` `(`bool` `enable` = true)`;

CL_ScrollBar::sig_slider_moved - This signal is emitted when the slider is moved by the user, with the new scroll bar value as an argument.
This signal is emitted even when tracking is turned off.
``CL_Signal_v1`<`int`>&` `sig_slider_moved` `()`;

CL_ScrollBar::sig_slider_pressed - This signal is emitted when the user presses the slider with the mouse.
``CL_Signal_v0`&` `sig_slider_pressed` `()`;

CL_ScrollBar::sig_slider_released - This signal is emitted when the user releases the slider with the mouse.
``CL_Signal_v0`&` `sig_slider_released` `()`;

CL_ScrollBar::sig_value_changed - This signal is emitted when the scroll bar value has changed, with the new scroll bar value as an argument.
See set_tracking() for specifics on this signal.
``CL_Signal_v1`<`int`>&` `sig_value_changed` `()`;

CL_ScrollBar::~CL_ScrollBar - ScrollBar Destructor
``virtual`` `~CL_ScrollBar` `()`;

## Variable Member Descriptions: