Adonthell 0.4

win_scroll.h

00001 /*
00002    $Id: win_scroll.h,v 1.4 2003/02/23 23:14:34 ksterker Exp $
00003 
00004    (C) Copyright 2000 Joel Vennin
00005    Part of the Adonthell Project http://adonthell.linuxgames.com
00006 
00007    This program is free software; you can redistribute it and/or modify
00008    it under the terms of the GNU General Public License.
00009    This program is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY.
00011 
00012    See the COPYING file for more details
00013 */
00014 
00015 #ifndef WIN_SCROLLED_H
00016 #define WIN_SCROLLED_H
00017 
00018 #include "win_container.h"
00019 #include "win_scrollbar.h"
00020 
00021 class win_scroll : public win_container, public win_scrollbar
00022 {
00023   
00024  public:
00025   //constructor x,y,length,height,and a theme
00026   win_scroll();
00027   
00028   //return difference between the last object and the visual height, I think you don't understand, but i know you never use thisfunction just me 
00029   u_int16 amplitude(){return max_amplitude_;}
00030   
00031   virtual void add(win_base *);
00032   
00033   virtual void remove(win_base *);
00034   
00035   virtual void remove_all();
00036   
00037   void resize(u_int16 tl,u_int16 th);
00038   
00039   void destroy();
00040   
00041   bool draw();
00042   
00043   bool update();
00044   
00045   bool input_update();
00046 
00047   void set_space_between_border(u_int16 );
00048   
00049   void set_space_between_object(u_int16 );
00050  
00051   virtual void set_pos (const u_int8 pos);
00052     
00053   u_int16 cursor_y(){return cursor_y_;}
00054   
00055   void set_auto_scrollbar(bool b){auto_scrollbar_=b;}
00056   
00057   void set_auto_refresh(bool b){auto_refresh_=b;}
00058 
00059   void set_brightness(bool b) {win_container::set_brightness(b);set_brightness_scrollbar(b);}
00060     
00061   void set_trans(bool b) {win_container::set_trans(b); set_trans_scrollbar(b);}
00062 
00063   const static u_int8 PAD_DEFAULT = 5;
00064 
00065  protected:
00066 
00067   bool up();
00068   
00069   bool down();
00070 
00071   void find_amplitude();
00072   
00073   void update_amplitude();
00074   
00075   u_int16 max_amplitude_;
00076   
00077   u_int16 cur_amplitude_;
00078   
00079   u_int16 index_pad_;
00080   
00081   u_int16 cursor_y_;
00082   
00083   bool auto_scrollbar_;
00084 
00085   bool auto_refresh_;
00086 };
00087 #endif
00088 
00089 
00090