/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

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