fltk  1.3.5-source
About: FLTK (Fast Light Tool Kit) is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X.
  Fossies Dox: fltk-1.3.5-source.tar.bz2  ("inofficial" and yet experimental doxygen-generated source code documentation)  

Fl_Group.H
Go to the documentation of this file.
1 //
2 // "$Id$"
3 //
4 // Group header file for the Fast Light Tool Kit (FLTK).
5 //
6 // Copyright 1998-2010 by Bill Spitzak and others.
7 //
8 // This library is free software. Distribution and use rights are outlined in
9 // the file "COPYING" which should have been included with this file. If this
10 // file is missing or damaged, see the license at:
11 //
12 // http://www.fltk.org/COPYING.php
13 //
14 // Please report all bugs and problems on the following page:
15 //
16 // http://www.fltk.org/str.php
17 //
18 
19 /* \file
20  Fl_Group, Fl_End classes . */
21 
22 #ifndef Fl_Group_H
23 #define Fl_Group_H
24 
25 #ifndef Fl_Widget_H
26 #include "Fl_Widget.H"
27 #endif
28 
41 class FL_EXPORT Fl_Group : public Fl_Widget {
42 
46  int children_;
47  int *sizes_; // remembered initial sizes of children
48 
49  int navigation(int);
50  static Fl_Group *current_;
51 
52  // unimplemented copy ctor and assignment operator
53  Fl_Group(const Fl_Group&);
54  Fl_Group& operator=(const Fl_Group&);
55 
56 protected:
57  void draw();
58  void draw_child(Fl_Widget& widget) const;
59  void draw_children();
60  void draw_outside_label(const Fl_Widget& widget) const ;
61  void update_child(Fl_Widget& widget) const;
62  int *sizes();
63 
64 public:
65 
66  int handle(int);
67  void begin();
68  void end();
69  static Fl_Group *current();
70  static void current(Fl_Group *g);
71 
75  int children() const {return children_;}
79  Fl_Widget* child(int n) const {return array()[n];}
80  int find(const Fl_Widget*) const;
84  int find(const Fl_Widget& o) const {return find(&o);}
85  Fl_Widget* const* array() const;
86 
87  void resize(int,int,int,int);
92  Fl_Group(int,int,int,int, const char * = 0);
93  virtual ~Fl_Group();
94  void add(Fl_Widget&);
98  void add(Fl_Widget* o) {add(*o);}
99  void insert(Fl_Widget&, int i);
104  void insert(Fl_Widget& o, Fl_Widget* before) {insert(o,find(before));}
105  void remove(int index);
106  void remove(Fl_Widget&);
111  void remove(Fl_Widget* o) {remove(*o);}
112  void clear();
113 
117  void resizable(Fl_Widget& o) {resizable_ = &o;}
148  void resizable(Fl_Widget* o) {resizable_ = o;}
152  Fl_Widget* resizable() const {return resizable_;}
156  void add_resizable(Fl_Widget& o) {resizable_ = &o; add(o);}
157  void init_sizes();
158 
168  void clip_children(int c) { if (c) set_flag(CLIP_CHILDREN); else clear_flag(CLIP_CHILDREN); }
176  unsigned int clip_children() { return (flags() & CLIP_CHILDREN) != 0; }
177 
178  // Note: Doxygen docs in Fl_Widget.H to avoid redundancy.
179  virtual Fl_Group* as_group() { return this; }
180 
181  // back compatibility functions:
182 
188  void focus(Fl_Widget* W) {W->take_focus();}
189 
191  Fl_Widget* & _ddfdesign_kludge() {return resizable_;}
192 
194  void forms_end();
195 };
196 
197 // dummy class used to end child groups in constructors for complex
198 // subclasses of Fl_Group:
219 public:
222 };
223 
224 #endif
225 
226 //
227 // End of "$Id$".
228 //
Fl_Widget.H
Fl_Group::resizable
Fl_Widget * resizable() const
Definition: Fl_Group.H:152
Fl_Group::add
void add(Fl_Widget *o)
Definition: Fl_Group.H:98
Fl_Group::resizable_
Fl_Widget * resizable_
Definition: Fl_Group.H:45
array
static int array[128]
Definition: fl_set_fonts_mac.cxx:182
Fl_Group::clip_children
void clip_children(int c)
Definition: Fl_Group.H:168
Fl_Group::focus
void focus(Fl_Widget *W)
Definition: Fl_Group.H:188
Fl_Widget::Fl_Group
friend class Fl_Group
Definition: Fl_Widget.H:102
Fl_Group::end
void end()
Definition: Fl_Group.cxx:75
Fl_Group::array_
Fl_Widget ** array_
Definition: Fl_Group.H:43
Fl_Group::children_
int children_
Definition: Fl_Group.H:46
find
static Fl_Font_Descriptor * find(Fl_Font fnum, Fl_Fontsize size)
Definition: fl_font_mac.cxx:250
Fl_Group::find
int find(const Fl_Widget &o) const
Definition: Fl_Group.H:84
Fl_Widget::set_flag
void set_flag(unsigned int c)
Definition: Fl_Widget.H:149
Fl_Widget::operator=
Fl_Widget & operator=(const Fl_Widget &)
Fl_Group::remove
void remove(Fl_Widget *o)
Definition: Fl_Group.H:111
FL_EXPORT
#define FL_EXPORT
Definition: Fl_Export.H:35
Fl_Group::sizes_
int * sizes_
Definition: Fl_Group.H:47
Fl_Group::resizable
void resizable(Fl_Widget *o)
Definition: Fl_Group.H:148
Fl_Widget::flags
unsigned int flags() const
Definition: Fl_Widget.H:147
Fl_Group::clip_children
unsigned int clip_children()
Definition: Fl_Group.H:176
Fl_End::Fl_End
Fl_End()
Definition: Fl_Group.H:221
Fl_Group::savedfocus_
Fl_Widget * savedfocus_
Definition: Fl_Group.H:44
Fl_Group::insert
void insert(Fl_Widget &o, Fl_Widget *before)
Definition: Fl_Group.H:104
Fl_Widget
Definition: Fl_Widget.H:101
Fl_Group
Definition: Fl_Group.H:41
Fl_Group::current
static Fl_Group * current()
Definition: Fl_Group.cxx:84
Fl_Group::children
int children() const
Definition: Fl_Group.H:75
Fl_Group::current_
static Fl_Group * current_
Definition: Fl_Group.H:50
Fl_Group::add_resizable
void add_resizable(Fl_Widget &o)
Definition: Fl_Group.H:156
sizes
static int sizes[128]
Definition: fl_set_fonts_win32.cxx:98
Fl_Widget::handle
virtual int handle(int event)
Definition: Fl_Widget.cxx:112
clear
void clear()
Definition: gl2opengl.h:12
Fl_End
Definition: Fl_Group.H:218
Fl_Widget::draw
virtual void draw()=0
Fl_Group::_ddfdesign_kludge
Fl_Widget *& _ddfdesign_kludge()
Definition: Fl_Group.H:191
Fl_Group::as_group
virtual Fl_Group * as_group()
Definition: Fl_Group.H:179
Fl_Group::child
Fl_Widget * child(int n) const
Definition: Fl_Group.H:79
Fl_Widget::resize
virtual void resize(int x, int y, int w, int h)
Definition: Fl_Widget.cxx:150
Fl_Widget::take_focus
int take_focus()
Definition: Fl_Widget.cxx:162
Fl_Widget::clear_flag
void clear_flag(unsigned int c)
Definition: Fl_Widget.H:151
Fl_Group::resizable
void resizable(Fl_Widget &o)
Definition: Fl_Group.H:117