Update the changelog
[opencv] / otherlibs / _fltk / include / FL / Fl_Group.H
1 //
2 // "$Id: Fl_Group.H,v 1.2 2002/12/01 15:38:37 neurosurg Exp $"
3 //
4 // Group header file for the Fast Light Tool Kit (FLTK).
5 //
6 // Copyright 1998-2002 by Bill Spitzak and others.
7 //
8 // This library is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU Library General Public
10 // License as published by the Free Software Foundation; either
11 // version 2 of the License, or (at your option) any later version.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 // Library General Public License for more details.
17 //
18 // You should have received a copy of the GNU Library General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
21 // USA.
22 //
23 // Please report all bugs and problems to "fltk-bugs@fltk.org".
24 //
25
26 #ifndef Fl_Group_H
27 #define Fl_Group_H
28
29 #ifndef Fl_Widget_H
30 #include "Fl_Widget.H"
31 #endif
32
33 class FL_EXPORT Fl_Group : public Fl_Widget {
34
35   Fl_Widget** array_;
36   Fl_Widget* savedfocus_;
37   Fl_Widget* resizable_;
38   int children_;
39   short *sizes_; // remembered initial sizes of children
40
41   int navigation(int);
42   static Fl_Group *current_;
43
44 protected:
45
46   void draw();
47   void draw_child(Fl_Widget&) const;
48   void draw_children();
49   void draw_outside_label(const Fl_Widget&) const ;
50   void update_child(Fl_Widget&) const;
51   short* sizes();
52
53 public:
54
55   int handle(int);
56   void begin();
57   void end();
58   static Fl_Group *current();
59   static void current(Fl_Group *g);
60
61   int children() const {return children_;}
62   Fl_Widget* child(int n) const {return array()[n];}
63   int find(const Fl_Widget*) const;
64   int find(const Fl_Widget& o) const {return find(&o);}
65   Fl_Widget* const* array() const;
66
67   void resize(int,int,int,int);
68   Fl_Group(int,int,int,int, const char * = 0);
69   virtual ~Fl_Group();
70   void add(Fl_Widget&);
71   void add(Fl_Widget* o) {add(*o);}
72   void insert(Fl_Widget&, int i);
73   void insert(Fl_Widget& o, Fl_Widget* before) {insert(o,find(before));}
74   void remove(Fl_Widget&);
75   void remove(Fl_Widget* o) {remove(*o);}
76   void clear();
77
78   void resizable(Fl_Widget& o) {resizable_ = &o;}
79   void resizable(Fl_Widget* o) {resizable_ = o;}
80   Fl_Widget* resizable() const {return resizable_;}
81   void add_resizable(Fl_Widget& o) {resizable_ = &o; add(o);}
82   void init_sizes();
83
84   // back compatability function:
85   void focus(Fl_Widget* o) {o->take_focus();}
86   Fl_Widget* & _ddfdesign_kludge() {return resizable_;}
87   void forms_end();
88 };
89
90 // dummy class used to end child groups in constructors for complex
91 // subclasses of Fl_Group:
92 class FL_EXPORT Fl_End {
93 public:
94   Fl_End() {Fl_Group::current()->end();}
95 };
96
97 #endif
98
99 //
100 // End of "$Id: Fl_Group.H,v 1.2 2002/12/01 15:38:37 neurosurg Exp $".
101 //