/src/wrappers/gtk/library/gtk_paned.e
Specman e | 327 lines | 95 code | 82 blank | 150 comment | 3 complexity | 4615e6f48f1960bea44aba2f98e2a808 MD5 | raw file
1indexing 2 description: "GtkPaned: Base class for widgets with two adjustable panes." 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_PANED 25 -- GtkPaned is the base class for widgets with two panes, arranged 26 -- either horizontally (GtkHPaned) or vertically (GtkVPaned). Child 27 -- widgets are added to the panes of the widget with `pack1' and 28 -- `pack2'. The division beween the two children is set by default 29 -- from the size requests of the children, but it can be adjusted 30 -- by the user. 31 32 -- A paned widget draws a separator between the two child 33 -- widgets and a small handle that the user can drag to 34 -- adjust the division. It does not draw any relief around 35 -- the children or around the separator. (The space in which 36 -- the separator is called the gutter.) Often, it is useful 37 -- to put each child inside a GtkFrame with the shadow type 38 -- set to `gtk_shadow_in' so that the gutter appears as a 39 -- ridge. 40 41 -- Each child has two options that can be set, resize and 42 -- shrink. If resize is true, then when the GtkPaned is resized, 43 -- that child will expand or shrink along with the paned widget. If 44 -- shrink is true, then when that child can be made smaller than 45 -- its requisition by the user. Setting shrink to FALSE allows the 46 -- application to set a minimum size. If resize is false for both 47 -- children, then this is treated as if resize is true for both 48 -- children. 49 50 -- The application can set the position of the slider as if it were 51 -- set by the user, by calling `set_position'. 52 53inherit 54 GTK_CONTAINER 55 -- GtkPaned implements AtkImplementorIface. 56 57insert G_OBJECT_FACTORY [GTK_WIDGET] 58 59feature 60 add1 (a_child: GTK_WIDGET) is 61 -- Adds a child to the top or left pane with default 62 -- parameters. This is equivalent to pack1 (a_child, False, 63 -- True). 64 require valid_child: a_child/=Void 65 do 66 gtk_paned_add1 (handle, a_child.handle) 67 end 68 69 add2 (a_child: GTK_WIDGET) is 70 -- Adds a child to the bottom or right pane with default 71 -- parameters. This is equivalent to pack (a_child, True, 72 -- True). 73 require valid_child: a_child/=Void 74 do 75 gtk_paned_add2 (handle, a_child.handle) 76 end 77 78 pack1 (a_child: GTK_WIDGET; resize, shrink: BOOLEAN) is 79 -- Adds 'a_child' to the top or left pane. 80 81 -- 'a_child': the child to add 82 83 -- resize : should this child expand when the paned widget is 84 -- resized. 85 86 -- shrink : can this child be made smaller than its 87 -- requisition. 88 require valid_child: a_child/=Void 89 do 90 gtk_paned_pack1 (handle, a_child.handle, resize.to_integer, shrink.to_integer) 91 end 92 93 pack2 (a_child: GTK_WIDGET; resize, shrink: BOOLEAN) is 94 -- Adds 'a_child' to the bottom or right pane. 95 96 -- 'a_child': the child to add 97 98 -- resize : should this child expand when the paned widget is 99 -- resized. 100 101 -- shrink : can this child be made smaller than its 102 -- requisition. 103 require valid_child: a_child/=Void 104 do 105 gtk_paned_pack2 (handle, a_child.handle, resize.to_integer, shrink.to_integer) 106 end 107 108 child1: GTK_WIDGET is 109 -- The first child of the paned widget; Void if not set. 110 do 111 Result := wrapper_or_void(gtk_paned_get_child1(handle)) 112 end 113 114 child: GTK_WIDGET is 115 -- The second child of the paned widget; Void if not set. 116 do 117 Result := wrapper_or_void(gtk_paned_get_child1(handle)) 118 end 119 120feature -- Divider position 121 unset_position is 122 -- Unsets the position of the divider between the two panes. 123 do 124 gtk_paned_set_position (handle, -1) 125 end 126 127 set_position (a_position: INTEGER) is 128 -- Sets the position of the divider between the two panes. 129 require positive_position: a_position >= 0 130 do 131 gtk_paned_set_position (handle, a_position) 132 ensure value_set: position = a_position 133 end 134 135 position: INTEGER is 136 -- the position of the divider between the two panes. 137 do 138 Result := gtk_paned_get_position (handle) 139 end 140 141feature -- Properties 142 143-- "max-position" gint : Read 144-- "min-position" gint : Read 145-- "position" gint : Read / Write 146-- "position-set" gboolean : Read / Write 147 148-- Child Properties 149 150-- "resize" gboolean : Read / Write 151-- "shrink" gboolean : Read / Write 152 153-- Style Properties 154 155-- "handle-size" gint : Read 156 157 -- The "max-position" property 158 159-- "max-position" gint : Read 160 161-- The largest possible value for the position property. This property is derived from the size and shrinkability of the widget's children. 162 163-- Allowed values: >= 0 164 165-- Default value: 2147483647 166 167-- Since 2.4 168-- The "min-position" property 169 170-- "min-position" gint : Read 171 172-- The smallest possible value for the position property. This property is derived from the size and shrinkability of the widget's children. 173 174-- Allowed values: >= 0 175 176-- Default value: 0 177 178-- Since 2.4 179-- The "position" property 180 181-- "position" gint : Read / Write 182 183-- Position of paned separator in pixels (0 means all the way to the left/top). 184 185-- Allowed values: >= 0 186 187-- Default value: 0 188-- The "position-set" property 189 190-- "position-set" gboolean : Read / Write 191 192-- TRUE if the Position property should be used. 193 194-- Default value: FALSE 195-- Child Property Details 196-- The "resize" child property 197 198-- "resize" gboolean : Read / Write 199 200-- The "resize" child property determines whether the child expands and shrinks along with the paned widget. 201 202-- Default value: TRUE 203 204-- Since 2.4 205-- The "shrink" child property 206 207-- "shrink" gboolean : Read / Write 208 209-- The "shrink" child property determines whether the child can be made smaller than its requisition. 210 211-- Default value: TRUE 212 213-- Since 2.4 214-- Style Property Details 215-- The "handle-size" style property 216 217-- "handle-size" gint : Read 218 219-- Width of handle. 220 221-- Allowed values: >= 0 222 223-- Default value: 5 224feature -- Signal Details 225-- The "accept-position" signal 226 227-- gboolean user_function (GtkPaned *paned, 228-- gpointer user_data) : Run last / Action 229 230-- paned : the object which received the signal. 231-- user_data : user data set when the signal handler was connected. 232-- Returns : 233-- The "cancel-position" signal 234 235-- gboolean user_function (GtkPaned *paned, 236-- gpointer user_data) : Run last / Action 237 238-- paned : the object which received the signal. 239-- user_data : user data set when the signal handler was connected. 240-- Returns : 241-- The "cycle-child-focus" signal 242 243-- gboolean user_function (GtkPaned *paned, 244-- gboolean arg1, 245-- gpointer user_data) : Run last / Action 246 247-- paned : the object which received the signal. 248-- arg1 : 249-- user_data : user data set when the signal handler was connected. 250-- Returns : 251-- The "cycle-handle-focus" signal 252 253-- gboolean user_function (GtkPaned *paned, 254-- gboolean arg1, 255-- gpointer user_data) : Run last / Action 256 257-- paned : the object which received the signal. 258-- arg1 : 259-- user_data : user data set when the signal handler was connected. 260-- Returns : 261-- The "move-handle" signal 262 263-- gboolean user_function (GtkPaned *paned, 264-- GtkScrollType *arg1, 265-- gpointer user_data) : Run last / Action 266 267-- paned : the object which received the signal. 268-- arg1 : 269-- user_data : user data set when the signal handler was connected. 270-- Returns : 271-- The "toggle-handle-focus" signal 272 273-- gboolean user_function (GtkPaned *paned, 274-- gpointer user_data) : Run last / Action 275 276-- paned : the object which received the signal. 277-- user_data : user data set when the signal handler was connected. 278-- Returns : 279 280-- Signals 281 282-- "accept-position" 283-- gboolean user_function (GtkPaned *paned, gpointer user_data) : Run last / Action 284-- "cancel-position" 285-- gboolean user_function (GtkPaned *paned, gpointer user_data) : Run last / Action 286-- "cycle-child-focus" 287-- gboolean user_function (GtkPaned *paned, gboolean arg1, gpointer user_data) : Run last / Action 288-- "cycle-handle-focus" 289-- gboolean user_function (GtkPaned *paned, gboolean arg1, gpointer user_data) : Run last / Action 290-- "move-handle" 291-- gboolean user_function (GtkPaned *paned, GtkScrollType *arg1, gpointer user_data) : Run last / Action 292-- "toggle-handle-focus" 293-- gboolean user_function (GtkPaned *paned, gpointer user_data) : Run last / Action 294 295feature {} -- External calls 296 gtk_paned_add1 (a_paned, a_child: POINTER) is 297 external "C use <gtk/gtk.h>" 298 end 299 300 gtk_paned_add2 (a_paned, a_child: POINTER) is 301 external "C use <gtk/gtk.h>" 302 end 303 304 gtk_paned_pack1 (a_paned, a_child: POINTER; resize, shrink: INTEGER) is 305 external "C use <gtk/gtk.h>" 306 end 307 308 gtk_paned_pack2 (a_paned, a_child: POINTER; resize, shrink: INTEGER) is 309 external "C use <gtk/gtk.h>" 310 end 311 312 gtk_paned_get_child1 (a_paned: POINTER): POINTER is 313 external "C use <gtk/gtk.h>" 314 end 315 316 gtk_paned_get_child2 (a_paned: POINTER): POINTER is 317 external "C use <gtk/gtk.h>" 318 end 319 320 gtk_paned_set_position (a_paned: POINTER; a_position: INTEGER) is 321 external "C use <gtk/gtk.h>" 322 end 323 324 gtk_paned_get_position (a_paned: POINTER): INTEGER is 325 external "C use <gtk/gtk.h>" 326 end 327end