edelib 2.0.0
|
00001 /* 00002 * $Id: ExpandableGroup.h 2839 2009-09-28 11:36:20Z karijes $ 00003 * 00004 * Group with applied layout on childs 00005 * Copyright (c) 2005-2007 edelib authors 00006 * 00007 * This library is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public 00009 * License as published by the Free Software Foundation; either 00010 * version 2 of the License, or (at your option) any later version. 00011 * 00012 * This library is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Lesser General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public License 00018 * along with this library. If not, see <http://www.gnu.org/licenses/>. 00019 */ 00020 00021 #ifndef __EDELIB_EXPANDABLEGROUP_H__ 00022 #define __EDELIB_EXPANDABLEGROUP_H__ 00023 00024 #include "edelib-global.h" 00025 00026 #include <FL/Fl_Group.H> 00027 #include <FL/Fl_Scrollbar.H> 00028 00029 EDELIB_NS_BEGIN 00030 00054 class EDELIB_API ExpandableGroup : public Fl_Group { 00055 private: 00056 int px, py; 00057 int sval, sval_curr, sval_old; 00058 int area_x, area_y, area_w, area_h; 00059 00060 Fl_Scrollbar* vscrollbar; 00061 00062 void reposition_childs(void); 00063 void fix_scrollbar_order(void); 00064 static void draw_clip(void* d, int X, int Y, int W, int H); 00065 00066 public: 00070 ExpandableGroup(int x, int y, int w, int h, const char* l=0); 00071 00075 ~ExpandableGroup(); 00076 00077 #ifndef SKIP_DOCS 00078 virtual void draw(void); 00079 virtual void resize(int x, int y, int w, int h); 00080 virtual int handle(int event); 00081 void clear(void); 00082 int children(void); 00083 void scrolly(int yp); 00084 void add(Fl_Widget* o); 00085 Fl_Scrollbar* get_scroll(void) { return vscrollbar; } 00086 #endif 00087 }; 00088 00089 EDELIB_NS_END 00090 #endif