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

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

#ifndef DJ_SCROLL_WIDGET_H
#define DJ_SCROLL_WIDGET_H
#include <djWidget.h>
#include <FL/Fl_Scroll.H>

class Fl_Box;

namespace dj {

// Scroll widget.
//
class ScrollWidget : public Fl_Scroll, public WidgetBase {
public:

  ScrollWidget();
  
  void contentsResizable(bool);
  bool contentsResizable() const { return _contentsResizable; }
  
  // Layout.
  //
  const Vec2i sizeHint() const;
  void resize(int, int, int, int);
  int visible() const;
  
  // Widget.
  //
  int handle(int);
  
protected:

  void layoutUpdate();

private:

  bool _contentsResizable;
  Fl_Box * _dummyWidget;
};

}

#endif
