1 | // |
---|
2 | // "$Id: TabGroup.h 4218 2005-03-31 05:14:08Z spitzak $" |
---|
3 | // |
---|
4 | // For making a "tabbed dialog box". Each child widget creates a tab. |
---|
5 | // Only one is visible at a time. This works best if all the children |
---|
6 | // have the same size and they don't cover a strip at the top for the |
---|
7 | // tabs. |
---|
8 | // |
---|
9 | // Copyright 1998-2003 by Bill Spitzak and others. |
---|
10 | // |
---|
11 | // This library is free software; you can redistribute it and/or |
---|
12 | // modify it under the terms of the GNU Library General Public |
---|
13 | // License as published by the Free Software Foundation; either |
---|
14 | // version 2 of the License, or (at your option) any later version. |
---|
15 | // |
---|
16 | // This library is distributed in the hope that it will be useful, |
---|
17 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
19 | // Library General Public License for more details. |
---|
20 | // |
---|
21 | // You should have received a copy of the GNU Library General Public |
---|
22 | // License along with this library; if not, write to the Free Software |
---|
23 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
---|
24 | // USA. |
---|
25 | // |
---|
26 | // Please report all bugs and problems to "fltk-bugs@fltk.org". |
---|
27 | // |
---|
28 | |
---|
29 | #ifndef fltk_TabGroup_h |
---|
30 | #define fltk_TabGroup_h |
---|
31 | |
---|
32 | #include "Group.h" |
---|
33 | |
---|
34 | namespace fltk { |
---|
35 | |
---|
36 | class FL_API TabGroup : public Group { |
---|
37 | |
---|
38 | public: |
---|
39 | int handle(int); |
---|
40 | |
---|
41 | TabGroup(int,int,int,int,const char * = 0); |
---|
42 | static NamedStyle* default_style; |
---|
43 | |
---|
44 | int value(); |
---|
45 | bool value(int); |
---|
46 | int which(int event_x, int event_y); |
---|
47 | Widget *selected_child(); |
---|
48 | bool selected_child(Widget *); |
---|
49 | void set_draw_outline( bool draw_outline ); |
---|
50 | |
---|
51 | protected: |
---|
52 | void draw(); |
---|
53 | |
---|
54 | private: |
---|
55 | int push(Widget *); |
---|
56 | int tab_positions(int*, int*); |
---|
57 | int tab_height(); |
---|
58 | void draw_tab(int x1, int x2, int W, int H, Widget* o, int sel=0); |
---|
59 | void draw_tab_background(); |
---|
60 | |
---|
61 | bool _drawOutline; |
---|
62 | }; |
---|
63 | |
---|
64 | } |
---|
65 | |
---|
66 | #endif |
---|
67 | |
---|
68 | // |
---|
69 | // End of "$Id: TabGroup.h 4218 2005-03-31 05:14:08Z spitzak $". |
---|
70 | // |
---|