Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

scrollbar.cpp

Go to the documentation of this file.
00001 /*
00002         ClanGUI, copyrights by various people. Have a look in the CREDITS file.
00003         
00004         This sourcecode is distributed using the Library GNU Public Licence,
00005         version 2 or (at your option) any later version. Please read LICENSE
00006         for details.
00007 */
00008 
00009 #include "precomp.h"
00010 #include "API/GUI/scrollbar.h"
00011 #include "API/GUI/component_options.h"
00012 #include "API/GUI/stylemanager.h"
00013 #include "scrollbar_generic.h"
00014 
00016 // CL_ScrollBar construction:
00017 
00018 CL_ScrollBar::CL_ScrollBar(
00019         const CL_ComponentOptions &options,
00020         CL_Component *parent,
00021         CL_StyleManager *style)
00022 :
00023         CL_Component(options, parent, style),
00024         impl(NULL)
00025 {
00026         impl = new CL_ScrollBar_Generic(this, options, get_style_manager());
00027         get_style_manager()->connect_styles("scrollbar", options, this);
00028 }
00029 
00030 CL_ScrollBar::CL_ScrollBar(
00031         const CL_Rect &pos,
00032         int min,
00033         int max,
00034         bool orientation,
00035         CL_Component *parent,
00036         CL_StyleManager *style)
00037 :
00038         CL_Component(
00039                 CL_ScrollBar_Generic::create_options(pos, min, max, 0, orientation, false),
00040                 parent,
00041                 style),
00042         impl(NULL)
00043 {
00044         CL_ComponentOptions options = CL_ScrollBar_Generic::create_options(pos, min, max, 0, orientation, false);
00045         impl = new CL_ScrollBar_Generic(this, options, get_style_manager());
00046         get_style_manager()->connect_styles("scrollbar", options, this);
00047 }
00048 
00049 CL_ScrollBar::~CL_ScrollBar()
00050 {
00051         delete impl;
00052 }
00053 
00055 // Attributes:
00056 
00057 CL_Component *CL_ScrollBar::get_client_area() const
00058 {
00059         return impl->client_area;
00060 }
00061 
00062 bool CL_ScrollBar::is_vertical() const
00063 {
00064         return impl->vertical;
00065 }
00066 
00067 bool CL_ScrollBar::is_tracking() const
00068 {
00069         return impl->tracking;
00070 }
00071 
00072 int CL_ScrollBar::get_min_value() const
00073 {
00074         return impl->min_value;
00075 }
00076 
00077 int CL_ScrollBar::get_max_value() const
00078 {
00079         return impl->max_value;
00080 }
00081 
00082 int CL_ScrollBar::get_value() const
00083 {
00084         return impl->cur_value;
00085 }
00086 
00087 int CL_ScrollBar::get_range() const
00088 {
00089         return impl->get_range();
00090 }
00091 
00092 bool CL_ScrollBar::is_dragging_slider() const
00093 {
00094         return impl->dragging;
00095 }
00096 
00097 CL_Rect &CL_ScrollBar::get_slider_rect() const
00098 {
00099         return impl->rect_slider;
00100 }
00101 
00102 bool CL_ScrollBar::is_fixed_length_slider() const
00103 {
00104         return impl->fixed_length;
00105 }
00106 
00108 // Operations:
00109 
00110 void CL_ScrollBar::set_vertical(bool enable)
00111 {
00112         impl->set_vertical(enable);
00113 }
00114 
00115 void CL_ScrollBar::set_tracking(bool enable)
00116 {
00117         impl->tracking = enable;
00118 }
00119 
00120 void CL_ScrollBar::set_min_value(int value)
00121 {
00122         impl->set_min_value(value);
00123 }
00124 
00125 void CL_ScrollBar::set_max_value(int value)
00126 {
00127         impl->set_max_value(value);
00128 }
00129 
00130 void CL_ScrollBar::set_value(int value)
00131 {
00132         impl->set_value(value);
00133 }
00134 
00135 void CL_ScrollBar::increase(int step)
00136 {
00137         impl->set_value(impl->cur_value + step);
00138 }
00139 
00140 void CL_ScrollBar::decrease(int step)
00141 {
00142         impl->set_value(impl->cur_value - step);
00143 }
00144 
00145 void CL_ScrollBar::set_fixed_length_slider(bool fixed_length)
00146 {
00147         impl->fixed_length = true;
00148 }
00149 
00150 void CL_ScrollBar::set_slider_length(int length)
00151 {
00152         impl->slider_length = length;
00153 }
00154 
00156 // Signals:
00157 
00158 CL_Signal_v1<int> &CL_ScrollBar::sig_value_changed()
00159 {
00160         return impl->sig_value_changed;
00161 }
00162 
00163 CL_Signal_v0 &CL_ScrollBar::sig_slider_pressed()
00164 {
00165         return impl->sig_slider_pressed;
00166 }
00167 
00168 CL_Signal_v1<int> &CL_ScrollBar::sig_slider_moved()
00169 {
00170         return impl->sig_value_changed;
00171 }
00172 
00173 CL_Signal_v0 &CL_ScrollBar::sig_slider_released()
00174 {
00175         return impl->sig_slider_released;
00176 }
00177 
00178 
00179 
00180 
00181 
00182 
00183 
00184 
00185 
00186 
00187 /*
00188 
00189 void CL_ScrollBar::set_drag_offset_x(int new_offset_x)
00190 {
00191         impl->drag_offset_x = new_offset_x;
00192 }
00193 
00194 void CL_ScrollBar::set_drag_offset_y(int new_offset_y)
00195 {
00196         impl->drag_offset_y = new_offset_y;
00197 }
00198 
00199 void CL_ScrollBar::set_drag_rect(const CL_Rect &new_rect)
00200 {
00201         impl->drag_rect = new_rect;
00202 }
00203 
00204 int CL_ScrollBar::get_drag_offset_x() const
00205 {
00206         return impl->drag_offset_x;
00207 }
00208 
00209 int CL_ScrollBar::get_drag_offset_y() const
00210 {
00211         return impl->drag_offset_y;
00212 }
00213 
00214 const CL_Rect &CL_ScrollBar::get_drag_rect() const
00215 {
00216         return impl->drag_rect;
00217 }
00218 
00219 bool CL_ScrollBar::is_scrolling() const
00220 {
00221         return impl->scrolling;
00222 }
00223 
00224 bool CL_ScrollBar::is_section_scrolling() const
00225 {
00226         return impl->section_scrolling;
00227 }
00228 
00229 int CL_ScrollBar::get_scroll_direction() const
00230 {
00231         return impl->scroll_direction;
00232 }
00233 
00234 */

Generated at Wed Apr 4 19:54:03 2001 for ClanLib by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001