GFC Logo GFC Title Logo
Reference Manual
Main Page  |  Namespace List  |  Alphabetical List  |  Class List  |  File List

ruler.hh

Go to the documentation of this file.
00001 /* GFC-UI: GTK+ Foundation Classes (User Interface Library) 00002 * Copyright (C) 2002-2004 The GFC Development Team. 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU Library General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Library General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 */ 00018 00024 00025 #ifndef GFC_GTK_RULER_HH 00026 #define GFC_GTK_RULER_HH 00027 00028 #ifndef GFC_GTK_WIDGET_HH 00029 #include <gfc/gtk/widget.hh> 00030 #endif 00031 00032 #ifndef __GTK_HRULER_H__ 00033 #include <gtk/gtkhruler.h> 00034 #endif 00035 00036 #ifndef __GTK_VRULER_H__ 00037 #include <gtk/gtkvruler.h> 00038 #endif 00039 00040 namespace GFC { 00041 00042 namespace Gtk { 00043 00052 00053 class Ruler : public Widget 00054 { 00055 friend class G::Object; 00056 00057 Ruler(const Ruler&); 00058 Ruler& operator=(const Ruler&); 00059 00060 protected: 00063 00064 Ruler(); 00066 00067 explicit Ruler(GtkRuler *ruler, bool owns_reference = false); 00074 00075 virtual ~Ruler() = 0; 00077 00079 00080 public: 00083 00084 GtkRuler* gtk_ruler() const; 00086 00087 operator GtkRuler* () const; 00089 00090 MetricType get_metric() const; 00093 00094 double get_lower() const; 00096 00097 double get_upper() const; 00099 00100 double get_position() const; 00102 00103 void get_range(double *lower, double *upper, double *position, double *max_size = 0); 00110 00114 00115 void set_metric(MetricType metric = PIXELS); 00121 00122 void set_range(double lower, double upper, double position, double max_size); 00129 00130 void draw_ticks(); 00132 00133 void draw_pos(); 00135 00137 }; 00138 00146 00147 class HRuler : public Ruler 00148 { 00149 friend class G::Object; 00150 00151 HRuler(const HRuler&); 00152 HRuler& operator=(const HRuler&); 00153 00154 protected: 00157 00158 explicit HRuler(GtkHRuler *hruler, bool owns_reference = false); 00165 00167 00168 public: 00171 00172 HRuler(); 00174 00175 virtual ~HRuler(); 00177 00181 00182 GtkHRuler* gtk_hruler() const; 00184 00185 operator GtkHRuler* () const; 00187 00189 }; 00190 00193 00194 class VRuler : public Ruler 00195 { 00196 friend class G::Object; 00197 00198 VRuler(const VRuler&); 00199 VRuler& operator=(const VRuler&); 00200 00201 protected: 00204 00205 explicit VRuler(GtkVRuler *vruler, bool owns_reference = false); 00212 00214 00215 public: 00218 00219 VRuler(); 00221 00222 virtual ~VRuler(); 00224 00228 00229 GtkVRuler* gtk_vruler() const; 00231 00232 operator GtkVRuler* () const; 00234 00236 }; 00237 00238 } // namespace Gtk 00239 00240 } // namespace GFC 00241 00242 #include <gfc/gtk/inline/ruler.inl> 00243 00244 #endif // GFC_GTK_RULER_HH 00245

Generated on Tue Aug 24 00:34:32 2004 for GFC-UI by doxygen 1.3.8