PageRenderTime 24ms CodeModel.GetById 14ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 1ms

/src/wrappers/gtk/library/gtk_button_box.e

http://github.com/tybor/Liberty
Specman e | 205 lines | 56 code | 24 blank | 125 comment | 3 complexity | ba41431fe33f3bf8af6561f93b92c146 MD5 | raw file
  1indexing
  2	description: "GtkButtonBox: Base class for GtkHButtonBox and GtkVButtonBox."
  3	copyright: "[
  4					Copyright (C) 2007 Paolo Redaelli, 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 hopeOA 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
 22	wrapped_version: "2.10.6"
 23
 24deferred class GTK_BUTTON_BOX
 25	-- The primary purpose of this class is to keep track of the
 26	-- various properties of GtkHButtonBox and GtkVButtonBox widgets.
 27	
 28	-- `child_size' retrieves the minimum width and height for widgets
 29	-- in a given button box. `set_child_size'() allows those
 30	-- properties to be changed.
 31	
 32	-- The internal padding of buttons can be retrieved and changed per
 33	-- button box using `child_ipadding' and `set_child_ipadding'
 34	-- respectively.
 35	
 36	-- `spacing' and `set_spacing' retrieve and change default number
 37	-- of pixels between buttons, respectively.
 38	
 39	-- `layout' and `set_layout' retrieve and alter the method used to
 40	-- spread the buttons in a button box across the container,
 41	-- respectively.
 42	
 43	-- The main purpose of GtkButtonBox is to make sure the children
 44	-- have all the same size. Therefore it ignores the homogeneous
 45	-- property which it inherited from GtkBox, and always behaves as
 46	-- if homogeneous was TRUE.
 47
 48inherit GTK_BOX
 49	--   GtkButtonBox implements AtkImplementorIface.
 50
 51feature 
 52	layout: INTEGER is
 53			-- the method used to arrange the buttons in a button box.
 54		do
 55			Result:=gtk_button_box_get_layout(handle)
 56		ensure valid_button_box_style: is_valid_gtk_button_box_style(Result)
 57		end
 58
 59	is_child_secondary (a_child: GTK_WIDGET): BOOLEAN is
 60			-- Should `a_child' appear in a secondary group of children?
 61		require child_not_void: a_child/=Void
 62		do
 63			Result:=gtk_button_box_get_child_secondary(handle,a_child.handle).to_boolean
 64		end
 65
 66	set_layout (a_style: INTEGER) is
 67			--   Changes the way buttons are arranged in their container.
 68		require valid_button_box_style: is_valid_gtk_button_box_style(a_style)
 69		do
 70			gtk_button_box_set_layout(handle, a_style)
 71		end
 72
 73	set_child_secondary (a_child: GTK_WIDGET; a_setting: BOOLEAN) is
 74			-- Sets whether `a_child' should appear in a secondary group
 75			-- of children. A typical use of a secondary child is the
 76			-- help button in a dialog.
 77			
 78			-- This group appears after the other children if the style
 79			-- is `gtk_buttonbox_start', `gtk_buttonbox_spread' or
 80			-- `gtk_buttonbox_edge', and before the other children if the
 81			-- style is `gtk_buttonbox_end'. For horizontal button boxes,
 82			-- the definition of before/after depends on direction of the
 83			-- widget (see `set_direction'). If the style is
 84			-- `gtk_buttonbox_start' or `gtk_buttonbox_end', then the
 85			-- secondary children are aligned at the other end of the
 86			-- button box from the main children. For the other styles,
 87			-- they appear immediately next to the main children.
 88			
 89			-- If `a_setting' is True, the child appears in a secondary
 90			-- group of the button box.
 91		require child_not_void: a_child/=Void
 92		do
 93			gtk_button_box_set_child_secondary(handle,a_child.handle,a_setting.to_integer)
 94		end
 95		
 96
 97feature -- Properties
 98	-- Note: "layout-style" property and "secondary" child property 
 99	-- already have strongly typed SETTER
100
101	--
102	--Style Properties
103	--
104	--
105	--   "child-internal-pad-x" gint                  : Read
106	--   "child-internal-pad-y" gint                  : Read
107	--   "child-min-height"     gint                  : Read
108	--   "child-min-width"      gint                  : Read
109	--Property Details
110	--
111	--  The "layout-style" property
112	--
113	--   "layout-style"         GtkButtonBoxStyle     : Read / Write
114	--
115	--   How to layout the buttons in the box. Possible values are default, spread,
116	--   edge, start and end.
117	--
118	--   Default value: GTK_BUTTONBOX_DEFAULT_STYLE
119	--
120	--Child Property Details
121	--
122	--  The "secondary" child property
123	--
124	--   "secondary"            gboolean              : Read / Write
125	--
126	--   If TRUE, the child appears in a secondary group of children, suitable for,
127	--   e.g., help buttons.
128	--
129	--   Default value: FALSE
130	--
131	--Style Property Details
132	--
133	--  The "child-internal-pad-x" style property
134	--
135	--   "child-internal-pad-x" gint                  : Read
136	--
137	--   Amount to increase child's size on either side.
138	--
139	--   Allowed values: >= 0
140	--
141	--   Default value: 4
142	--
143	--   --------------------------------------------------------------------------
144	--
145	--  The "child-internal-pad-y" style property
146	--
147	--   "child-internal-pad-y" gint                  : Read
148	--
149	--   Amount to increase child's size on the top and bottom.
150	--
151	--   Allowed values: >= 0
152	--
153	--   Default value: 0
154	--
155	--   --------------------------------------------------------------------------
156	--
157	--  The "child-min-height" style property
158	--
159	--   "child-min-height"     gint                  : Read
160	--
161	--   Minimum height of buttons inside the box.
162	--
163	--   Allowed values: >= 0
164	--
165	--   Default value: 27
166	--
167	--   --------------------------------------------------------------------------
168	--
169	--  The "child-min-width" style property
170	--
171	--   "child-min-width"      gint                  : Read
172	--
173	--   Minimum width of buttons inside the box.
174	--
175	--   Allowed values: >= 0
176	--
177	--   Default value: 85
178	--
179	--
180feature {} -- External calls
181	gtk_button_box_get_layout (a_widget: POINTER): INTEGER is
182			-- GtkButtonBoxStyle gtk_button_box_get_layout (GtkButtonBox
183			-- *widget);
184		external "C use <gtk/gtk.h>"
185		end
186
187	gtk_button_box_get_child_secondary (a_widget, a_child: POINTER): INTEGER is
188			-- gboolean gtk_button_box_get_child_secondary (GtkButtonBox
189			-- *widget, GtkWidget *child);
190		external "C use <gtk/gtk.h>"
191		end
192
193	gtk_button_box_set_layout (widget: POINTER; a_layout_style: INTEGER) is
194			-- void gtk_button_box_set_layout (GtkButtonBox *widget,
195			-- GtkButtonBoxStyle layout_style);
196		external "C use <gtk/gtk.h>"
197		end
198
199	gtk_button_box_set_child_secondary (a_widget, a_child: POINTER; is_secondary_bool: INTEGER) is
200			-- void gtk_button_box_set_child_secondary (GtkButtonBox
201			-- *widget, GtkWidget *child, gboolean is_secondary);
202		external "C use <gtk/gtk.h>"
203		end
204end
205