FLTK 1.4.0
Fl_Tabs.H
1 //
2 // Tab header file for the Fast Light Tool Kit (FLTK).
3 //
4 // Copyright 1998-2017 by Bill Spitzak and others.
5 //
6 // This library is free software. Distribution and use rights are outlined in
7 // the file "COPYING" which should have been included with this file. If this
8 // file is missing or damaged, see the license at:
9 //
10 // https://www.fltk.org/COPYING.php
11 //
12 // Please see the following page on how to report bugs and issues:
13 //
14 // https://www.fltk.org/bugs.php
15 //
16 
17 /* \file
18  Fl_Tabs widget . */
19 
20 #ifndef Fl_Tabs_H
21 #define Fl_Tabs_H
22 
23 #include "Fl_Group.H"
24 
201 class FL_EXPORT Fl_Tabs : public Fl_Group {
202 
203  Fl_Widget *push_;
204 
205 protected:
206 
207  int *tab_pos; // array of x-offsets of tabs per child + 1
208  int *tab_width; // array of widths of tabs per child + 1
209  int tab_count; // array size
210  Fl_Align tab_align_; // tab label alignment
211 
212  virtual void redraw_tabs();
213  virtual int tab_positions(); // allocate and calculate tab positions
214  virtual void clear_tab_positions();
215  virtual void draw_tab(int x1, int x2, int W, int H, Fl_Widget* o, int sel=0);
216  virtual int tab_height();
217 
218  void draw();
219 
220 public:
221 
222  Fl_Tabs(int X, int Y, int W, int H, const char *L = 0);
223  virtual ~Fl_Tabs();
224 
225  int handle(int);
226  Fl_Widget *value();
227  int value(Fl_Widget *);
238  Fl_Widget *push() const {return push_;}
239  int push(Fl_Widget *);
240 
241  // Returns the widget of the tab the user clicked on at event_x/event_y.
242  virtual Fl_Widget *which(int event_x, int event_y);
243 
244  // Returns the position and size available to be used by its children.
245  void client_area(int &rx, int &ry, int &rw, int &rh, int tabh=0);
246 
258  void tab_align(Fl_Align a) {tab_align_ = a;}
264  Fl_Align tab_align() const {return tab_align_;}
265 };
266 
267 #endif
unsigned Fl_Align
FLTK type for alignment control.
Definition: Enumerations.H:908
The Fl_Group class is the FLTK container widget.
Definition: Fl_Group.H:42
int handle(int)
Handles the specified event.
Definition: Fl_Group.cxx:145
void draw()
Draws the widget.
Definition: Fl_Group.cxx:840
The Fl_Tabs widget is the "file card tabs" interface that allows you to put lots and lots of buttons ...
Definition: Fl_Tabs.H:201
void tab_align(Fl_Align a)
Sets the tab label alignment.
Definition: Fl_Tabs.H:258
Fl_Widget * push() const
Returns the tab group for the tab the user has currently down-clicked on and remains over until FL_RE...
Definition: Fl_Tabs.H:238
Fl_Align tab_align() const
Gets the tab label alignment.
Definition: Fl_Tabs.H:264
Fl_Widget is the base class for all widgets in FLTK.
Definition: Fl_Widget.H:85