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 = GtkFileChooserButton.html
27 * outFile = FileChooserButton
28 * strct = GtkFileChooserButton
31 * clss = FileChooserButton
39 * - gtk_file_chooser_button_
52 * - GtkWidget* -> Widget
56 module gtk
.FileChooserButton
;
58 private import gtk
.gtktypes
;
60 private import lib
.gtk
;
62 private import glib
.Str
;
63 private import gtk
.Widget
;
64 private import glib
.ListSG
;;
65 private import gtk
.Widget
;;
66 private import gtk
.FileFilter
;;
67 private import gtk
.FileChooser
;;
71 * The GtkFileChooserButton is a widget that lets the user select a
72 * file. It implements the GtkFileChooser interface. Visually, it is a
73 * file name with a button to bring up a GtkFileChooserDialog.
74 * The user can then use that dialog to change the file associated with
75 * that button. This widget does not support setting the "select-multiple"
77 * Example6.Create a button to let the user select a file in /etc
80 * button = gtk_file_chooser_button_new (_("Select a file"),
81 * GTK_FILE_CHOOSER_ACTION_OPEN);
82 * gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (button),
85 * The GtkFileChooserButton supports the GtkFileChooserActions GTK_FILE_CHOOSER_ACTION_OPEN and GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER.
87 * The GtkFileChooserButton will ellipsize the label,
88 * and thus will thus request little horizontal space. To give the button
89 * more space, you should call gtk_widget_size_request(),
90 * gtk_file_chooser_button_set_width_chars(), or pack the button in
91 * such a way that other interface elements give space to the widget.
93 private import gtk
.HBox
;
94 public class FileChooserButton
: HBox
97 /** the main Gtk struct */
98 protected GtkFileChooserButton
* gtkFileChooserButton
;
101 public GtkFileChooserButton
* getFileChooserButtonStruct()
103 return gtkFileChooserButton
;
107 /** the main Gtk struct as a void* */
108 protected void* getStruct()
110 return cast(void*)gtkFileChooserButton
;
114 * Sets our main struct and passes it to the parent class
116 public this (GtkFileChooserButton
* gtkFileChooserButton
)
118 super(cast(GtkHBox
*)gtkFileChooserButton
);
119 this.gtkFileChooserButton
= gtkFileChooserButton
;
122 private FileChooser fileChooser
;
124 public FileChooser
getFileChooser()
126 if ( fileChooser
is null )
128 fileChooser
= new FileChooser(cast(GtkFileChooser
*)getFileChooserButtonStruct());
138 * Creates a new file-selecting button widget.
140 * the title of the browse dialog.
142 * the open mode for the widget.
144 * a new button widget.
147 public this (char[] title
, GtkFileChooserAction action
)
149 // GtkWidget* gtk_file_chooser_button_new (const gchar *title, GtkFileChooserAction action);
150 this(cast(GtkFileChooserButton
*)gtk_file_chooser_button_new(Str
.toStringz(title
), action
) );
154 * Creates a new file-selecting button widget using backend.
156 * the title of the browse dialog.
158 * the open mode for the widget.
160 * the name of the GtkFileSystem backend to use.
162 * a new button widget.
165 public this (char[] title
, GtkFileChooserAction action
, char[] backend
)
167 // GtkWidget* gtk_file_chooser_button_new_with_backend (const gchar *title, GtkFileChooserAction action, const gchar *backend);
168 this(cast(GtkFileChooserButton
*)gtk_file_chooser_button_new_with_backend(Str
.toStringz(title
), action
, Str
.toStringz(backend
)) );
172 * Creates a GtkFileChooserButton widget which uses dialog as it's
173 * file-picking window. Note that dialog must be a GtkFileChooserDialog (or
174 * subclass) and must not have GTK_DIALOG_DESTROY_WITH_PARENT set.
176 * the GtkFileChooserDialog widget to use.
178 * a new button widget.
181 public this (Widget dialog
)
183 // GtkWidget* gtk_file_chooser_button_new_with_dialog (GtkWidget *dialog);
184 this(cast(GtkFileChooserButton
*)gtk_file_chooser_button_new_with_dialog((dialog
is null) ?
null : dialog
.getWidgetStruct()) );
188 * Retrieves the title of the browse dialog used by button. The returned value
189 * should not be modified or freed.
191 * the button widget to examine.
193 * a pointer to the browse dialog's title.
196 public char[] getTitle()
198 // const gchar* gtk_file_chooser_button_get_title (GtkFileChooserButton *button);
199 return Str
.toString(gtk_file_chooser_button_get_title(gtkFileChooserButton
) );
203 * Modifies the title of the browse dialog used by button.
205 * the button widget to modify.
207 * the new browse dialog title.
210 public void setTitle(char[] title
)
212 // void gtk_file_chooser_button_set_title (GtkFileChooserButton *button, const gchar *title);
213 gtk_file_chooser_button_set_title(gtkFileChooserButton
, Str
.toStringz(title
));
217 * Retrieves the width in characters of the button widget's entry and/or label.
219 * the button widget to examine.
221 * an integer width (in characters) that the button will use to size itself.
224 public int getWidthChars()
226 // gint gtk_file_chooser_button_get_width_chars (GtkFileChooserButton *button);
227 return gtk_file_chooser_button_get_width_chars(gtkFileChooserButton
);
231 * Sets the width (in characters) that button will use to n_chars.
233 * the button widget to examine.
235 * the new width, in characters.
238 public void setWidthChars(int nChars
)
240 // void gtk_file_chooser_button_set_width_chars (GtkFileChooserButton *button, gint n_chars);
241 gtk_file_chooser_button_set_width_chars(gtkFileChooserButton
, nChars
);
245 * Returns whether the button grabs focus when it is clicked with the mouse.
246 * See gtk_file_chooser_button_set_focus_on_click().
248 * a GtkFileChooserButton
250 * TRUE if the button grabs focus when it is clicked with
254 public int getFocusOnClick()
256 // gboolean gtk_file_chooser_button_get_focus_on_click (GtkFileChooserButton *button);
257 return gtk_file_chooser_button_get_focus_on_click(gtkFileChooserButton
);
261 * Sets whether the button will grab focus when it is clicked with the mouse.
262 * Making mouse clicks not grab focus is useful in places like toolbars where
263 * you don't want the keyboard focus removed from the main area of the
266 * a GtkFileChooserButton
268 * whether the button grabs focus when clicked with the mouse
271 * The "dialog" property
272 * "dialog" GtkFileChooserDialog : Write / Construct Only
273 * Instance of the GtkFileChooserDialog associated with the button.
276 public void setFocusOnClick(int focusOnClick
)
278 // void gtk_file_chooser_button_set_focus_on_click (GtkFileChooserButton *button, gboolean focus_on_click);
279 gtk_file_chooser_button_set_focus_on_click(gtkFileChooserButton
, focusOnClick
);