| 1 |
/* Copyright (C) 1998-2002 The gtkmm Development Team |
| 2 |
* |
| 3 |
* This library is free software; you can redistribute it and/or |
| 4 |
* modify it under the terms of the GNU Lesser General Public |
| 5 |
* License as published by the Free Software Foundation; either |
| 6 |
* version 2.1 of the License, or (at your option) any later version. |
| 7 |
* |
| 8 |
* This library is distributed in the hope that it will be useful, |
| 9 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 11 |
* Lesser General Public License for more details. |
| 12 |
* |
| 13 |
* You should have received a copy of the GNU Lesser General Public |
| 14 |
* License along with this library; if not, see <https://www.gnu.org/licenses/>. |
| 15 |
*/ |
| 16 |
|
| 17 |
// To exclude this file from the documentation when build-deprecated-api=false. |
| 18 |
_CONFIGINCLUDE(gtkmmconfig.h) |
| 19 |
|
| 20 |
#include <gtkmm/bin.h> |
| 21 |
_DEFS(gtkmm,gtk) |
| 22 |
_PINCLUDE(gtkmm/private/bin_p.h) |
| 23 |
|
| 24 |
#m4 _PUSH(SECTION_CC_PRE_INCLUDES) |
| 25 |
#undef GTK_DISABLE_DEPRECATED |
| 26 |
#define GDK_DISABLE_DEPRECATION_WARNINGS 1 |
| 27 |
#m4 _POP() |
| 28 |
|
| 29 |
namespace Gtk |
| 30 |
{ |
| 31 |
|
| 32 |
/** A widget which controls the alignment and size of its child. |
| 33 |
* |
| 34 |
* Normally, a widget is allocated at least as much size as it requests, and, |
| 35 |
* most widgets expand to fill any extra allocated space, but sometimes |
| 36 |
* this behavior is not desired. The alignment widget allows the |
| 37 |
* programmer to specify how a widget should expand and position itself |
| 38 |
* to fill the area it is allocated. |
| 39 |
* |
| 40 |
* It has four settings: xscale, yscale, xalign, and yalign: |
| 41 |
* 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). |
| 42 |
* 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. |
| 43 |
* |
| 44 |
* |
| 45 |
* @deprecated Use Widget alignment and margin properties instead. |
| 46 |
|
| 47 |
* @ingroup Widgets |
| 48 |
* @ingroup Containers |
| 49 |
*/ |
| 50 |
class GTKMM_API Alignment : public Bin |
| 51 |
{ |
| 52 |
_CLASS_GTKOBJECT(Alignment,GtkAlignment,GTK_ALIGNMENT,Gtk::Bin,GtkBin,,,GTKMM_API) |
| 53 |
_IS_DEPRECATED |
| 54 |
public: |
| 55 |
|
| 56 |
/** Constructor to create an Alignment object. |
| 57 |
* @param xalign The initial horizontal alignment of the child. |
| 58 |
* @param yalign The initial vertical alignment of the child. |
| 59 |
* @param xscale The initial amount that the child expands horizontally to fill up unused space. |
| 60 |
* @param yscale The initial amount that the child expands vertically to fill up unused space. |
| 61 |
*/ |
| 62 |
_WRAP_CTOR(Alignment(float xalign = 0.5, float yalign = 0.5, float xscale = 1.0, float yscale = 1.0), gtk_alignment_new) |
| 63 |
|
| 64 |
/** Constructor to create an Alignment object. |
| 65 |
* @param xalign A Gtk::Align describing the initial horizontal alignment of the child. |
| 66 |
* @param yalign A Gtk::Align describing the initial vertical alignment of the child. |
| 67 |
* @param xscale The initial amount that the child expands horizontally to fill up unused space. |
| 68 |
* @param yscale The initial amount that the child expands vertically to fill up unused space. |
| 69 |
*/ |
| 70 |
_WRAP_CTOR(Alignment(Align xalign, Align yalign = Gtk::ALIGN_CENTER, float xscale = 1.0, float yscale = 1.0), gtk_alignment_new) |
| 71 |
|
| 72 |
_WRAP_METHOD(void set(float xalign = 0.5, float yalign = 0.5, float xscale = 1.0, float yscale= 1.0), gtk_alignment_set) |
| 73 |
_WRAP_METHOD(void set(Align xalign, Align yalign = Gtk::ALIGN_CENTER, float xscale = 1.0, float yscale= 1.0), gtk_alignment_set) |
| 74 |
|
| 75 |
//New in GTK+ 2.4 |
| 76 |
_WRAP_METHOD(void set_padding(guint padding_top, guint padding_bottom, guint padding_left, guint padding_right), gtk_alignment_set_padding) |
| 77 |
_WRAP_METHOD(void get_padding(guint& padding_top, guint& padding_bottom, guint& padding_left, guint& padding_right), gtk_alignment_get_padding) |
| 78 |
|
| 79 |
_WRAP_PROPERTY("xalign", float) |
| 80 |
_WRAP_PROPERTY("yalign", float) |
| 81 |
_WRAP_PROPERTY("xscale", float) |
| 82 |
_WRAP_PROPERTY("yscale", float) |
| 83 |
|
| 84 |
//New in GTK+ 2.4 |
| 85 |
_WRAP_PROPERTY("top_padding", guint) |
| 86 |
_WRAP_PROPERTY("bottom_padding", guint) |
| 87 |
_WRAP_PROPERTY("left_padding", guint) |
| 88 |
_WRAP_PROPERTY("right_padding", guint) |
| 89 |
}; |
| 90 |
|
| 91 |
} //namespace Gtk |