From acdb2f73daedbde277778c60ffaca8f512486b83 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Mon, 15 Nov 2004 17:47:16 +0000 Subject: [PATCH] * gtk/glue/container.c (gtksharp_container_get_focus_child): New glue method to get container->focus_child * gtk/Gtk.metadata: hide SetFocusChild * gtk/Container.custom (FocusChild): implement with both getter and setter * en/Gtk/Container.xml (FocusChild): Has a getter now too. (Added): Clarify that this only means "Gtk.Container.Add was called", and doesn't get fired when you call Gtk.Box.PackStart, etc svn path=/trunk/gtk-sharp/; revision=36143 --- ChangeLog | 10 ++++++++++ doc/ChangeLog | 7 +++++++ doc/en/Gtk/Container.xml | 20 ++++++++++---------- gtk/Container.custom | 21 +++++++++++++++++++++ gtk/Gtk.metadata | 1 + gtk/glue/container.c | 8 ++++++++ 6 files changed, 57 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1aa790605..80b4fb914 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2004-11-15 Dan Winship + + * gtk/glue/container.c (gtksharp_container_get_focus_child): New + glue method to get container->focus_child + + * gtk/Gtk.metadata: hide SetFocusChild + + * gtk/Container.custom (FocusChild): implement with both getter + and setter + 2004-11-15 Mike Kestner * gtk/Gtk.metadata : hide the Get/Set Color methods that are marked diff --git a/doc/ChangeLog b/doc/ChangeLog index 9228b7398..b7d56ee3c 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,10 @@ +2004-11-15 Dan Winship + + * en/Gtk/Container.xml (FocusChild): Has a getter now too. + (Added): Clarify that this only means "Gtk.Container.Add was + called", and doesn't get fired when you call Gtk.Box.PackStart, + etc + 2004-11-15 Mike Kestner * en/Gtk/ColorSelection.xml : remove newly hidden deprecated methods. diff --git a/doc/en/Gtk/Container.xml b/doc/en/Gtk/Container.xml index 296780d1b..b3a732f8a 100644 --- a/doc/en/Gtk/Container.xml +++ b/doc/en/Gtk/Container.xml @@ -154,8 +154,8 @@ Sets a child property of a . a child of this the child property name - the value to set to - You will not normally need to use this method; Gtk# automatically generates child property accessors for all subclasses. + the value to set to + You will not normally need to use this method; Gtk# automatically generates child property accessors for all subclasses. @@ -172,8 +172,8 @@ Gets a child property of a . a child of this the child property name - the value of the property of - You will not normally need to use this method; Gtk# automatically generates child property accessors for all subclasses. + the value of the property of + You will not normally need to use this method; Gtk# automatically generates child property accessors for all subclasses. @@ -281,7 +281,7 @@ - + Property Gtk.Widget @@ -289,7 +289,7 @@ - Moves the focus to a particular child widget. + Moves the focus to a particular child widget or finds the last-focused widget. A , a child of this container. an object of type @@ -365,8 +365,8 @@ - Fired when a child widget is added to the container. - + Fired when a child widget is added to the container via . + Note that this event is fired only when (or its C equivalent) is called. It is not a generic widget-added notification. For example, calling will not result in this event firing. @@ -389,8 +389,8 @@ - Fired when a child widget is removed from this container. - + Fired when a child widget is removed from this container + Note that this event is fired only when (or its C equivalent) is called. If a subclass defines additional methods for removing widgets, then calling those methods will not result in this event being fired. diff --git a/gtk/Container.custom b/gtk/Container.custom index fdbf9662d..bf1853920 100644 --- a/gtk/Container.custom +++ b/gtk/Container.custom @@ -74,6 +74,27 @@ public Widget[] FocusChain { } +[DllImport("gtksharpglue-2.0")] +static extern IntPtr gtksharp_container_get_focus_child(IntPtr raw); + +[DllImport("libgtk-win32-2.0-0.dll")] +static extern void gtk_container_set_focus_child(IntPtr raw, IntPtr child); + +public Gtk.Widget FocusChild { + get { + IntPtr raw_ret = gtksharp_container_get_focus_child (Handle); + Gtk.Widget ret; + if (raw_ret == IntPtr.Zero) + ret = null; + else + ret = (Gtk.Widget) GLib.Object.GetObject (raw_ret); + return ret; + } + set { + gtk_container_set_focus_child (Handle, value.Handle); + } +} + [DllImport("gtksharpglue-2.0")] static extern void gtksharp_container_base_forall (IntPtr handle, bool include_internals, IntPtr cb, IntPtr data); diff --git a/gtk/Gtk.metadata b/gtk/Gtk.metadata index f2ce54809..a5f0b55f5 100644 --- a/gtk/Gtk.metadata +++ b/gtk/Gtk.metadata @@ -133,6 +133,7 @@ 1 1 1 + 1 Added ResizeChecked Removed diff --git a/gtk/glue/container.c b/gtk/glue/container.c index cbc820a76..d7d9060ea 100644 --- a/gtk/glue/container.c +++ b/gtk/glue/container.c @@ -21,6 +21,14 @@ #include +GtkWidget *gtksharp_container_get_focus_child (GtkContainer *container); + +GtkWidget * +gtksharp_container_get_focus_child (GtkContainer *container) +{ + return container->focus_child; +} + void gtksharp_container_base_forall (GtkContainer *container, gboolean include_internals, GtkCallback cb, gpointer data); void