/* $Id: scale.gen_h,v 1.46 2001/07/15 13:33:38 murrayc Exp $ */ /* scale.h * * Copyright (C) 1998-1999 The Gtk-- 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 <gtk--/range.h> #include <gtk/gtkscale.h> #include <gtk/gtkhscale.h> #include <gtk/gtkvscale.h> namespace Gtk { //: A base class for GtkHScale and GtkVScale. //- The {\class Gtk::Scale} widget is an abstract class, used only for deriving the subclasses {Gtk::HScale::} and {Gtk::VScale::}. class Scale : public Range { public: typedef Scale CppObjectType; typedef GtkScale BaseObjectType; public: //: Returns the underlaying gtk+ object. GtkScale* gtkobj(); const GtkScale* gtkobj() const; //: Returns true if object is this type. static bool isA(Gtk::Object *object); virtual ~Scale(); private: public: gint get_digits () const; //: Sets the number of decimal places that are displayed in the value. //- {\var digits}: The number of decimal places to display, e.g. use 1 to display 1.0, 2 to display 1.00 etc. void set_digits(gint digits); //: Specifies whether the current value is displayed as a string next to the slider. void set_draw_value(gint draw_value); //: Sets the position in which the current value is displayed. //- {\var pos}: The position in which the current value is displayed. Possible values are: //- {\enum GTK_POS_LEFT}, {\enum GTK_POS_RIGHT}, {\enum GTK_POS_TOP}, or //- {\enum GTK_POS_BOTTOM}. void set_value_pos(GtkPositionType pos); //: An internal function used to get the maximum width needed to display the value string. //- {\var Returns}: The maximum width needed to display the value string. gint get_value_width() const; emitable signal void draw_value(); protected: Scale(); protected: // impl functions virtual void draw_value_impl(); }; //: A vertical slider widget for selecting a value from a range. //- The {\class Gtk::VScale} widget is used to allow the user to select a value //- using a horizontal slider. A {Gtk::Adjustment::} is used to set the //- initial value, the lower and upper bounds, and the step and page increments. //- //- The position to show the current value, and the number of decimal places shown can be //- set using the parent {Gtk::Scale::} class's functions. class VScale : public Scale { public: typedef VScale CppObjectType; typedef GtkVScale BaseObjectType; public: //: Returns the underlaying gtk+ object. GtkVScale* gtkobj(); const GtkVScale* gtkobj() const; //: Returns true if object is this type. static bool isA(Gtk::Object *object); virtual ~VScale(); private: public: explicit VScale(Adjustment &adjustment); VScale(); protected: // impl functions }; //: A horizontal slider widget for selecting a value from a range. //- The {\class Gtk::HScale} widget is used to allow the user to select a value //- using a horizontal slider. A {Gtk::Adjustment::} is used to set the //- initial value, the lower and upper bounds, and the step and page increments. //- //- The position to show the current value, and the number of decimal places shown can be //- set using the parent {Gtk::Scale::} class's functions. class HScale : public Scale { public: typedef HScale CppObjectType; typedef GtkHScale BaseObjectType; public: //: Returns the underlaying gtk+ object. GtkHScale* gtkobj(); const GtkHScale* gtkobj() const; //: Returns true if object is this type. static bool isA(Gtk::Object *object); virtual ~HScale(); private: public: explicit HScale(Adjustment &adjustment); HScale(); protected: // impl functions }; //+ PROPERTIES(Gtk_Scale) //. name: draw_value //. type: guint:1 //. get: //. set: //. desc: //. name: value_pos //. type: guint:2 //. get: //. set: //. desc: }