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

scrollbar_generic.h

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 #ifndef header_scrollbar_generic
00010 #define header_scrollbar_generic
00011 
00012 #include <API/Core/System/timer.h>
00013 #include <API/Display/Input/key.h>
00014 #include <API/Core/Math/rect.h>
00015 #include <API/signals.h>
00016 
00017 class CL_ScrollBar;
00018 class CL_Button;
00019 class CL_InputDevice;
00020 class CL_Component;
00021 class CL_ComponentOptions;
00022 class CL_StyleManager;
00023 
00024 class CL_ScrollBar_Generic
00025 {
00026 // Construction:
00027 public:
00028         static CL_ComponentOptions create_options(
00029                 const CL_Rect &pos,
00030                 int min,
00031                 int max,
00032                 int value,
00033                 bool orientation,
00034                 bool tracking);
00035 
00036         CL_ScrollBar_Generic(CL_ScrollBar *self, const CL_ComponentOptions &options, CL_StyleManager *style);
00037         ~CL_ScrollBar_Generic() {};
00038 
00039 // Attributes:
00040 public:
00041         int get_range() const;
00042 
00043         CL_Component *client_area;
00044 
00045         int min_value;
00046         int max_value;
00047         int cur_value;
00048 
00049         bool tracking;
00050         bool vertical;
00051         bool fixed_length;
00052 
00053         bool dragging;
00054         CL_Rect rect_slider;
00055         int slider_length;
00056                 
00057 // Operations:
00058 public:
00059         void set_vertical(bool enable);
00060         void set_min_value(int value);
00061         void set_max_value(int value);
00062         void set_value(int value);
00063 
00064 // Signals:
00065 public:
00066         CL_Signal_v1<int> sig_value_changed;
00067         CL_Signal_v0 sig_slider_pressed;
00068         CL_Signal_v1<int> sig_slider_moved;
00069         CL_Signal_v0 sig_slider_released;
00070 
00071 // Slots:
00072 private:
00073         CL_Slot slot_timer;
00074         CL_Slot slot_keydown, slot_keyup, slot_mousemove;
00075         CL_Slot slot_resize;
00076         CL_Slot slot_button_decrease, slot_button_increase;
00077         CL_Slot slot_child_add, slot_child_remove;
00078 
00079 // Callbacks:
00080 private:
00081         void on_child_add(CL_Component *child);
00082         void on_child_remove(CL_Component *child);
00083         void on_key_down(CL_Component *comp, CL_InputDevice *device, CL_Key key);
00084         void on_key_up(CL_Component *comp, CL_InputDevice *device, CL_Key key);
00085 /*      void on_mouse_move(CL_Component *comp, CL_InputDevice *device, int x, int y);
00086         void on_scroll_timer();
00087         void on_decrease_pressed();
00088         void on_increase_pressed();
00089         void on_decrease_released();
00090         void on_increase_released();
00091         void on_resize(int old_width, int old_height);
00092 */
00093 // Implementation:
00094 private:
00095         void calculate_slider_size();
00096 
00097         CL_ScrollBar *scrollbar;
00098 //      CL_Timer scroll_timer;
00099 
00100 /*      bool mouse_captured;
00101         bool scrolling;
00102         bool section_scrolling;
00103         int scroll_direction;
00104 *//*
00105         int drag_offset_x, drag_offset_y;
00106         CL_Rect drag_rect;
00107 
00108         int capture_orgpos;
00109         int capture_org_drag_offset_x, capture_org_drag_offset_y;
00110         int capture_x_offset, capture_y_offset;
00111         int last_capture_x, last_capture_y;
00112 */
00113         bool initialized;
00114 };
00115 
00116 #endif

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