* generator/ObjectGen.cs (GenChildProperties): If the class has an

ancestor that also defines child properties, make its child
        properties class be a subclass of that ancestor's child properties
        class. (Eg, make Gtk.ButtonBox.ButtonBoxChild be a subclass of
        Gtk.Box.BoxChild.)

svn path=/trunk/gtk-sharp/; revision=40720
This commit is contained in:
Dan Winship 2005-02-15 21:52:21 +00:00
parent a768f58c4f
commit 14ae0b1953
2 changed files with 14 additions and 1 deletions

View file

@ -1,3 +1,11 @@
2005-02-15 Dan Winship <danw@novell.com>
* generator/ObjectGen.cs (GenChildProperties): If the class has an
ancestor that also defines child properties, make its child
properties class be a subclass of that ancestor's child properties
class. (Eg, make Gtk.ButtonBox.ButtonBoxChild be a subclass of
Gtk.Box.BoxChild.)
2005-02-14 Mike Kestner <mkestner@novell.com>
* gdk/Gdk.metadata : mark the color in Rgb.FindColor ref.

View file

@ -257,7 +257,12 @@ namespace GtkSharp.Generation {
StreamWriter sw = gen_info.Writer;
sw.WriteLine ("\t\tpublic class " + Name + "Child : Gtk.Container.ContainerChild {");
ObjectGen child_ancestor = Parent as ObjectGen;
while (child_ancestor.CName != "GtkContainer" &&
child_ancestor.childprops.Count == 0)
child_ancestor = child_ancestor.Parent as ObjectGen;
sw.WriteLine ("\t\tpublic class " + Name + "Child : " + child_ancestor.NS + "." + child_ancestor.Name + "." + child_ancestor.Name + "Child {");
sw.WriteLine ("\t\t\tprotected internal " + Name + "Child (Gtk.Container parent, Gtk.Widget child) : base (parent, child) {}");
sw.WriteLine ("");