1998-10-20 01:39:29 +04:00
|
|
|
//
|
2002-11-08 18:22:15 +03:00
|
|
|
// "$Id: Fl_Group.H,v 1.6.2.4.2.7 2002/11/08 15:22:08 easysw Exp $"
|
1998-10-20 01:39:29 +04:00
|
|
|
//
|
|
|
|
// Group header file for the Fast Light Tool Kit (FLTK).
|
|
|
|
//
|
2002-01-01 18:11:33 +03:00
|
|
|
// Copyright 1998-2002 by Bill Spitzak and others.
|
1998-10-20 01:39:29 +04:00
|
|
|
//
|
|
|
|
// This library is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU Library General Public
|
|
|
|
// License as published by the Free Software Foundation; either
|
|
|
|
// version 2 of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This library is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
// Library General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Library General Public
|
|
|
|
// License along with this library; if not, write to the Free Software
|
|
|
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
|
|
// USA.
|
|
|
|
//
|
2000-06-06 01:21:24 +04:00
|
|
|
// Please report all bugs and problems to "fltk-bugs@fltk.org".
|
1998-10-20 01:39:29 +04:00
|
|
|
//
|
1998-10-06 22:21:25 +04:00
|
|
|
|
|
|
|
#ifndef Fl_Group_H
|
|
|
|
#define Fl_Group_H
|
|
|
|
|
|
|
|
#ifndef Fl_Widget_H
|
|
|
|
#include "Fl_Widget.H"
|
|
|
|
#endif
|
|
|
|
|
2002-07-14 23:08:25 +04:00
|
|
|
class FL_EXPORT Fl_Group : public Fl_Widget {
|
1998-10-06 22:21:25 +04:00
|
|
|
|
|
|
|
Fl_Widget** array_;
|
|
|
|
Fl_Widget* savedfocus_;
|
|
|
|
Fl_Widget* resizable_;
|
|
|
|
int children_;
|
|
|
|
short *sizes_; // remembered initial sizes of children
|
|
|
|
|
2001-08-07 03:51:39 +04:00
|
|
|
int navigation(int);
|
2002-07-14 23:08:25 +04:00
|
|
|
static Fl_Group *current_;
|
1998-10-06 22:21:25 +04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
|
2002-08-14 20:19:48 +04:00
|
|
|
void draw();
|
|
|
|
void draw_child(Fl_Widget&) const;
|
2002-11-08 18:22:15 +03:00
|
|
|
void draw_children();
|
2002-08-14 20:19:48 +04:00
|
|
|
void draw_outside_label(const Fl_Widget&) const ;
|
2002-11-08 18:22:15 +03:00
|
|
|
void update_child(Fl_Widget&) const;
|
2002-08-14 20:19:48 +04:00
|
|
|
short* sizes();
|
1998-10-06 22:21:25 +04:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
2002-07-14 23:08:25 +04:00
|
|
|
int handle(int);
|
|
|
|
void begin();
|
|
|
|
void end();
|
|
|
|
static Fl_Group *current();
|
|
|
|
static void current(Fl_Group *g);
|
1998-10-06 22:21:25 +04:00
|
|
|
|
|
|
|
int children() const {return children_;}
|
|
|
|
Fl_Widget* child(int n) const {return array()[n];}
|
2002-07-14 23:08:25 +04:00
|
|
|
int find(const Fl_Widget*) const;
|
1998-10-06 22:21:25 +04:00
|
|
|
int find(const Fl_Widget& o) const {return find(&o);}
|
2002-07-14 23:08:25 +04:00
|
|
|
Fl_Widget* const* array() const;
|
1998-10-06 22:21:25 +04:00
|
|
|
|
2002-07-14 23:08:25 +04:00
|
|
|
void resize(int,int,int,int);
|
|
|
|
Fl_Group(int,int,int,int, const char * = 0);
|
|
|
|
virtual ~Fl_Group();
|
|
|
|
void add(Fl_Widget&);
|
1998-10-06 22:21:25 +04:00
|
|
|
void add(Fl_Widget* o) {add(*o);}
|
2002-07-14 23:08:25 +04:00
|
|
|
void insert(Fl_Widget&, int i);
|
1998-10-06 22:21:25 +04:00
|
|
|
void insert(Fl_Widget& o, Fl_Widget* before) {insert(o,find(before));}
|
2002-07-14 23:08:25 +04:00
|
|
|
void remove(Fl_Widget&);
|
1998-10-06 22:21:25 +04:00
|
|
|
void remove(Fl_Widget* o) {remove(*o);}
|
2002-07-14 23:08:25 +04:00
|
|
|
void clear();
|
1998-10-06 22:21:25 +04:00
|
|
|
|
|
|
|
void resizable(Fl_Widget& o) {resizable_ = &o;}
|
|
|
|
void resizable(Fl_Widget* o) {resizable_ = o;}
|
|
|
|
Fl_Widget* resizable() const {return resizable_;}
|
|
|
|
void add_resizable(Fl_Widget& o) {resizable_ = &o; add(o);}
|
2002-07-14 23:08:25 +04:00
|
|
|
void init_sizes();
|
1998-10-06 22:21:25 +04:00
|
|
|
|
|
|
|
// back compatability function:
|
|
|
|
void focus(Fl_Widget* o) {o->take_focus();}
|
|
|
|
Fl_Widget* & _ddfdesign_kludge() {return resizable_;}
|
2002-07-14 23:08:25 +04:00
|
|
|
void forms_end();
|
1998-10-06 22:21:25 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
// dummy class used to end child groups in constructors for complex
|
|
|
|
// subclasses of Fl_Group:
|
2002-08-14 20:19:48 +04:00
|
|
|
class FL_EXPORT Fl_End {
|
1998-10-06 22:21:25 +04:00
|
|
|
public:
|
|
|
|
Fl_End() {Fl_Group::current()->end();}
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
1998-10-20 01:39:29 +04:00
|
|
|
|
|
|
|
//
|
2002-11-08 18:22:15 +03:00
|
|
|
// End of "$Id: Fl_Group.H,v 1.6.2.4.2.7 2002/11/08 15:22:08 easysw Exp $".
|
1998-10-20 01:39:29 +04:00
|
|
|
//
|