2 * This file is part of gtkD.
4 * gtkD 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 * gtkD 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 gtkD; 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
53 module gtk
.CheckMenuItem
;
59 import tango
.io
.Stdout
; // use the tango loging?
63 private import gtkc
.gtktypes
;
65 private import gtkc
.gtk
;
68 private import glib
.Str
;
75 * A GtkCheckMenuItem is a menu item that maintains the state of a boolean
76 * value in addition to a GtkMenuItem's usual role in activating application
78 * A check box indicating the state of the boolean value is displayed
79 * at the left side of the GtkMenuItem. Activating the GtkMenuItem
82 private import gtk
.MenuItem
;
83 public class CheckMenuItem
: MenuItem
86 /** the main Gtk struct */
87 protected GtkCheckMenuItem
* gtkCheckMenuItem
;
90 public GtkCheckMenuItem
* getCheckMenuItemStruct()
92 return gtkCheckMenuItem
;
96 /** the main Gtk struct as a void* */
97 protected void* getStruct()
99 return cast(void*)gtkCheckMenuItem
;
103 * Sets our main struct and passes it to the parent class
105 public this (GtkCheckMenuItem
* gtkCheckMenuItem
)
109 if ( gtkCheckMenuItem
is null )
114 Stdout("struct gtkCheckMenuItem is null on constructor").newline
;
118 printf("struct gtkCheckMenuItem is null on constructor");
125 assert(gtkCheckMenuItem
!is null, "struct gtkCheckMenuItem is null on constructor");
127 super(cast(GtkMenuItem
*)gtkCheckMenuItem
);
128 this.gtkCheckMenuItem
= gtkCheckMenuItem
;
132 * Creates a new GtkCheckMenuItem with a label.
133 * If mnemonic it true the label
134 * will be created using gtk_label_new_with_mnemonic(), so underscores
135 * in label indicate the mnemonic for the menu item.
137 * the string to use for the label.
139 * a new GtkCheckMenuItem.
141 public this (char[] label
, bool mnemonic
=true)
145 // GtkWidget* gtk_check_menu_item_new_with_mnemonic (const gchar *label);
146 this(cast(GtkCheckMenuItem
*)gtk_check_menu_item_new_with_mnemonic(Str
.toStringz(label
)) );
150 // GtkWidget* gtk_check_menu_item_new_with_label (const gchar *label);
151 this(cast(GtkCheckMenuItem
*)gtk_check_menu_item_new_with_label(Str
.toStringz(label
)) );
158 // imports for the signal processing
159 private import gobject
.Signals
;
160 private import gtkc
.gdktypes
;
161 int[char[]] connectedSignals
;
163 void delegate(CheckMenuItem
)[] onToggledListeners
;
164 void addOnToggled(void delegate(CheckMenuItem
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
166 if ( !("toggled" in connectedSignals
) )
171 cast(GCallback
)&callBackToggled
,
175 connectedSignals
["toggled"] = 1;
177 onToggledListeners
~= dlg
;
179 extern(C
) static void callBackToggled(GtkCheckMenuItem
* checkmenuitemStruct
, CheckMenuItem checkMenuItem
)
181 bool consumed
= false;
183 foreach ( void delegate(CheckMenuItem
) dlg
; checkMenuItem
.onToggledListeners
)
194 * Creates a new GtkCheckMenuItem.
196 * a new GtkCheckMenuItem.
200 // GtkWidget* gtk_check_menu_item_new (void);
201 this(cast(GtkCheckMenuItem
*)gtk_check_menu_item_new() );
208 * Returns whether the check menu item is active. See
209 * gtk_check_menu_item_set_active().
213 * TRUE if the menu item is checked.
215 public int getActive()
217 // gboolean gtk_check_menu_item_get_active (GtkCheckMenuItem *check_menu_item);
218 return gtk_check_menu_item_get_active(gtkCheckMenuItem
);
222 * Sets the active state of the menu item's check box.
224 * a GtkCheckMenuItem.
226 * boolean value indicating whether the check box is active.
228 public void setActive(int isActive
)
230 // void gtk_check_menu_item_set_active (GtkCheckMenuItem *check_menu_item, gboolean is_active);
231 gtk_check_menu_item_set_active(gtkCheckMenuItem
, isActive
);
236 * gtk_check_menu_item_set_show_toggle is deprecated and should not be used in newly-written code.
237 * Controls whether the check box is shown at all times.
238 * Normally the check box is shown only when it is active or while the
239 * menu item is selected.
241 * a GtkCheckMenuItem.
243 * boolean value indicating whether to always show the check box.
245 public void setShowToggle(int always
)
247 // void gtk_check_menu_item_set_show_toggle (GtkCheckMenuItem *menu_item, gboolean always);
248 gtk_check_menu_item_set_show_toggle(gtkCheckMenuItem
, always
);
252 * Emits the GtkCheckMenuItem::toggled signal.
254 * a GtkCheckMenuItem.
256 public void toggled()
258 // void gtk_check_menu_item_toggled (GtkCheckMenuItem *check_menu_item);
259 gtk_check_menu_item_toggled(gtkCheckMenuItem
);
263 * Retrieves the value set by gtk_check_menu_item_set_inconsistent().
267 * TRUE if inconsistent
269 public int getInconsistent()
271 // gboolean gtk_check_menu_item_get_inconsistent (GtkCheckMenuItem *check_menu_item);
272 return gtk_check_menu_item_get_inconsistent(gtkCheckMenuItem
);
276 * If the user has selected a range of elements (such as some text or
277 * spreadsheet cells) that are affected by a boolean setting, and the
278 * current values in that range are inconsistent, you may want to
279 * display the check in an "in between" state. This function turns on
280 * "in between" display. Normally you would turn off the inconsistent
281 * state again if the user explicitly selects a setting. This has to be
282 * done manually, gtk_check_menu_item_set_inconsistent() only affects
283 * visual appearance, it doesn't affect the semantics of the widget.
287 * TRUE to display an "inconsistent" third state check
289 public void setInconsistent(int setting
)
291 // void gtk_check_menu_item_set_inconsistent (GtkCheckMenuItem *check_menu_item, gboolean setting);
292 gtk_check_menu_item_set_inconsistent(gtkCheckMenuItem
, setting
);
296 * Sets whether check_menu_item is drawn like a GtkRadioMenuItem
300 * whether check_menu_item is drawn like a GtkRadioMenuItem
303 public void setDrawAsRadio(int drawAsRadio
)
305 // void gtk_check_menu_item_set_draw_as_radio (GtkCheckMenuItem *check_menu_item, gboolean draw_as_radio);
306 gtk_check_menu_item_set_draw_as_radio(gtkCheckMenuItem
, drawAsRadio
);
310 * Returns whether check_menu_item looks like a GtkRadioMenuItem
314 * Whether check_menu_item looks like a GtkRadioMenuItem
317 * The "active" property
318 * "active" gboolean : Read / Write
319 * Whether the menu item is checked.
320 * Default value: FALSE
322 public int getDrawAsRadio()
324 // gboolean gtk_check_menu_item_get_draw_as_radio (GtkCheckMenuItem *check_menu_item);
325 return gtk_check_menu_item_get_draw_as_radio(gtkCheckMenuItem
);