Adonthell  0.4
win_scrollbar.h
1 /*
2  (C) Copyright 2000 Joel Vennin
3  Part of the Adonthell Project http://adonthell.linuxgames.com
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License.
7  This program is distributed in the hope that it will be useful,
8  but WITHOUT ANY WARRANTY.
9 
10  See the COPYING file for more details
11 */
12 
13 #ifndef WIN_SCROLLBAR_H_
14 #define WIN_SCROLLBAR_H_
15 
16 #include "image.h"
17 #include "win_types.h"
18 
19 class win_theme;
20 class win_scroll;
21 
23 {
24  public:
25 
26  win_scrollbar();
27 
29 
31 
32  win_scrollbar(char *rep);
33 
34  ~win_scrollbar();
35 
36  void update_bar();
37 
38  void load(char *);
39 
40  void update_back();
41 
42  void destroy();
43 
44  void set_scrollbar(win_scrollbar &);
45 
46  void set_scrollbar(win_theme & wt);
47 
48  void set_visible_scrollbar(bool b)
49  {visible_=b;}
50 
51  void set_trans_scrollbar(bool b)
52  {
53  if(!bar_draw_) return;
54  if((trans_=b)){ bar_draw_->set_alpha(130);back_draw_->set_alpha(130); }
55  else{bar_draw_->set_alpha(255);back_draw_->set_alpha(255); }
56  }
57 
58  void set_brightness_scrollbar(bool b){brightness_=b;refresh();}
59 
60  void draw(drawing_area * da= NULL);
61 
62  u_int16 height_bar(){if(bar_) return bar_->height();return 0;}
63 
64  private:
65 
66  void init();
67 
68  void refresh();
69 
70  win_scrollbar & operator=(win_scrollbar &);
71 
72  image * back_bot_;
73  image * back_mid_;
74  image * back_top_;
75  image * bar_top_;
76  image * bar_bot_;
77  image * bar_mid_;
78  image * bar_flex_;
79 
80  image * bar_;
81  image * back_;
82 
83  image * bar_brightness_;
84  image * back_brightness_;
85 
86  image * bar_draw_;
87  image * back_draw_;
88 
89  bool visible_;
90  bool brightness_;
91  bool trans_;
92 
93  win_scroll * wsc_;
94 
95 };
96 
97 #endif
98 
99 
100 
101