/*------------------------------------------------------------------------------
 src/lib/djWidget/djTabWidget.h

 Copyright (c) 2004-2006 Darby Johnston.
 All rights reserved.
 Use is subject to license terms.
------------------------------------------------------------------------------*/

#ifndef DJ_TAB_WIDGET_H
#define DJ_TAB_WIDGET_H
#include <djWidget.h>
#include <FL/Fl_Tabs.H>

namespace dj {

// Tab widget.
//
class TabWidget : public Fl_Tabs, public WidgetBase {
public:

  TabWidget();
  
  // Tabs.
  //
  bool tab(int);
  int tab() const;
  void tabAdd(const Str & name, WidgetBase *);
  bool tabName(const Str & name, int tab);
  bool tabDel(int tab);
  void tabDel();
  int tabSize() const { return _tabList.size(); }
  
  // Signals.
  //
  Signal<int> & sig() { return _sig; }
  
  // Layout.
  //
  const Vec2i sizeHint() const;
  const Vec2i tabHint() const;
  void resize(int, int, int, int);
  int visible() const;
  
  // Widget.
  //
  void draw();
  int handle(int);

private:

  DJ_FL_WIDGET_CALLBACK(TabWidget, widgetCallback);

  Signal<int> _sig;

  List<WidgetBase *> _tabList;
};

}

#endif
