00001
00002
00003
00004
00005
00006
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
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
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
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
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
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234