/*------------------------------------------------------------------------------
 src/bin/djview/colorSampleTool.h

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

#ifndef DJVIEW_COLOR_SAMPLE_TOOL_H
#define DJVIEW_COLOR_SAMPLE_TOOL_H
#include "base.h"
#include <djDialog.h>

namespace dj {
class CheckButtonWidget;
class IntWidget;
class ColorSwatchWidget;
class ColorWidget;
}

namespace djview {

class ViewWidget;

// Color sample tool.
//
class ColorSampleTool : public DialogBase {
public:
  
  ColorSampleTool();
  
  // Set.
  //
  void set(const ViewWidget *);
  
  // Preferences.
  //
  void prefs(const Prefs &);
  void prefs(Prefs *);

private:

  DJ_CALLBACK(ColorSampleTool, widgetCallback, const Color &)
  DJ_CALLBACK(ColorSampleTool, widthCallback, int);
  DJ_CALLBACK(ColorSampleTool, lockCallback, bool)
  DJ_CALLBACK(ColorSampleTool, closeCallback, bool)
  void widgetUpdate();

  Color _value;
  int _width;
  bool _lock;
  
  ColorWidget * _widget;
  ColorSwatchWidget * _swatchWidget;
  IntWidget * _widthWidget;
  CheckButtonWidget * _lockWidget;
  bool _callbacks;
};

}

#endif
