1 /*
2     GUILIB:  An example GUI framework library for use with SDL
3 */
4 
5 /* This is a virtual base class for a scrollable widget */
6 
7 #ifndef _GUI_scroll_h
8 #define _GUI_scroll_h
9 
10 #include "GUI_widget.h"
11 
12 
13 class GUI_Scrollable : public GUI_Widget {
14 
15 public:
16 	/* Passed the generic widget parameters */
GUI_Scrollable(void * data)17 	GUI_Scrollable(void *data)	: GUI_Widget(data) {
18 	}
GUI_Scrollable(void * data,int x,int y,int w,int h)19 	GUI_Scrollable(void *data, int x, int y, int w, int h)
20 					: GUI_Widget(data, x, y, w, h) {
21 	}
22 
23 	/* Virtual functions to scroll forward and backward
24 	   This function returns the final position of the cursor.
25 	 */
26 	virtual int Scroll(int amount) = 0;
27 
28 	/* Virtual function to get the scrollable range */
29 	virtual void Range(int &first, int &last) = 0;
30 };
31 
32 #endif /* _GUI_scroll_h */
33