2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_ALIGNMENT_H
4 #define _GTKMM_ALIGNMENT_H
12 * Copyright (C) 1998-2002 The gtkmm Development Team
14 * This library is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Library General Public
16 * License as published by the Free Software Foundation; either
17 * version 2 of the License, or (at your option) any later version.
19 * This library is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Library General Public License for more details.
24 * You should have received a copy of the GNU Library General Public
25 * License along with this library; if not, write to the Free
26 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29 #include <gtkmm/bin.h>
32 #ifndef DOXYGEN_SHOULD_SKIP_THIS
33 typedef struct _GtkAlignment GtkAlignment;
34 typedef struct _GtkAlignmentClass GtkAlignmentClass;
35 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
39 { class Alignment_Class; } // namespace Gtk
43 /** A widget which controls the alignment and size of its child.
45 * Normally, a widget is allocated at least as much size as it requests, and,
46 * most widgets expand to fill any extra allocated space, but sometimes
47 * this behavior is not desired. The alignment widget allows the
48 * programmer to specify how a widget should expand and position itself
49 * to fill the area it is allocated.
51 * It has four settings: xscale, yscale, xalign, and yalign:
52 * The scale settings specify how much the child widget should expand to fill the space allocated to the Gtk::Alignment. The values can range from 0 (meaning the child doesn't expand at all) to 1 (meaning the child expands to fill all of the available space).
53 * The align settings place the child widget within the available area. The values range from 0 (top or left) to 1 (bottom or right). Of course, if the scale settings are both set to 1, the alignment settings have no effect.
59 class Alignment : public Bin
62 #ifndef DOXYGEN_SHOULD_SKIP_THIS
63 typedef Alignment CppObjectType;
64 typedef Alignment_Class CppClassType;
65 typedef GtkAlignment BaseObjectType;
66 typedef GtkAlignmentClass BaseClassType;
67 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
71 #ifndef DOXYGEN_SHOULD_SKIP_THIS
74 friend class Alignment_Class;
75 static CppClassType alignment_class_;
78 Alignment(const Alignment&);
79 Alignment& operator=(const Alignment&);
82 explicit Alignment(const Glib::ConstructParams& construct_params);
83 explicit Alignment(GtkAlignment* castitem);
85 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
88 #ifndef DOXYGEN_SHOULD_SKIP_THIS
89 static GType get_type() G_GNUC_CONST;
90 static GType get_base_type() G_GNUC_CONST;
93 ///Provides access to the underlying C GtkObject.
94 GtkAlignment* gobj() { return reinterpret_cast<GtkAlignment*>(gobject_); }
96 ///Provides access to the underlying C GtkObject.
97 const GtkAlignment* gobj() const { return reinterpret_cast<GtkAlignment*>(gobject_); }
101 //C++ methods used to invoke GTK+ virtual functions:
104 //GTK+ Virtual Functions (override these to change behaviour):
106 //Default Signal Handlers::
113 /** Constructor to create an Alignment object.
114 * @param xalign The initial horizontal alignment of the child.
115 * @param yalign The initial vertical alignment of the child.
116 * @param xscale The initial amount that the child expands horizontally to fill up unused space.
117 * @param yscale The initial amount that the child expands vertically to fill up unused space.
119 explicit Alignment(float xalign = 0.5, float yalign = 0.5, float xscale = 1.0, float yscale = 1.0);
121 /** Constructor to create an Alignment object.
122 * @param xalign A Gtk::AlignmentEnum describing the initial horizontal alignment of the child.
123 * @param yalign A Gtk::AlignmentEnum describing the initial vertical alignment of the child.
124 * @param xscale The initial amount that the child expands horizontally to fill up unused space.
125 * @param yscale The initial amount that the child expands vertically to fill up unused space.
127 explicit Alignment(AlignmentEnum xalign, AlignmentEnum yalign = Gtk::ALIGN_CENTER, float xscale = 1.0, float yscale = 1.0);
130 /** Sets the Alignment values.
131 * @param xalign The horizontal alignment of the child of this Alignment, from 0 (left) to 1 (right).
132 * @param yalign The vertical alignment of the child of this Alignment, from 0 (top) to 1 (bottom).
133 * @param xscale The amount that the child expands horizontally to fill up unused space, from 0 to 1. A value of 0 indicates that the child widget should never expand. A value of 1 indicates that the child widget will expand to fill all the space allocated for the Alignment.
134 * @param yscale The amount that the child widget expands vertically to fill up unused space from 0 to 1. The values are similar to @a xscale .
136 void set(float xalign = 0.5, float yalign = 0.5, float xscale = 1.0, float yscale= 1.0);
138 /** Sets the Alignment values.
139 * @param xalign The horizontal alignment of the child of this Alignment, from 0 (left) to 1 (right).
140 * @param yalign The vertical alignment of the child of this Alignment, from 0 (top) to 1 (bottom).
141 * @param xscale The amount that the child expands horizontally to fill up unused space, from 0 to 1. A value of 0 indicates that the child widget should never expand. A value of 1 indicates that the child widget will expand to fill all the space allocated for the Alignment.
142 * @param yscale The amount that the child widget expands vertically to fill up unused space from 0 to 1. The values are similar to @a xscale .
144 void set(AlignmentEnum xalign, AlignmentEnum yalign = Gtk::ALIGN_CENTER, float xscale = 1.0, float yscale= 1.0);
148 /** Sets the padding on the different sides of the widget.
149 * The padding adds blank space to the sides of the widget. For instance,
150 * this can be used to indent the child widget towards the right by adding
151 * padding on the left.
154 * @param padding_top The padding at the top of the widget.
155 * @param padding_bottom The padding at the bottom of the widget.
156 * @param padding_left The padding at the left of the widget.
157 * @param padding_right The padding at the right of the widget.
159 void set_padding(guint padding_top, guint padding_bottom, guint padding_left, guint padding_right);
161 /** Gets the padding on the different sides of the widget.
165 * @param padding_top Location to store the padding for the top of the widget, or <tt>0</tt>.
166 * @param padding_bottom Location to store the padding for the bottom of the widget, or <tt>0</tt>.
167 * @param padding_left Location to store the padding for the left of the widget, or <tt>0</tt>.
168 * @param padding_right Location to store the padding for the right of the widget, or <tt>0</tt>.
170 void get_padding(guint& padding_top, guint& padding_bottom, guint& padding_left, guint& padding_right);
172 /** Horizontal position of child in available space. 0.0 is left aligned
174 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
175 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
176 * the value of the property changes.
178 Glib::PropertyProxy<float> property_xalign() ;
180 /** Horizontal position of child in available space. 0.0 is left aligned
182 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
183 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
184 * the value of the property changes.
186 Glib::PropertyProxy_ReadOnly<float> property_xalign() const;
188 /** Vertical position of child in available space. 0.0 is top aligned
190 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
191 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
192 * the value of the property changes.
194 Glib::PropertyProxy<float> property_yalign() ;
196 /** Vertical position of child in available space. 0.0 is top aligned
198 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
199 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
200 * the value of the property changes.
202 Glib::PropertyProxy_ReadOnly<float> property_yalign() const;
204 /** If available horizontal space is bigger than needed for the child
206 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
207 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
208 * the value of the property changes.
210 Glib::PropertyProxy<float> property_xscale() ;
212 /** If available horizontal space is bigger than needed for the child
214 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
215 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
216 * the value of the property changes.
218 Glib::PropertyProxy_ReadOnly<float> property_xscale() const;
220 /** If available vertical space is bigger than needed for the child
222 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
223 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
224 * the value of the property changes.
226 Glib::PropertyProxy<float> property_yscale() ;
228 /** If available vertical space is bigger than needed for the child
230 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
231 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
232 * the value of the property changes.
234 Glib::PropertyProxy_ReadOnly<float> property_yscale() const;
238 /** The padding to insert at the top of the widget.
240 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
241 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
242 * the value of the property changes.
244 Glib::PropertyProxy<guint> property_top_padding() ;
246 /** The padding to insert at the top of the widget.
248 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
249 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
250 * the value of the property changes.
252 Glib::PropertyProxy_ReadOnly<guint> property_top_padding() const;
254 /** The padding to insert at the bottom of the widget.
256 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
257 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
258 * the value of the property changes.
260 Glib::PropertyProxy<guint> property_bottom_padding() ;
262 /** The padding to insert at the bottom of the widget.
264 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
265 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
266 * the value of the property changes.
268 Glib::PropertyProxy_ReadOnly<guint> property_bottom_padding() const;
270 /** The padding to insert at the left of the widget.
272 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
273 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
274 * the value of the property changes.
276 Glib::PropertyProxy<guint> property_left_padding() ;
278 /** The padding to insert at the left of the widget.
280 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
281 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
282 * the value of the property changes.
284 Glib::PropertyProxy_ReadOnly<guint> property_left_padding() const;
286 /** The padding to insert at the right of the widget.
288 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
289 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
290 * the value of the property changes.
292 Glib::PropertyProxy<guint> property_right_padding() ;
294 /** The padding to insert at the right of the widget.
296 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
297 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
298 * the value of the property changes.
300 Glib::PropertyProxy_ReadOnly<guint> property_right_padding() const;
305 } /* namespace Gtk */
310 /** @relates Gtk::Alignment
311 * @param object The C instance
312 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
313 * @result A C++ instance that wraps this C instance.
315 Gtk::Alignment* wrap(GtkAlignment* object, bool take_copy = false);
317 #endif /* _GTKMM_ALIGNMENT_H */