Main Page - Header
Author: The Inti Development Team

Reference Manual

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# scale.h

Go to the documentation of this file.

    00001 /*  Inti: Integrated Foundation Classes
    00002  *  Copyright (C) 2002 The Inti Development Team.
    00003  *  Copyright (C) 2000 Red Hat, Inc.
    00004  *
    00005  *  This program is free software; you can redistribute it and/or modify
    00006  *  it under the terms of the GNU General Public License as published by
    00007  *  the Free Software Foundation; either version 2 of the License, or
    00008  *  (at your option) any later version.
    00009  *
    00010  *  This program is distributed in the hope that it will be useful,
    00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00013  *  GNU Library General Public License for more details.
    00014  *
    00015  *  You should have received a copy of the GNU Library General Public License
    00016  *  along with this program; if not, write to the Free Software
    00017  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    00018  */
    00019
    00024
    00025 #ifndef INTI_GTK_SCALE_H
    00026 #define INTI_GTK_SCALE_H
    00027
    00028 #ifndef INTI_GTK_RANGE_H
    00029 #include <inti/gtk/range.h>
    00030 #endif
    00031
    00032 #ifndef __GTK_HSCALE_H__
    00033 #include <gtk/gtkhscale.h>
    00034 #endif
    00035
    00036 #ifndef __GTK_VSCALE_H__
    00037 #include <gtk/gtkvscale.h>
    00038 #endif
    00039
    00040 namespace Inti {
    00041
    00042 namespace Gtk {
    00043
    00044 class ScaleClass;
    00045 class HScaleClass;
    00046 class VScaleClass;
    00047
    00057
    00058 class Scale : public Range
    00059 {
    00060         friend class G::Object;
    00061         friend class ScaleClass;
    00062
    00063         Scale(const Scale&);
    00064         Scale& operator=(const Scale&);
    00065
    00066 protected:
    00069
    00070         Scale();
    00072
    00073         explicit Scale(GtkScale *scale, bool reference = false);
    00080
    00081         virtual ~Scale() = 0;
    00083
    00085 //  Override this do_ method only when you want to change the default behaviour of GtkScale.
    00086
    00087         virtual void do_draw_value();
    00088
    00091
    00092         virtual char* on_format_value(double value);
    00108
    00110 //  Properties
    00111
    00112         typedef G::Property<int> DigitsPropertyType;
    00113         typedef G::PropertyProxy<G::Object, DigitsPropertyType> DigitsPropertyProxy;
    00114         static const DigitsPropertyType digits_property;
    00115
    00116         typedef G::Property<bool> DrawValuePropertyType;
    00117         typedef G::PropertyProxy<G::Object, DrawValuePropertyType> DrawValuePropertyProxy;
    00118         static const DrawValuePropertyType draw_value_property;
    00119
    00120         typedef G::Property<PositionType, int> ValuePosPropertyType;
    00121         typedef G::PropertyProxy<G::Object, ValuePosPropertyType> ValuePosPropertyProxy;
    00122         static const ValuePosPropertyType value_pos_property;
    00123
    00124 //  Signals
    00125
    00126         typedef G::Signal1<char*, double> FormatValueSignalType;
    00127         typedef G::SignalProxy<TypeInstance, FormatValueSignalType> FormatValueSignalProxy;
    00128         static const FormatValueSignalType format_value_signal;
    00129
    00130 public:
    00133
    00134         GtkScale* gtk_scale() const { return (GtkScale*)instance; }
    00136
    00137         GtkScaleClass* gtk_scale_class() const;
    00139
    00140         operator GtkScale* () const;
    00142
    00143         int get_digits() const;
    00145
    00146         bool get_draw_value() const;
    00148
    00149         PositionType get_value_pos() const;
    00152
    00156
    00157         void set_digits(int digits);
    00163
    00164         void set_draw_value(bool draw_value);
    00167
    00168         void set_value_pos(PositionType pos);
    00171
    00172         String format_value(double value);
    00177
    00181
    00182         const DigitsPropertyProxy prop_digits()
    00183         {
    00184                 return DigitsPropertyProxy(this, &digits_property);
    00185         }
    00187
    00188         const DrawValuePropertyProxy prop_draw_value()
    00189         {
    00190                 return DrawValuePropertyProxy(this, &draw_value_property);
    00191         }
    00193
    00194         const ValuePosPropertyProxy prop_value_pos()
    00195         {
    00196                 return ValuePosPropertyProxy(this, &value_pos_property);
    00197         }
    00199
    00203
    00204         const FormatValueSignalProxy sig_format_value()
    00205         {
    00206                 return FormatValueSignalProxy(this, &format_value_signal);
    00207         }
    00209
    00211 };
    00212
    00219
    00220 class HScale : public Scale
    00221 {
    00222         friend class G::Object;
    00223         friend class HScaleClass;
    00224
    00225         HScale(const HScale&);
    00226         HScale& operator=(const HScale&);
    00227
    00228 protected:
    00231
    00232         explicit HScale(GtkHScale *hscale, bool reference = false);
    00239
    00241
    00242 public:
    00245
    00246         HScale();
    00248
    00249         explicit HScale(Adjustment& adjustment);
    00252
    00253         HScale(double min, double max, double step = 1.0);
    00262
    00263         virtual ~HScale();
    00265
    00269
    00270         GtkHScale* gtk_hscale() const { return (GtkHScale*)instance; }
    00272
    00273         GtkHScaleClass* gtk_hscale_class() const;
    00275
    00276         operator GtkHScale* () const;
    00278
    00280 };
    00281
    00288
    00289 class VScale : public Scale
    00290 {
    00291         friend class G::Object;
    00292         friend class VScaleClass;
    00293
    00294         VScale(const VScale&);
    00295         VScale& operator=(const VScale&);
    00296
    00297 protected:
    00300
    00301         explicit VScale(GtkVScale *vscale, bool reference = false);
    00308
    00310
    00311 public:
    00314
    00315         VScale();
    00317
    00318         explicit VScale(Adjustment& adjustment);
    00321
    00322         VScale(double min, double max, double step = 1.0);
    00331
    00332         virtual ~VScale();
    00334
    00338
    00339         GtkVScale* gtk_vscale() const { return (GtkVScale*)instance; }
    00341
    00342         GtkVScaleClass* gtk_vscale_class() const;
    00344
    00345         operator GtkVScale* () const;
    00347
    00349 };
    00350
    00351 } // namespace Gtk
    00352
    00353 } // namespace Inti
    00354
    00355 #endif // INTI_GTK_SCALE_H
    00356

Main Page - Footer