Adonthell 0.4
|
00001 /* 00002 (C) Copyright 2000 Joel Vennin 00003 Part of the Adonthell Project http://adonthell.linuxgames.com 00004 00005 This program is free software; you can redistribute it and/or modify 00006 it under the terms of the GNU General Public License. 00007 This program is distributed in the hope that it will be useful, 00008 but WITHOUT ANY WARRANTY. 00009 00010 See the COPYING file for more details 00011 */ 00012 00013 #ifndef WIN_SCROLLBAR_H_ 00014 #define WIN_SCROLLBAR_H_ 00015 00016 #include "image.h" 00017 #include "win_types.h" 00018 00019 class win_theme; 00020 class win_scroll; 00021 00022 class win_scrollbar 00023 { 00024 public: 00025 00026 win_scrollbar(); 00027 00028 win_scrollbar(win_scroll * ); 00029 00030 win_scrollbar(win_scrollbar &); 00031 00032 win_scrollbar(char *rep); 00033 00034 ~win_scrollbar(); 00035 00036 void update_bar(); 00037 00038 void load(char *); 00039 00040 void update_back(); 00041 00042 void destroy(); 00043 00044 void set_scrollbar(win_scrollbar &); 00045 00046 void set_scrollbar(win_theme & wt); 00047 00048 void set_visible_scrollbar(bool b) 00049 {visible_=b;} 00050 00051 void set_trans_scrollbar(bool b) 00052 { 00053 if(!bar_draw_) return; 00054 if((trans_=b)){ bar_draw_->set_alpha(130);back_draw_->set_alpha(130); } 00055 else{bar_draw_->set_alpha(255);back_draw_->set_alpha(255); } 00056 } 00057 00058 void set_brightness_scrollbar(bool b){brightness_=b;refresh();} 00059 00060 void draw(drawing_area * da= NULL); 00061 00062 u_int16 height_bar(){if(bar_) return bar_->height();return 0;} 00063 00064 private: 00065 00066 void init(); 00067 00068 void refresh(); 00069 00070 win_scrollbar & operator=(win_scrollbar &); 00071 00072 image * back_bot_; 00073 image * back_mid_; 00074 image * back_top_; 00075 image * bar_top_; 00076 image * bar_bot_; 00077 image * bar_mid_; 00078 image * bar_flex_; 00079 00080 image * bar_; 00081 image * back_; 00082 00083 image * bar_brightness_; 00084 image * back_brightness_; 00085 00086 image * bar_draw_; 00087 image * back_draw_; 00088 00089 bool visible_; 00090 bool brightness_; 00091 bool trans_; 00092 00093 win_scroll * wsc_; 00094 00095 }; 00096 00097 #endif 00098 00099 00100 00101