I've no idea here...
[gtkD.git] / src / gtk / Frame.d
blobfd9cdd00b62f7fdca0da4ba0491aa9660bd81b66
1 /*
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 = GtkFrame.html
26 * outPack = gtk
27 * outFile = Frame
28 * strct = GtkFrame
29 * realStrct=
30 * ctorStrct=
31 * clss = Frame
32 * interf =
33 * class Code: Yes
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gtk_frame_
40 * - gtk_
41 * omit structs:
42 * omit prefixes:
43 * omit code:
44 * imports:
45 * - glib.Str
46 * - gtk.Widget
47 * structWrap:
48 * - GtkWidget* -> Widget
49 * local aliases:
52 module gtk.Frame;
54 private import gtk.gtktypes;
56 private import lib.gtk;
58 private import glib.Str;
59 private import gtk.Widget;
61 /**
62 * Description
63 * The frame widget is a Bin that surrounds its child
64 * with a decorative frame and an optional label.
65 * If present, the label is drawn in a gap in the
66 * top side of the frame. The position of the
67 * label can be controlled with gtk_frame_set_label_align().
69 private import gtk.Bin;
70 public class Frame : Bin
73 /** the main Gtk struct */
74 protected GtkFrame* gtkFrame;
77 public GtkFrame* getFrameStruct()
79 return gtkFrame;
83 /** the main Gtk struct as a void* */
84 protected void* getStruct()
86 return cast(void*)gtkFrame;
89 /**
90 * Sets our main struct and passes it to the parent class
92 public this (GtkFrame* gtkFrame)
94 super(cast(GtkBin*)gtkFrame);
95 this.gtkFrame = gtkFrame;
98 /**
99 * Creates frame with label and set it's child widget
101 public this(Widget widget, char[] label)
103 this(label);
104 add(widget);
112 * Creates a new GtkFrame, with optional label label.
113 * If label is NULL, the label is omitted.
114 * label:
115 * the text to use as the label of the frame
116 * Returns:
117 * a new GtkFrame widget
119 public this (char[] label)
121 // GtkWidget* gtk_frame_new (const gchar *label);
122 this(cast(GtkFrame*)gtk_frame_new(Str.toStringz(label)) );
126 * Sets the text of the label. If label is NULL,
127 * the current label is removed.
128 * frame:
129 * a GtkFrame
130 * label:
131 * the text to use as the label of the frame
133 public void setLabel(char[] label)
135 // void gtk_frame_set_label (GtkFrame *frame, const gchar *label);
136 gtk_frame_set_label(gtkFrame, Str.toStringz(label));
140 * Sets the label widget for the frame. This is the widget that
141 * will appear embedded in the top edge of the frame as a
142 * title.
143 * frame:
144 * a GtkFrame
145 * label_widget:
146 * the new label widget
148 public void setLabelWidget(Widget labelWidget)
150 // void gtk_frame_set_label_widget (GtkFrame *frame, GtkWidget *label_widget);
151 gtk_frame_set_label_widget(gtkFrame, (labelWidget is null) ? null : labelWidget.getWidgetStruct());
155 * Sets the alignment of the frame widget's label. The
156 * default values for a newly created frame are 0.0 and 0.5.
157 * frame:
158 * a GtkFrame
159 * xalign:
160 * The position of the label along the top edge
161 * of the widget. A value of 0.0 represents left alignment;
162 * 1.0 represents right alignment.
163 * yalign:
164 * The y alignment of the label. A value of 0.0 aligns under
165 * the frame; 1.0 aligns above the frame.
167 public void setLabelAlign(float xalign, float yalign)
169 // void gtk_frame_set_label_align (GtkFrame *frame, gfloat xalign, gfloat yalign);
170 gtk_frame_set_label_align(gtkFrame, xalign, yalign);
174 * Sets the shadow type for frame.
175 * frame:
176 * a GtkFrame
177 * type:
178 * the new GtkShadowType
180 public void setShadowType(GtkShadowType type)
182 // void gtk_frame_set_shadow_type (GtkFrame *frame, GtkShadowType type);
183 gtk_frame_set_shadow_type(gtkFrame, type);
187 * If the frame's label widget is a GtkLabel, returns the
188 * text in the label widget. (The frame will have a GtkLabel
189 * for the label widget if a non-NULL argument was passed
190 * to gtk_frame_new().)
191 * frame:
192 * a GtkFrame
193 * Returns:
194 * the text in the label, or NULL if there
195 * was no label widget or the lable widget was not
196 * a GtkLabel. This string is owned by GTK+ and
197 * must not be modified or freed.
199 public char[] getLabel()
201 // const gchar* gtk_frame_get_label (GtkFrame *frame);
202 return Str.toString(gtk_frame_get_label(gtkFrame) );
206 * Retrieves the X and Y alignment of the frame's label. See
207 * gtk_frame_set_label_align().
208 * frame:
209 * a GtkFrame
210 * xalign:
211 * location to store X alignment of frame's label, or NULL
212 * yalign:
213 * location to store X alignment of frame's label, or NULL
215 public void getLabelAlign(float* xalign, float* yalign)
217 // void gtk_frame_get_label_align (GtkFrame *frame, gfloat *xalign, gfloat *yalign);
218 gtk_frame_get_label_align(gtkFrame, xalign, yalign);
222 * Retrieves the label widget for the frame. See
223 * gtk_frame_set_label_widget().
224 * frame:
225 * a GtkFrame
226 * Returns:
227 * the label widget, or NULL if there is none.
229 public Widget getLabelWidget()
231 // GtkWidget* gtk_frame_get_label_widget (GtkFrame *frame);
232 return new Widget( gtk_frame_get_label_widget(gtkFrame) );
236 * Retrieves the shadow type of the frame. See
237 * gtk_frame_set_shadow_type().
238 * frame:
239 * a GtkFrame
240 * Returns:
241 * the current shadow type of the frame.
242 * Property Details
243 * The "label" property
244 * "label" gchararray : Read / Write
245 * Text of the frame's label.
246 * Default value: NULL
248 public GtkShadowType getShadowType()
250 // GtkShadowType gtk_frame_get_shadow_type (GtkFrame *frame);
251 return gtk_frame_get_shadow_type(gtkFrame);