/src/wrappers/gtk/library/gtk_misc.e
Specman e | 143 lines | 56 code | 35 blank | 52 comment | 2 complexity | 073d54ef220f4447d9742c34bbe597f9 MD5 | raw file
1indexing 2 description: "GtkMisc -- Base class for widgets with alignments and padding." 3 copyright: "[ 4 Copyright (C) 2006 eiffel-libraries team, GTK+ team 5 6 This library is free software; you can redistribute it and/or 7 modify it under the terms of the GNU Lesser General Public License 8 as published by the Free Software Foundation; either version 2.1 of 9 the License, or (at your option) any later version. 10 11 This library is distributed in the hope that it will be useful, but 12 WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 Lesser General Public License for more details. 15 16 You should have received a copy of the GNU Lesser General Public 17 License along with this library; if not, write to the Free Software 18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 19 02110-1301 USA 20 ]" 21 date: "$Date:$" 22 revision: "$Revision:$" 23 24deferred class GTK_MISC 25 -- The GtkMisc widget is an abstract widget which is not useful 26 -- itself, but is used to derive subclasses which have alignment 27 -- and padding attributes. 28 29 -- The horizontal and vertical padding attributes allows extra 30 -- space to be added around the widget. 31 32 -- The horizontal and vertical alignment attributes enable the 33 -- widget to be positioned within its allocated area. Note that if 34 -- the widget is added to a container in such a way that it expands 35 -- automatically to fill its allocated area, the alignment settings 36 -- will not alter the widgets position. 37 38inherit 39 GTK_WIDGET 40 -- Implemented Interfaces: GtkMisc implements 41 -- AtkImplementorIface. 42 43insert GTK_MISC_EXTERNALS 44 45-- feature {} -- size size: INTEGER is external "C inline use 46-- <gtk/gtk.h>" alias "sizeof(GtkMisc)" end 47 48feature -- 49 xalign: REAL is 50 -- the horizontal alignment, from 0 (left) to 1 (right). 51 do 52 Result:=get_xalign(handle) 53 ensure valid: Result.in_range (0.0,1.0) 54 end 55 56 yalign: REAL is 57 -- the vertical alignment, from 0 (top) to 1 (bottom). 58 do 59 Result:=get_yalign(handle) 60 ensure valid: Result.in_range (0.0,1.0) 61 end 62 63 xpad: INTEGER is 64 -- the amount of space to add on the left and right of the 65 -- widget, in pixels. TODO: shall be NATURAL_16 66 do 67 Result:=get_xpad(handle) 68 ensure valid: Result>0 69 end 70 71 ypad: INTEGER is 72 -- the amount of space to add on the top and bottom of the widget, in pixels. TODO shall be NATURAL_16 73 do 74 Result:=get_ypad(handle) 75 ensure valid: Result>0 76 end 77 78 set_alignment (an_xalign, an_yalign: REAL) is 79 -- Sets the alignment of the widget. `an_xalign0' is the 80 -- horizontal alignment, from 0 (left) to 1 (right), 81 -- `an_yalign' is the vertical alignment, from 0 (top) to 1 82 -- (bottom). 83 require 84 valid_x_align: an_xalign.in_range (0.0,1.0) 85 valid_y_align: an_yalign.in_range (0.0,1.0) 86 do 87 gtk_misc_set_alignment (handle, an_xalign, an_yalign); 88 end 89 90 set_padding (an_xpad, an_ypad: INTEGER) is 91 -- Sets the amount of space to add around the widget. 92 -- `an_xpad' is the amount of space to add on the left and 93 -- right of the widget, in pixels. `an_ypad' is the amount of 94 -- space to add on the top and bottom of the widget, in 95 -- pixels. 96 do 97 gtk_misc_set_padding (handle, an_xpad, an_ypad) 98 end 99 100 101 -- TODO: are gtk_misc_get_alignment and gtk_misc_get_padding to be 102 -- wrapped? they seems to be another way to implement 103 -- xalign,yalign, xpad and ypad. Idem for properties 104 105 -- Property Details 106 -- The "xalign" property 107 108 -- "xalign" gfloat : Read / Write 109 110 -- The horizontal alignment, from 0 (left) to 1 (right). Reversed for RTL layouts. 111 112 -- Allowed values: [0,1] 113 114 -- Default value: 0.5 115 -- The "xpad" property 116 117 -- "xpad" gint : Read / Write 118 119 -- The amount of space to add on the left and right of the widget, in pixels. 120 121 -- Allowed values: >= 0 122 123 -- Default value: 0 124 -- The "yalign" property 125 126 -- "yalign" gfloat : Read / Write 127 128 -- The vertical alignment, from 0 (top) to 1 (bottom). 129 130 -- Allowed values: [0,1] 131 132 -- Default value: 0.5 133 -- The "ypad" property 134 135 -- "ypad" gint : Read / Write 136 137 -- The amount of space to add on the top and bottom of the widget, in pixels. 138 139 -- Allowed values: >= 0 140 141 -- Default value: 0 142 143end