GtkSharp/gtk/Dialog.custom
Mike Kestner c9f1eadc11 2004-05-07 Mike Kestner <mkestner@ximian.com>
[Derived from a patch by Ben Maurer]
	* generator/Ctor.cs : generate code to detect subclassing and handle
	GType registration and native object creation properly.
	* generator/Parameters.cs : add PropertyName accessor for param attr.
	* generator/Property.cs : use a new GLib.Value ctor.
	* glib/ObjectManager.cs : redo hash access.
	* glib/Object.cs : CreateNativeObject method to invoke g_object_newv
	and some refactoring of RegisterGType and LookupGType.
	* glib/Value.cs : make gtype field an IntPtr.
	* glib/glue/object.c : glue for g_object_newv use.
	* glib/glue/value.c : new glue for value creation.
	* gtk/Dialog.custom : fix a ctor declaration for auto-reg.
	* gtk/Gtk.metadata : mark a couple property_name attrs as examples.
	* sample/Subclass.cs : use auto-GType-registration now.

svn path=/trunk/gtk-sharp/; revision=26916
2004-05-07 13:42:59 +00:00

63 lines
1.8 KiB
Plaintext

//
// Gtk.Dialog.custom - Gtk Dialog class customizations
//
// Author: Duncan Mak (duncan@ximian.com)
// Mike Kestner (mkestner@speakeasy.net)
//
// Copyright (C) 2002 Ximian, Inc. and Mike Kestner
//
// This code is inserted after the automatically generated code.
//
// Manually wrap until we figure out how to gen ellipses.
[DllImport("libgtk-win32-2.0-0.dll")]
static extern IntPtr gtk_dialog_new_with_buttons (string title, IntPtr i, int flags, IntPtr dummy);
public Dialog (string title, Gtk.Window parent, Gtk.DialogFlags flags) : base(IntPtr.Zero)
{
if (GetType() != typeof (Dialog)) {
GLib.Value[] vals = new GLib.Value [1];
string[] names = new string [1];
names [0] = "title";
vals [0] = new GLib.Value (title);
CreateNativeObject (names, vals);
TransientFor = parent;
if ((flags & DialogFlags.Modal) > 0)
Modal = true;
if ((flags & DialogFlags.DestroyWithParent) > 0)
DestroyWithParent = true;
if ((flags & DialogFlags.NoSeparator) > 0)
HasSeparator = false;
return;
}
Raw = gtk_dialog_new_with_buttons (title, parent.Handle, (int) flags, IntPtr.Zero);
}
[DllImport("gtksharpglue")]
static extern IntPtr gtksharp_dialog_get_vbox (IntPtr i);
public Gtk.VBox VBox {
get { return GLib.Object.GetObject (gtksharp_dialog_get_vbox (this.Handle), false) as VBox; }
}
[DllImport("gtksharpglue")]
static extern IntPtr gtksharp_dialog_get_action_area (IntPtr i);
public Gtk.HButtonBox ActionArea {
get { return GLib.Object.GetObject (gtksharp_dialog_get_action_area (this.Handle), false) as HButtonBox; }
}
public void AddActionWidget (Widget child, ResponseType response)
{
this.AddActionWidget (child, (int) response);
}
public void AddButton (string button_text, ResponseType response)
{
this.AddButton (button_text, (int) response);
}
public void Respond (ResponseType response)
{
this.Respond ((int) response);
}