00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef Fl_Scroll_H
00032 #define Fl_Scroll_H
00033
00034 #include "Fl_Group.H"
00035 #include "Fl_Scrollbar.H"
00036
00096 class FL_EXPORT Fl_Scroll : public Fl_Group {
00097
00098 int xposition_, yposition_;
00099 int oldx, oldy;
00100 int scrollbar_size_;
00101 static void hscrollbar_cb(Fl_Widget*, void*);
00102 static void scrollbar_cb(Fl_Widget*, void*);
00103 void fix_scrollbar_order();
00104 static void draw_clip(void*,int,int,int,int);
00105
00106 private:
00107
00108
00109
00110
00111
00112
00113
00114 typedef struct {
00115 int scrollsize;
00116 int innerbox_x, innerbox_y, innerbox_w, innerbox_h;
00117 int innerchild_x, innerchild_y, innerchild_w, innerchild_h;
00118 int child_l, child_r, child_b, child_t;
00119 int hneeded, vneeded;
00120 int hscroll_x, hscroll_y, hscroll_w, hscroll_h;
00121 int vscroll_x, vscroll_y, vscroll_w, vscroll_h;
00122 int hpos, hsize, hfirst, htotal;
00123 int vpos, vsize, vfirst, vtotal;
00124 } ScrollInfo;
00125 void recalc_scrollbars(ScrollInfo &si);
00126
00127 protected:
00128
00129 void bbox(int&,int&,int&,int&);
00130 void draw();
00131
00132 public:
00133
00134 Fl_Scrollbar scrollbar;
00135 Fl_Scrollbar hscrollbar;
00136
00137 void resize(int,int,int,int);
00138 int handle(int);
00139
00140 Fl_Scroll(int X,int Y,int W,int H,const char*l=0);
00141
00142 enum {
00143 HORIZONTAL = 1,
00144 VERTICAL = 2,
00145 BOTH = 3,
00146 ALWAYS_ON = 4,
00147 HORIZONTAL_ALWAYS = 5,
00148 VERTICAL_ALWAYS = 6,
00149 BOTH_ALWAYS = 7
00150 };
00151
00153 int xposition() const {return xposition_;}
00155 int yposition() const {return yposition_;}
00156 void scroll_to(int, int);
00157 void clear();
00167 int scrollbar_size() const {
00168 return(scrollbar_size_);
00169 }
00189 void scrollbar_size(int size) {
00190 if ( size != scrollbar_size_ ) redraw();
00191 scrollbar_size_ = size;
00192 }
00193 };
00194
00195 #endif
00196
00197
00198
00199