edelib  2.0.0
ExpandableGroup.h
1 /*
2  * $Id: ExpandableGroup.h 2839 2009-09-28 11:36:20Z karijes $
3  *
4  * Group with applied layout on childs
5  * Copyright (c) 2005-2007 edelib authors
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with this library. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef __EDELIB_EXPANDABLEGROUP_H__
22 #define __EDELIB_EXPANDABLEGROUP_H__
23 
24 #include "edelib-global.h"
25 
26 #include <FL/Fl_Group.H>
27 #include <FL/Fl_Scrollbar.H>
28 
29 EDELIB_NS_BEGIN
30 
54 class EDELIB_API ExpandableGroup : public Fl_Group {
55 private:
56  int px, py;
57  int sval, sval_curr, sval_old;
58  int area_x, area_y, area_w, area_h;
59 
60  Fl_Scrollbar* vscrollbar;
61 
62  void reposition_childs(void);
63  void fix_scrollbar_order(void);
64  static void draw_clip(void* d, int X, int Y, int W, int H);
65 
66 public:
70  ExpandableGroup(int x, int y, int w, int h, const char* l=0);
71 
75  ~ExpandableGroup();
76 
77 #ifndef SKIP_DOCS
78  virtual void draw(void);
79  virtual void resize(int x, int y, int w, int h);
80  virtual int handle(int event);
81  void clear(void);
82  int children(void);
83  void scrolly(int yp);
84  void add(Fl_Widget* o);
85  Fl_Scrollbar* get_scroll(void) { return vscrollbar; }
86 #endif
87 };
88 
89 EDELIB_NS_END
90 #endif