2
// "$Id: Fl_Tabs.H 8101 2010-12-22 13:06:03Z AlbrechtS $"
4
// Tab header file for the Fast Light Tool Kit (FLTK).
6
// Copyright 1998-2010 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 on the following page:
25
// http://www.fltk.org/str.php
37
The Fl_Tabs widget is the "file card tabs"
38
interface that allows you to put lots and lots of buttons and
39
switches in a panel, as popularized by many toolkits.
42
\image latex tabs.png "Fl_Tabs" width=8cm
44
Clicking the tab makes a child visible() by calling
45
show() on it, and all other children are made invisible
46
by calling hide() on them. Usually the children are Fl_Group widgets
47
containing several widgets themselves.
49
Each child makes a card, and its label() is printed
50
on the card tab, including the label font and style. The
51
selection color of that child is used to color the tab, while
52
the color of the child determines the background color of the pane.
54
The size of the tabs is controlled by the bounding box of the
55
children (there should be some space between the children and
56
the edge of the Fl_Tabs), and the tabs may be placed
57
"inverted" on the bottom - this is determined by which
58
gap is larger. It is easiest to lay this out in fluid, using the
59
fluid browser to select each child group and resize them until
60
the tabs look the way you want them to.
62
class FL_EXPORT Fl_Tabs : public Fl_Group {
65
int *tab_pos; // array of x-offsets of tabs per child + 1
66
int *tab_width; // array of widths of tabs per child + 1
67
int tab_count; // array size
68
int tab_positions(); // allocate and calculate tab positions
69
void clear_tab_positions();
71
void draw_tab(int x1, int x2, int W, int H, Fl_Widget* o, int sel=0);
79
int value(Fl_Widget *);
80
Fl_Widget *push() const {return push_;}
81
int push(Fl_Widget *);
82
Fl_Tabs(int,int,int,int,const char * = 0);
83
Fl_Widget *which(int event_x, int event_y);
85
void client_area(int &rx, int &ry, int &rw, int &rh, int tabh=0);
91
// End of "$Id: Fl_Tabs.H 8101 2010-12-22 13:06:03Z AlbrechtS $".