2 // "$Id: Fl_Group.H,v 1.2 2002/12/01 15:38:37 neurosurg Exp $"
4 // Group header file for the Fast Light Tool Kit (FLTK).
6 // Copyright 1998-2002 by Bill Spitzak and others.
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.
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.
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
23 // Please report all bugs and problems to "fltk-bugs@fltk.org".
30 #include "Fl_Widget.H"
33 class FL_EXPORT Fl_Group : public Fl_Widget {
36 Fl_Widget* savedfocus_;
37 Fl_Widget* resizable_;
39 short *sizes_; // remembered initial sizes of children
42 static Fl_Group *current_;
47 void draw_child(Fl_Widget&) const;
49 void draw_outside_label(const Fl_Widget&) const ;
50 void update_child(Fl_Widget&) const;
58 static Fl_Group *current();
59 static void current(Fl_Group *g);
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;
67 void resize(int,int,int,int);
68 Fl_Group(int,int,int,int, const char * = 0);
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);}
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);}
84 // back compatability function:
85 void focus(Fl_Widget* o) {o->take_focus();}
86 Fl_Widget* & _ddfdesign_kludge() {return resizable_;}
90 // dummy class used to end child groups in constructors for complex
91 // subclasses of Fl_Group:
92 class FL_EXPORT Fl_End {
94 Fl_End() {Fl_Group::current()->end();}
100 // End of "$Id: Fl_Group.H,v 1.2 2002/12/01 15:38:37 neurosurg Exp $".