diff --git a/ChangeLog b/ChangeLog index 0177993dd..d21739cb5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2002-08-13 Joe Shaw + + * configure.in: Check for libgnomecanvas. + + * gtk/ColorSelectionDialog.custom: Create a button subclass which + contains a reference to the parent ColorSelectionDialog. Modify + properties to return this subclass instead of a regular + Gtk.Button. + + * gtk/FileSelection.custom: Ditto. + + * sample/test/TestFileSelection.cs (file_selection_ok): + Demonstrate the button subclass by destroying the parent dialog + when the ok button is clicked. + 2002-08-12 Rachel Hestilow [ Patch from Ricardo Fernandez Pascual for diff --git a/configure.in b/configure.in index fb67f38ba..308067c09 100644 --- a/configure.in +++ b/configure.in @@ -61,7 +61,7 @@ AC_ARG_WITH(crosspkgdir, [ --with-crosspkgdir=/path/to/pkg-config/dir], ## Versions of dependencies GNOME_REQUIRED_VERSION=2.0.0 GTK_REQUIRED_VERSION=2.0.0 -PKG_CHECK_MODULES(BASE_DEPENDENCIES, libgnomeui-2.0 >= $GNOME_REQUIRED_VERSION gtk+-2.0 >= $GTK_REQUIRED_VERSION gmodule-2.0 >= $GTK_REQUIRED_VERSION, enable_gnome=yes, enable_gnome=no) +PKG_CHECK_MODULES(BASE_DEPENDENCIES, libgnomecanvas-2.0 >= $GNOME_REQUIRED_VERSION libgnomeui-2.0 >= $GNOME_REQUIRED_VERSION gtk+-2.0 >= $GTK_REQUIRED_VERSION gmodule-2.0 >= $GTK_REQUIRED_VERSION, enable_gnome=yes, enable_gnome=no) if test "x$enable_gnome" = "xno"; then PKG_CHECK_MODULES(BASE_DEPENDENCIES, gtk+-2.0 >= $GTK_REQUIRED_VERSION gmodule-2.0 >= $GTK_REQUIRED_VERSION) diff --git a/gtk/ColorSelectionDialog.custom b/gtk/ColorSelectionDialog.custom index 1f9a63e59..c9c71a51b 100644 --- a/gtk/ColorSelectionDialog.custom +++ b/gtk/ColorSelectionDialog.custom @@ -8,6 +8,18 @@ // This code is inserted after the automatically generated code. // +public class Button : Gtk.Button { + private ColorSelectionDialog color_sel; + + public ColorSelectionDialog ColorSelectionDialog { + get { return color_sel; } + } + + public Button (ColorSelectionDialog cs, IntPtr raw) : base (raw) { + color_sel = cs; + } +} + [DllImport("gtksharpglue")] static extern IntPtr gtksharp_color_selection_dialog_get_colorsel (IntPtr i); public Gtk.ColorSelection ColorSelection { @@ -17,17 +29,17 @@ public Gtk.ColorSelection ColorSelection { [DllImport("gtksharpglue")] static extern IntPtr gtksharp_color_selection_dialog_get_ok_button (IntPtr i); public Gtk.Button OkButton { - get { return new Gtk.Button (gtksharp_color_selection_dialog_get_ok_button (this.Handle)); } + get { return new Button (this, gtksharp_color_selection_dialog_get_ok_button (this.Handle)); } } [DllImport("gtksharpglue")] static extern IntPtr gtksharp_color_selection_dialog_get_cancel_button (IntPtr i); public Gtk.Button CancelButton { - get { return new Gtk.Button (gtksharp_color_selection_dialog_get_cancel_button (this.Handle)); } + get { return new Button (this, gtksharp_color_selection_dialog_get_cancel_button (this.Handle)); } } [DllImport("gtksharpglue")] static extern IntPtr gtksharp_color_selection_dialog_get_help_button (IntPtr i); public Gtk.Button HelpButton { - get { return new Gtk.Button (gtksharp_color_selection_dialog_get_help_button (this.Handle)); } + get { return new Button (this, gtksharp_color_selection_dialog_get_help_button (this.Handle)); } } diff --git a/gtk/FileSelection.custom b/gtk/FileSelection.custom index 6b5548ca5..52a8cd1d0 100644 --- a/gtk/FileSelection.custom +++ b/gtk/FileSelection.custom @@ -2,12 +2,25 @@ // Gtk.FileSelection.custom - Gtk FileSelection class customizations // // Author: Duncan Mak (duncan@ximian.com) +// Joe Shaw (joe@ximian.com) // // Copyright (C) 2002 Ximian, Inc. // // This code is inserted after the automatically generated code. // +public class Button : Gtk.Button { + private FileSelection file_sel; + + public FileSelection FileSelection { + get { return file_sel; } + } + + public Button (FileSelection fs, IntPtr raw) : base (raw) { + file_sel = fs; + } +} + [DllImport("gtksharpglue")] static extern IntPtr gtksharp_file_selection_get_dir_list (IntPtr i); public Gtk.TreeView DirList { @@ -35,19 +48,19 @@ public Gtk.Label SelectionText { [DllImport("gtksharpglue")] static extern IntPtr gtksharp_file_selection_get_ok_button (IntPtr i); public Gtk.Button OkButton { - get { return new Gtk.Button (gtksharp_file_selection_get_ok_button (this.Handle)); } + get { return new Button (this, gtksharp_file_selection_get_ok_button (this.Handle)); } } [DllImport("gtksharpglue")] static extern IntPtr gtksharp_file_selection_get_cancel_button (IntPtr i); public Gtk.Button CancelButton { - get { return new Gtk.Button (gtksharp_file_selection_get_cancel_button (this.Handle)); } + get { return new Button (this, gtksharp_file_selection_get_cancel_button (this.Handle)); } } [DllImport("gtksharpglue")] static extern IntPtr gtksharp_file_selection_get_help_button (IntPtr i); public Gtk.Button HelpButton { - get { return new Gtk.Button (gtksharp_file_selection_get_help_button (this.Handle)); } + get { return new Button (this, gtksharp_file_selection_get_help_button (this.Handle)); } } [DllImport("gtksharpglue")] @@ -85,19 +98,19 @@ public string FileopFile { [DllImport("gtksharpglue")] static extern IntPtr gtksharp_file_selection_get_fileop_c_dir (IntPtr i); public Gtk.Button FileopCDir { - get { return new Gtk.Button (gtksharp_file_selection_get_fileop_c_dir(this.Handle)); } + get { return new Button (this, gtksharp_file_selection_get_fileop_c_dir(this.Handle)); } } [DllImport("gtksharpglue")] static extern IntPtr gtksharp_file_selection_get_fileop_del_file (IntPtr i); public Gtk.Button FileopDelFile { - get { return new Gtk.Button (gtksharp_file_selection_get_fileop_del_file (this.Handle)); } + get { return new Button (this, gtksharp_file_selection_get_fileop_del_file (this.Handle)); } } [DllImport("gtksharpglue")] static extern IntPtr gtksharp_file_selection_get_fileop_ren_file (IntPtr i); public Gtk.Button FileopRenFile { - get { return new Gtk.Button (gtksharp_file_selection_get_fileop_ren_file (this.Handle)); } + get { return new Button (this, gtksharp_file_selection_get_fileop_ren_file (this.Handle)); } } [DllImport("gtksharpglue")] @@ -111,6 +124,3 @@ static extern IntPtr gtksharp_file_selection_get_action_area (IntPtr i); public new Gtk.HButtonBox ActionArea { get { return new Gtk.HButtonBox (gtksharp_file_selection_get_action_area (this.Handle)); } } - - - diff --git a/sample/test/TestFileSelection.cs b/sample/test/TestFileSelection.cs index f97d9c9e6..8cd0c993f 100644 --- a/sample/test/TestFileSelection.cs +++ b/sample/test/TestFileSelection.cs @@ -39,6 +39,12 @@ namespace WidgetViewer { static void file_selection_ok (object o, EventArgs args) { + Gtk.FileSelection.Button fsbutton = (Gtk.FileSelection.Button) o; + + Console.WriteLine ("ok button clicked!"); + + fsbutton.FileSelection.Destroy (); + } static void show_fileops (object o, EventArgs args)