2 * This file is part of duit.
4 * duit is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * duit is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with duit; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = GtkPaned.html
47 * - GtkWidget* -> Widget
53 private import gtk
.gtktypes
;
55 private import lib
.gtk
;
57 private import gtk
.Widget
;
61 * GtkPaned is the base class for widgets with two panes,
62 * arranged either horizontally (GtkHPaned) or
63 * vertically (GtkVPaned). Child widgets are
64 * added to the panes of the widget with
65 * gtk_paned_pack1() and gtk_paned_pack2(). The division
66 * beween the two children is set by default from the
67 * size requests of the children, but it can be adjusted
69 * A paned widget draws a separator between the two
70 * child widgets and a small handle that the user
71 * can drag to adjust the division. It does not
72 * draw any relief around the children or around
73 * the separator. (The space in which the separator
74 * is called the gutter.) Often, it is useful
75 * to put each child inside a GtkFrame with the
76 * shadow type set to GTK_SHADOW_IN so that the
77 * gutter appears as a ridge.
78 * Each child has two options that can be set,
79 * resize and shrink. If resize is true, then when the
80 * GtkPaned is resized, that child will expand
81 * or shrink along with the paned widget. If shrink
82 * is true, then when that child can be made smaller
83 * than its requisition by the user. Setting shrink
84 * to FALSE allows the application to set a minimum
85 * size. If resize is false for both children, then
86 * this is treated as if resize is true for both
88 * The application can set the position of the slider
89 * as if it were set by the user, by calling
90 * gtk_paned_set_position().
91 * Example1.Creating a paned widget with minimum sizes.
92 * GtkWidget *hpaned = gtk_hpaned_new ();
93 * GtkWidget *frame1 = gtk_frame_new (NULL);
94 * GtkWidget *frame2 = gtk_frame_new (NULL);
95 * gtk_frame_set_shadow_type (GTK_FRAME (frame1), GTK_SHADOW_IN);
96 * gtk_frame_set_shadow_type (GTK_FRAME (frame2), GTK_SHADOW_IN);
97 * gtk_widget_set_size_request (hpaned, 200 + GTK_PANED (hpaned)->gutter_size, -1);
98 * gtk_paned_pack1 (GTK_PANED (hpaned), frame1, TRUE, FALSE);
99 * gtk_widget_set_size_request (frame1, 50, -1);
100 * gtk_paned_pack2 (GTK_PANED (hpaned), frame2, FALSE, FALSE);
101 * gtk_widget_set_size_request (frame2, 50, -1);
103 private import gtk
.Container
;
104 public class Paned
: Container
107 /** the main Gtk struct */
108 protected GtkPaned
* gtkPaned
;
111 public GtkPaned
* getPanedStruct()
117 /** the main Gtk struct as a void* */
118 protected void* getStruct()
120 return cast(void*)gtkPaned
;
124 * Sets our main struct and passes it to the parent class
126 public this (GtkPaned
* gtkPaned
)
128 super(cast(GtkContainer
*)gtkPaned
);
129 this.gtkPaned
= gtkPaned
;
132 public void add(Widget child1
, Widget child2
)
141 // imports for the signal processing
142 private import gobject
.Signals
;
143 private import gdk
.gdktypes
;
144 int[char[]] connectedSignals
;
146 gboolean
delegate(Paned
)[] onAcceptPositionListeners
;
147 void addOnAcceptPosition(gboolean
delegate(Paned
) dlg
)
149 if ( !("accept-position" in connectedSignals
) )
154 cast(GCallback
)&callBackAcceptPosition
,
157 cast(ConnectFlags
)0);
158 connectedSignals
["accept-position"] = 1;
160 onAcceptPositionListeners
~= dlg
;
162 extern(C
) static void callBackAcceptPosition(GtkPaned
* panedStruct
, Paned paned
)
164 bit consumed
= false;
166 foreach ( gboolean
delegate(Paned
) dlg
; paned
.onAcceptPositionListeners
)
174 gboolean
delegate(Paned
)[] onCancelPositionListeners
;
175 void addOnCancelPosition(gboolean
delegate(Paned
) dlg
)
177 if ( !("cancel-position" in connectedSignals
) )
182 cast(GCallback
)&callBackCancelPosition
,
185 cast(ConnectFlags
)0);
186 connectedSignals
["cancel-position"] = 1;
188 onCancelPositionListeners
~= dlg
;
190 extern(C
) static void callBackCancelPosition(GtkPaned
* panedStruct
, Paned paned
)
192 bit consumed
= false;
194 foreach ( gboolean
delegate(Paned
) dlg
; paned
.onCancelPositionListeners
)
202 gboolean
delegate(gboolean
, Paned
)[] onCycleChildFocusListeners
;
203 void addOnCycleChildFocus(gboolean
delegate(gboolean
, Paned
) dlg
)
205 if ( !("cycle-child-focus" in connectedSignals
) )
210 cast(GCallback
)&callBackCycleChildFocus
,
213 cast(ConnectFlags
)0);
214 connectedSignals
["cycle-child-focus"] = 1;
216 onCycleChildFocusListeners
~= dlg
;
218 extern(C
) static void callBackCycleChildFocus(GtkPaned
* panedStruct
, gboolean arg1
, Paned paned
)
220 bit consumed
= false;
222 foreach ( gboolean
delegate(gboolean
, Paned
) dlg
; paned
.onCycleChildFocusListeners
)
230 gboolean
delegate(gboolean
, Paned
)[] onCycleHandleFocusListeners
;
231 void addOnCycleHandleFocus(gboolean
delegate(gboolean
, Paned
) dlg
)
233 if ( !("cycle-handle-focus" in connectedSignals
) )
237 "cycle-handle-focus",
238 cast(GCallback
)&callBackCycleHandleFocus
,
241 cast(ConnectFlags
)0);
242 connectedSignals
["cycle-handle-focus"] = 1;
244 onCycleHandleFocusListeners
~= dlg
;
246 extern(C
) static void callBackCycleHandleFocus(GtkPaned
* panedStruct
, gboolean arg1
, Paned paned
)
248 bit consumed
= false;
250 foreach ( gboolean
delegate(gboolean
, Paned
) dlg
; paned
.onCycleHandleFocusListeners
)
258 gboolean
delegate(GtkScrollType
, Paned
)[] onMoveHandleListeners
;
259 void addOnMoveHandle(gboolean
delegate(GtkScrollType
, Paned
) dlg
)
261 if ( !("move-handle" in connectedSignals
) )
266 cast(GCallback
)&callBackMoveHandle
,
269 cast(ConnectFlags
)0);
270 connectedSignals
["move-handle"] = 1;
272 onMoveHandleListeners
~= dlg
;
274 extern(C
) static void callBackMoveHandle(GtkPaned
* panedStruct
, GtkScrollType arg1
, Paned paned
)
276 bit consumed
= false;
278 foreach ( gboolean
delegate(GtkScrollType
, Paned
) dlg
; paned
.onMoveHandleListeners
)
286 gboolean
delegate(Paned
)[] onToggleHandleFocusListeners
;
287 void addOnToggleHandleFocus(gboolean
delegate(Paned
) dlg
)
289 if ( !("toggle-handle-focus" in connectedSignals
) )
293 "toggle-handle-focus",
294 cast(GCallback
)&callBackToggleHandleFocus
,
297 cast(ConnectFlags
)0);
298 connectedSignals
["toggle-handle-focus"] = 1;
300 onToggleHandleFocusListeners
~= dlg
;
302 extern(C
) static void callBackToggleHandleFocus(GtkPaned
* panedStruct
, Paned paned
)
304 bit consumed
= false;
306 foreach ( gboolean
delegate(Paned
) dlg
; paned
.onToggleHandleFocusListeners
)
317 * Adds a child to the top or left pane with
318 * default parameters. This is equivalent
319 * to gtk_paned_pack1 (paned, child, FALSE, TRUE).
325 public void add1(Widget child
)
327 // void gtk_paned_add1 (GtkPaned *paned, GtkWidget *child);
328 gtk_paned_add1(gtkPaned
, (child
is null) ?
null : child
.getWidgetStruct());
332 * Adds a child to the bottom or right pane with default
333 * parameters. This is equivalent to
334 * gtk_paned_pack2 (paned, child, TRUE, TRUE).
340 public void add2(Widget child
)
342 // void gtk_paned_add2 (GtkPaned *paned, GtkWidget *child);
343 gtk_paned_add2(gtkPaned
, (child
is null) ?
null : child
.getWidgetStruct());
348 * Adds a child to the top or left pane.
354 * should this child expand when the paned widget is resized.
356 * can this child be made smaller than its requisition.
358 public void pack1(Widget child
, int resize
, int shrink
)
360 // void gtk_paned_pack1 (GtkPaned *paned, GtkWidget *child, gboolean resize, gboolean shrink);
361 gtk_paned_pack1(gtkPaned
, (child
is null) ?
null : child
.getWidgetStruct(), resize
, shrink
);
365 * Adds a child to the bottom or right pane.
371 * should this child expand when the paned widget is resized.
373 * can this child be made smaller than its requisition.
375 public void pack2(Widget child
, int resize
, int shrink
)
377 // void gtk_paned_pack2 (GtkPaned *paned, GtkWidget *child, gboolean resize, gboolean shrink);
378 gtk_paned_pack2(gtkPaned
, (child
is null) ?
null : child
.getWidgetStruct(), resize
, shrink
);
382 * Obtains the first child of the paned widget.
386 * first child, or NULL if it is not set.
389 public Widget
getChild1()
391 // GtkWidget* gtk_paned_get_child1 (GtkPaned *paned);
392 return new Widget( gtk_paned_get_child1(gtkPaned
) );
396 * Obtains the second child of the paned widget.
400 * second child, or NULL if it is not set.
403 public Widget
getChild2()
405 // GtkWidget* gtk_paned_get_child2 (GtkPaned *paned);
406 return new Widget( gtk_paned_get_child2(gtkPaned
) );
411 * Sets the position of the divider between the two panes.
415 * pixel position of divider, a negative value means that the position
418 public void setPosition(int position
)
420 // void gtk_paned_set_position (GtkPaned *paned, gint position);
421 gtk_paned_set_position(gtkPaned
, position
);
425 * Obtains the position of the divider between the two panes.
429 * position of the divider
431 * The "max-position" property
432 * "max-position" gint : Read
433 * The largest possible value for the position property. This property is derived from the
434 * size and shrinkability of the widget's children.
435 * Allowed values: >= 0
436 * Default value: 2147483647
439 public int getPosition()
441 // gint gtk_paned_get_position (GtkPaned *paned);
442 return gtk_paned_get_position(gtkPaned
);