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 = GtkCheckMenuItem.html
27 * outFile = CheckMenuItem
28 * strct = GtkCheckMenuItem
31 * clss = CheckMenuItem
39 * - gtk_check_menu_item_
44 * - gtk_check_menu_item_new_with_label
45 * - gtk_check_menu_item_new_with_mnemonic
52 module gtk
.CheckMenuItem
;
54 private import gtk
.gtktypes
;
56 private import lib
.gtk
;
58 private import glib
.Str
;
62 * A GtkCheckMenuItem is a menu item that maintains the state of a boolean
63 * value in addition to a GtkMenuItem's usual role in activating application
65 * A check box indicating the state of the boolean value is displayed
66 * at the left side of the GtkMenuItem. Activating the GtkMenuItem
69 private import gtk
.MenuItem
;
70 public class CheckMenuItem
: MenuItem
73 /** the main Gtk struct */
74 protected GtkCheckMenuItem
* gtkCheckMenuItem
;
77 public GtkCheckMenuItem
* getCheckMenuItemStruct()
79 return gtkCheckMenuItem
;
83 /** the main Gtk struct as a void* */
84 protected void* getStruct()
86 return cast(void*)gtkCheckMenuItem
;
90 * Sets our main struct and passes it to the parent class
92 public this (GtkCheckMenuItem
* gtkCheckMenuItem
)
94 super(cast(GtkMenuItem
*)gtkCheckMenuItem
);
95 this.gtkCheckMenuItem
= gtkCheckMenuItem
;
99 * Creates a new GtkCheckMenuItem with a label.
100 * If mnemonic it true the label
101 * will be created using gtk_label_new_with_mnemonic(), so underscores
102 * in label indicate the mnemonic for the menu item.
104 * the string to use for the label.
106 * a new GtkCheckMenuItem.
108 public this (char[] label
, bit mnemonic
=true)
112 // GtkWidget* gtk_check_menu_item_new_with_mnemonic (const gchar *label);
113 this(cast(GtkCheckMenuItem
*)gtk_check_menu_item_new_with_mnemonic(Str
.toStringz(label
)) );
117 // GtkWidget* gtk_check_menu_item_new_with_label (const gchar *label);
118 this(cast(GtkCheckMenuItem
*)gtk_check_menu_item_new_with_label(Str
.toStringz(label
)) );
125 // imports for the signal processing
126 private import gobject
.Signals
;
127 private import gdk
.gdktypes
;
128 int[char[]] connectedSignals
;
130 void delegate(CheckMenuItem
)[] onToggledListeners
;
131 void addOnToggled(void delegate(CheckMenuItem
) dlg
)
133 if ( !("toggled" in connectedSignals
) )
138 cast(GCallback
)&callBackToggled
,
141 cast(ConnectFlags
)0);
142 connectedSignals
["toggled"] = 1;
144 onToggledListeners
~= dlg
;
146 extern(C
) static void callBackToggled(GtkCheckMenuItem
* checkmenuitemStruct
, CheckMenuItem checkMenuItem
)
148 bit consumed
= false;
150 foreach ( void delegate(CheckMenuItem
) dlg
; checkMenuItem
.onToggledListeners
)
161 * Creates a new GtkCheckMenuItem.
163 * a new GtkCheckMenuItem.
167 // GtkWidget* gtk_check_menu_item_new (void);
168 this(cast(GtkCheckMenuItem
*)gtk_check_menu_item_new() );
175 * Returns whether the check menu item is active. See
176 * gtk_check_menu_item_set_active().
180 * TRUE if the menu item is checked.
182 public int getActive()
184 // gboolean gtk_check_menu_item_get_active (GtkCheckMenuItem *check_menu_item);
185 return gtk_check_menu_item_get_active(gtkCheckMenuItem
);
189 * Sets the active state of the menu item's check box.
191 * a GtkCheckMenuItem.
193 * boolean value indicating whether the check box is active.
195 public void setActive(int isActive
)
197 // void gtk_check_menu_item_set_active (GtkCheckMenuItem *check_menu_item, gboolean is_active);
198 gtk_check_menu_item_set_active(gtkCheckMenuItem
, isActive
);
203 * gtk_check_menu_item_set_show_toggle is deprecated and should not be used in newly-written code.
204 * Controls whether the check box is shown at all times.
205 * Normally the check box is shown only when it is active or while the
206 * menu item is selected.
208 * a GtkCheckMenuItem.
210 * boolean value indicating whether to always show the check box.
212 public void setShowToggle(int always
)
214 // void gtk_check_menu_item_set_show_toggle (GtkCheckMenuItem *menu_item, gboolean always);
215 gtk_check_menu_item_set_show_toggle(gtkCheckMenuItem
, always
);
219 * Emits the GtkCheckMenuItem::toggled signal.
221 * a GtkCheckMenuItem.
223 public void toggled()
225 // void gtk_check_menu_item_toggled (GtkCheckMenuItem *check_menu_item);
226 gtk_check_menu_item_toggled(gtkCheckMenuItem
);
230 * Retrieves the value set by gtk_check_menu_item_set_inconsistent().
234 * TRUE if inconsistent
236 public int getInconsistent()
238 // gboolean gtk_check_menu_item_get_inconsistent (GtkCheckMenuItem *check_menu_item);
239 return gtk_check_menu_item_get_inconsistent(gtkCheckMenuItem
);
243 * If the user has selected a range of elements (such as some text or
244 * spreadsheet cells) that are affected by a boolean setting, and the
245 * current values in that range are inconsistent, you may want to
246 * display the check in an "in between" state. This function turns on
247 * "in between" display. Normally you would turn off the inconsistent
248 * state again if the user explicitly selects a setting. This has to be
249 * done manually, gtk_check_menu_item_set_inconsistent() only affects
250 * visual appearance, it doesn't affect the semantics of the widget.
254 * TRUE to display an "inconsistent" third state check
256 public void setInconsistent(int setting
)
258 // void gtk_check_menu_item_set_inconsistent (GtkCheckMenuItem *check_menu_item, gboolean setting);
259 gtk_check_menu_item_set_inconsistent(gtkCheckMenuItem
, setting
);
263 * Sets whether check_menu_item is drawn like a GtkRadioMenuItem
267 * whether check_menu_item is drawn like a GtkRadioMenuItem
270 public void setDrawAsRadio(int drawAsRadio
)
272 // void gtk_check_menu_item_set_draw_as_radio (GtkCheckMenuItem *check_menu_item, gboolean draw_as_radio);
273 gtk_check_menu_item_set_draw_as_radio(gtkCheckMenuItem
, drawAsRadio
);
277 * Returns whether check_menu_item looks like a GtkRadioMenuItem
281 * Whether check_menu_item looks like a GtkRadioMenuItem
284 * The "active" property
285 * "active" gboolean : Read / Write
286 * Whether the menu item is checked.
287 * Default value: FALSE
289 public int getDrawAsRadio()
291 // gboolean gtk_check_menu_item_get_draw_as_radio (GtkCheckMenuItem *check_menu_item);
292 return gtk_check_menu_item_get_draw_as_radio(gtkCheckMenuItem
);