/src/wrappers/gtk/library/gtk_paned.e

http://github.com/tybor/Liberty · Specman e · 327 lines · 95 code · 82 blank · 150 comment · 3 complexity · 4615e6f48f1960bea44aba2f98e2a808 MD5 · raw file

  1. indexing
  2. description: "GtkPaned: Base class for widgets with two adjustable panes."
  3. copyright: "[
  4. Copyright (C) 2006 eiffel-libraries team, GTK+ team
  5. This library is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU Lesser General Public License
  7. as published by the Free Software Foundation; either version 2.1 of
  8. the License, or (at your option) any later version.
  9. This library is distributed in the hope that it will be useful, but
  10. WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. Lesser General Public License for more details.
  13. You should have received a copy of the GNU Lesser General Public
  14. License along with this library; if not, write to the Free Software
  15. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  16. 02110-1301 USA
  17. ]"
  18. date: "$Date:$"
  19. revision: "$Revision:$"
  20. deferred class GTK_PANED
  21. -- GtkPaned is the base class for widgets with two panes, arranged
  22. -- either horizontally (GtkHPaned) or vertically (GtkVPaned). Child
  23. -- widgets are added to the panes of the widget with `pack1' and
  24. -- `pack2'. The division beween the two children is set by default
  25. -- from the size requests of the children, but it can be adjusted
  26. -- by the user.
  27. -- A paned widget draws a separator between the two child
  28. -- widgets and a small handle that the user can drag to
  29. -- adjust the division. It does not draw any relief around
  30. -- the children or around the separator. (The space in which
  31. -- the separator is called the gutter.) Often, it is useful
  32. -- to put each child inside a GtkFrame with the shadow type
  33. -- set to `gtk_shadow_in' so that the gutter appears as a
  34. -- ridge.
  35. -- Each child has two options that can be set, resize and
  36. -- shrink. If resize is true, then when the GtkPaned is resized,
  37. -- that child will expand or shrink along with the paned widget. If
  38. -- shrink is true, then when that child can be made smaller than
  39. -- its requisition by the user. Setting shrink to FALSE allows the
  40. -- application to set a minimum size. If resize is false for both
  41. -- children, then this is treated as if resize is true for both
  42. -- children.
  43. -- The application can set the position of the slider as if it were
  44. -- set by the user, by calling `set_position'.
  45. inherit
  46. GTK_CONTAINER
  47. -- GtkPaned implements AtkImplementorIface.
  48. insert G_OBJECT_FACTORY [GTK_WIDGET]
  49. feature
  50. add1 (a_child: GTK_WIDGET) is
  51. -- Adds a child to the top or left pane with default
  52. -- parameters. This is equivalent to pack1 (a_child, False,
  53. -- True).
  54. require valid_child: a_child/=Void
  55. do
  56. gtk_paned_add1 (handle, a_child.handle)
  57. end
  58. add2 (a_child: GTK_WIDGET) is
  59. -- Adds a child to the bottom or right pane with default
  60. -- parameters. This is equivalent to pack (a_child, True,
  61. -- True).
  62. require valid_child: a_child/=Void
  63. do
  64. gtk_paned_add2 (handle, a_child.handle)
  65. end
  66. pack1 (a_child: GTK_WIDGET; resize, shrink: BOOLEAN) is
  67. -- Adds 'a_child' to the top or left pane.
  68. -- 'a_child': the child to add
  69. -- resize : should this child expand when the paned widget is
  70. -- resized.
  71. -- shrink : can this child be made smaller than its
  72. -- requisition.
  73. require valid_child: a_child/=Void
  74. do
  75. gtk_paned_pack1 (handle, a_child.handle, resize.to_integer, shrink.to_integer)
  76. end
  77. pack2 (a_child: GTK_WIDGET; resize, shrink: BOOLEAN) is
  78. -- Adds 'a_child' to the bottom or right pane.
  79. -- 'a_child': the child to add
  80. -- resize : should this child expand when the paned widget is
  81. -- resized.
  82. -- shrink : can this child be made smaller than its
  83. -- requisition.
  84. require valid_child: a_child/=Void
  85. do
  86. gtk_paned_pack2 (handle, a_child.handle, resize.to_integer, shrink.to_integer)
  87. end
  88. child1: GTK_WIDGET is
  89. -- The first child of the paned widget; Void if not set.
  90. do
  91. Result := wrapper_or_void(gtk_paned_get_child1(handle))
  92. end
  93. child: GTK_WIDGET is
  94. -- The second child of the paned widget; Void if not set.
  95. do
  96. Result := wrapper_or_void(gtk_paned_get_child1(handle))
  97. end
  98. feature -- Divider position
  99. unset_position is
  100. -- Unsets the position of the divider between the two panes.
  101. do
  102. gtk_paned_set_position (handle, -1)
  103. end
  104. set_position (a_position: INTEGER) is
  105. -- Sets the position of the divider between the two panes.
  106. require positive_position: a_position >= 0
  107. do
  108. gtk_paned_set_position (handle, a_position)
  109. ensure value_set: position = a_position
  110. end
  111. position: INTEGER is
  112. -- the position of the divider between the two panes.
  113. do
  114. Result := gtk_paned_get_position (handle)
  115. end
  116. feature -- Properties
  117. -- "max-position" gint : Read
  118. -- "min-position" gint : Read
  119. -- "position" gint : Read / Write
  120. -- "position-set" gboolean : Read / Write
  121. -- Child Properties
  122. -- "resize" gboolean : Read / Write
  123. -- "shrink" gboolean : Read / Write
  124. -- Style Properties
  125. -- "handle-size" gint : Read
  126. -- The "max-position" property
  127. -- "max-position" gint : Read
  128. -- The largest possible value for the position property. This property is derived from the size and shrinkability of the widget's children.
  129. -- Allowed values: >= 0
  130. -- Default value: 2147483647
  131. -- Since 2.4
  132. -- The "min-position" property
  133. -- "min-position" gint : Read
  134. -- The smallest possible value for the position property. This property is derived from the size and shrinkability of the widget's children.
  135. -- Allowed values: >= 0
  136. -- Default value: 0
  137. -- Since 2.4
  138. -- The "position" property
  139. -- "position" gint : Read / Write
  140. -- Position of paned separator in pixels (0 means all the way to the left/top).
  141. -- Allowed values: >= 0
  142. -- Default value: 0
  143. -- The "position-set" property
  144. -- "position-set" gboolean : Read / Write
  145. -- TRUE if the Position property should be used.
  146. -- Default value: FALSE
  147. -- Child Property Details
  148. -- The "resize" child property
  149. -- "resize" gboolean : Read / Write
  150. -- The "resize" child property determines whether the child expands and shrinks along with the paned widget.
  151. -- Default value: TRUE
  152. -- Since 2.4
  153. -- The "shrink" child property
  154. -- "shrink" gboolean : Read / Write
  155. -- The "shrink" child property determines whether the child can be made smaller than its requisition.
  156. -- Default value: TRUE
  157. -- Since 2.4
  158. -- Style Property Details
  159. -- The "handle-size" style property
  160. -- "handle-size" gint : Read
  161. -- Width of handle.
  162. -- Allowed values: >= 0
  163. -- Default value: 5
  164. feature -- Signal Details
  165. -- The "accept-position" signal
  166. -- gboolean user_function (GtkPaned *paned,
  167. -- gpointer user_data) : Run last / Action
  168. -- paned : the object which received the signal.
  169. -- user_data : user data set when the signal handler was connected.
  170. -- Returns :
  171. -- The "cancel-position" signal
  172. -- gboolean user_function (GtkPaned *paned,
  173. -- gpointer user_data) : Run last / Action
  174. -- paned : the object which received the signal.
  175. -- user_data : user data set when the signal handler was connected.
  176. -- Returns :
  177. -- The "cycle-child-focus" signal
  178. -- gboolean user_function (GtkPaned *paned,
  179. -- gboolean arg1,
  180. -- gpointer user_data) : Run last / Action
  181. -- paned : the object which received the signal.
  182. -- arg1 :
  183. -- user_data : user data set when the signal handler was connected.
  184. -- Returns :
  185. -- The "cycle-handle-focus" signal
  186. -- gboolean user_function (GtkPaned *paned,
  187. -- gboolean arg1,
  188. -- gpointer user_data) : Run last / Action
  189. -- paned : the object which received the signal.
  190. -- arg1 :
  191. -- user_data : user data set when the signal handler was connected.
  192. -- Returns :
  193. -- The "move-handle" signal
  194. -- gboolean user_function (GtkPaned *paned,
  195. -- GtkScrollType *arg1,
  196. -- gpointer user_data) : Run last / Action
  197. -- paned : the object which received the signal.
  198. -- arg1 :
  199. -- user_data : user data set when the signal handler was connected.
  200. -- Returns :
  201. -- The "toggle-handle-focus" signal
  202. -- gboolean user_function (GtkPaned *paned,
  203. -- gpointer user_data) : Run last / Action
  204. -- paned : the object which received the signal.
  205. -- user_data : user data set when the signal handler was connected.
  206. -- Returns :
  207. -- Signals
  208. -- "accept-position"
  209. -- gboolean user_function (GtkPaned *paned, gpointer user_data) : Run last / Action
  210. -- "cancel-position"
  211. -- gboolean user_function (GtkPaned *paned, gpointer user_data) : Run last / Action
  212. -- "cycle-child-focus"
  213. -- gboolean user_function (GtkPaned *paned, gboolean arg1, gpointer user_data) : Run last / Action
  214. -- "cycle-handle-focus"
  215. -- gboolean user_function (GtkPaned *paned, gboolean arg1, gpointer user_data) : Run last / Action
  216. -- "move-handle"
  217. -- gboolean user_function (GtkPaned *paned, GtkScrollType *arg1, gpointer user_data) : Run last / Action
  218. -- "toggle-handle-focus"
  219. -- gboolean user_function (GtkPaned *paned, gpointer user_data) : Run last / Action
  220. feature {} -- External calls
  221. gtk_paned_add1 (a_paned, a_child: POINTER) is
  222. external "C use <gtk/gtk.h>"
  223. end
  224. gtk_paned_add2 (a_paned, a_child: POINTER) is
  225. external "C use <gtk/gtk.h>"
  226. end
  227. gtk_paned_pack1 (a_paned, a_child: POINTER; resize, shrink: INTEGER) is
  228. external "C use <gtk/gtk.h>"
  229. end
  230. gtk_paned_pack2 (a_paned, a_child: POINTER; resize, shrink: INTEGER) is
  231. external "C use <gtk/gtk.h>"
  232. end
  233. gtk_paned_get_child1 (a_paned: POINTER): POINTER is
  234. external "C use <gtk/gtk.h>"
  235. end
  236. gtk_paned_get_child2 (a_paned: POINTER): POINTER is
  237. external "C use <gtk/gtk.h>"
  238. end
  239. gtk_paned_set_position (a_paned: POINTER; a_position: INTEGER) is
  240. external "C use <gtk/gtk.h>"
  241. end
  242. gtk_paned_get_position (a_paned: POINTER): INTEGER is
  243. external "C use <gtk/gtk.h>"
  244. end
  245. end