/* $Id: ruler.hg,v 1.1 2003/01/21 13:40:35 murrayc Exp $ */

/* ruler.h
 * 
 * Copyright (C) 1998-2002 The gtkmm Development Team
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include <gtkmm/widget.h>

_DEFS(gtkmm,gtk)
_PINCLUDE(gtkmm/private/widget_p.h)


namespace Gtk
{

/** Base class for horizontal or vertical rulers.
 *
 * NOTE this widget is considered too specialized/little-used for GTK+, and will in the future be moved to some other package. If your application needs this widget, feel free to use it, as the widget does work and is useful in some applications; it's just not of general interest. However, we are not accepting new features for the widget, and it will eventually move out of the GTK+ distribution.
 * Rulers are used to show the mouse pointer's location in a window. The ruler can either be horizontal or vertical. Within the ruler a small triangle indicates the location of the mouse relative to the horixontal or vertical ruler.

 * This is an abstract base for Gtk::HRuler and
 * Gtk::VRuler.  Users should only instantiate those types.
 *
 * @ingroup Widgets
 */
class Ruler : public Widget
{
  _CLASS_GTKOBJECT(Ruler,GtkRuler,GTK_RULER,Gtk::Widget,GtkWidget)
protected:
  _CTOR_DEFAULT

public:
  

  MetricType get_metric() const; 

  /** Sets the desired metric of the ruler.  The possible choices are:
   * <ul><li>Gtk::PIXELS
   * <li>Gtk::INCHES
   * <li>Gtk::CENTIMETERS
   * </ul>The default metric is Gtk::PIXELS.
   */
  _WRAP_METHOD(void set_metric(MetricType metric = PIXELS), gtk_ruler_set_metric)
  _WRAP_METHOD(MetricType get_metric(), gtk_ruler_get_metric)

  _MEMBER_GET(range_lower,lower,double,double)
  _MEMBER_GET(range_upper,upper,double,double)

  /** sets the range of the ruler.
   * <i>upper</i> and <i>lower</i> arguments denote the extents of the Ruler.
   * <i>max_size</i> is the largest number displayed by the ruler.
   * <i>position</i> gives the initial value of the ruler.
   * Rulers do not have sane defaults so this function should always be called.
   */
  _WRAP_METHOD(void set_range(double lower, double upper, double position, double max_size), gtk_ruler_set_range)
  _WRAP_METHOD(void get_range(double& lower, double& upper, double& position, double& max_size), gtk_ruler_get_range)

  /// draw tick marks on the ruler
  _WRAP_METHOD(void draw_ticks(), gtk_ruler_draw_ticks)

  /// draw a position indicator on the ruler
  _WRAP_METHOD(void draw_pos(), gtk_ruler_draw_pos)

  _WRAP_VFUNC(void draw_ticks(), "draw_ticks")
  _WRAP_VFUNC(void draw_pos(), "draw_pos")

  _WRAP_PROPERTY("lower", double)
  _WRAP_PROPERTY("upper", double)
  _WRAP_PROPERTY("position", double)
  _WRAP_PROPERTY("max-size", double)
};


/** Vertical Ruler
 *
 * @ingroup Widgets
 */
class VRuler : public Ruler
{
  _CLASS_GTKOBJECT(VRuler,GtkVRuler,GTK_VRULER,Gtk::Ruler,GtkRuler)
public:
  _CTOR_DEFAULT
  
};


/** Horizontal Ruler
 *
 * @ingroup Widgets
 */
class HRuler : public Ruler
{
  _CLASS_GTKOBJECT(HRuler,GtkHRuler,GTK_HRULER,Gtk::Ruler,GtkRuler)
public:
  _CTOR_DEFAULT
  
};

} /* namespace Gtk */

